|
It would be like this
protected void GridView1_OnRowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (((e.Row.RowIndex+1) % 2) == 0)
{
e.Row.BackColor = System.Drawing.Color.Gray;
}
}
}
This will change your alternative Row color. The main thing is that you need to use OnRowCreated method.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
You can set the TR's className by JS, for example:
function initTableTrColor(tabId, style1, style2){
var tabobj = document.getElmentById(tabId);
var trArray = tabobj.getElmentByTagName("TR");
for(var i=0; i
modified 27-May-14 5:05am.
|
|
|
|
|
Hi,
I am taking a project from vss. following are the steps which i am following:
1) opening microsoft visual sourcesafe 6.0
2) set working folder in c:\inetpub\wwwroot\folder_name
3) get latest version recursive.
after this process, i try to open the project in microsoft visual studio by clicking on the solution file created for the project from c:\inetpub\wwwroot\folder_name, but it again asks me to create a folder with the same project name and again it generates all the files in the newly generated folder. the folder hierarchy goes like this:
c:\inetpub\wwwroot\folder_name\folder_name and the files.
Sandeep Kumbhar
|
|
|
|
|
You can try this :
Copy you project first and than set this as working folder
and than do get latest operation
not sure but you can try above may it resolve problme becasue it worked for me once
|
|
|
|
|
hi,
i am not getting the line, Copy the project .what to do exactly?
thanks,
Sandeep Kumbhar
|
|
|
|
|
Hi
First open your visual studio.
1.File menu-->open-->open project/Solution-->open project window will open.
2.Open project-->click on Source safe-select vss from the network-
3.Give u r username and password and select your project.
your's subbu
|
|
|
|
|
I am new to web appliations development. I am suing ASP.Net 2.0 / VS2005. I had the user credentials in XML file. I have two different menuWebPage with 2 diff sitemaps, which displayes the menu for two different logins. and made the chages in web.config as below,
<siteMap defaultProvider="sitemap1" enabled="true">
<providers>
<add
name="sitemap1"
type="System.Web.XmlSiteMapProvider"
siteMapFile="~/XYZ/XYZWeb.sitemap"/>
<add
name="sitemap2"
type="System.Web.XmlSiteMapProvider"
siteMapFile="~/ABC/ABCWeb.sitemap" />
</providers>
</siteMap>
And changed SiteMapProvider="sitemap1" / SiteMapProvider="sitemap1"on the webpages
But Treeveiw control looks like below on the web page in Desing/run view as well
- Root
- Parent
Sibling node1
- Current node
-Child node1
-Child node2
UsersXML file
==============
<Staff>
<User>
<username>User1</username>
<password>User1pw</password>
<Role>Admin</Role>
</User>
<User>
<username>user2</username>
<password>user2pw</password>
<Role>SuperUser</Role>
</User>
</Staff>
Please advice.
|
|
|
|
|
How to resolve quot xml parsing issue by using C# .net. For example, I have this node:
<code>
&lt;description&gt;&amp;#60;p&gt;&amp;#60;a href="http://us.rd.yahoo.com/dailynews/rss/tech/*http://news.yahoo.com/s/afp/20091230/ts_alt_afp/usitcomputersecurityinternetmcafee"&gt;&amp;#60;img src="http://d.yimg.com/a/p/afp/20091230/capt.photo_1262191861138-1-0.jpg?x=130&amp;amp;y=84&amp;amp;q=85&amp;amp;sig=XB8VuNiiCtOC5TYh6H441w--" align="left" height="84" width="130" alt="The logo of social networking website &amp;#39;Facebook&amp;#39; is displayed on a computer screen. &amp;quot;The explosion of applications on Facebook and other services will be an ideal vector for cybercriminals,&amp;quot; McAfee said.(AFP/File/Leon Neal)" border="0" /&gt;&amp;#60;/a&gt;AFP - Social networks will face increasingly sophisticated hacker attacks in 2010 but law enforcement is expected to make strides in fighting cybercrime, according to Web security firm McAfee Labs.&amp;#60;/p&gt;&amp;#60;br clear="all"/&gt;&lt;/description&gt;
</code>
and the string either
<code><u>&amp;#39;Facebook&amp;#39; </u></code>
or the string
<code>
<u>quot;The explosion of applications on Facebook and other services will be an ideal vector for cybercriminals,&quot; </u>
</code>
is causing the page to fail the validation by HTML validator. Some of the errors about the specific lines are:
<pre>
#
* Line 378, column > 80: XML Parsing Error: attributes construct error
&/s/afp/20091230/ts_alt_afp/usitcomputersecurityinternetmcafee"><img src="http&
* Line 378, column > 80: XML Parsing Error: Couldn't find end of Start Tag img line 378
&/s/afp/20091230/ts_alt_afp/usitcomputersecurityinternetmcafee"><img src="http&
# Error X is not a member of a group specified for any attribute
* Line 378, column 374: "The" is not a member of a group specified for any attribute
&isplayed on a computer screen. "The explosion of applications on Facebook and
* Line 378, column 384: "explosion" is not a member of a group specified for any attribute
&n a computer screen. "The explosion of applications on Facebook and other ser
* Line 378, column 387: "of" is not a member of a group specified for any attribute
& computer screen. "The explosion of applications on Facebook and other servic
* Line 378, column 400: "applications" is not a member of a group specified for any attribute
&een. "The explosion of applications on Facebook and other services will be an
* Line 378, column 403: "on" is not a member of a group specified for any attribute
&. "The explosion of applications on Facebook and other services will be an id
</pre>
I have tried codes like
<code>
mystring = str.Replace( "&apos;", "'" );
mystring = str.Replace( "&quot;", "\"" );
</code>
But these two lines are generating more errors. Please tell me or give me suggestions what you know about this specific issue of validating where ' is involved. You can find the rss file at http://rss.news.yahoo.com/rss/tech
|
|
|
|
|
Try this
Everything inside a CDATA section is ignored by the parser.
A CDATA section starts with "<![CDATA[" and ends with "]]>":
so put your xml string in cdata section it resolve your error because parser ignore your data which is in your cdata section
|
|
|
|
|
I have used following code on my button click
Code:
Response.Redirect("http://www.microsoft.com/gohere/look.htm");but the problem is i have to click 2 times for nevigation.
when i clicked for fitst time it just refresh the page ...and second time it actually nevigates the page...
what should i do ???....
i have tried Anchor, LinkButton but failed...........
thanks in advance.....
Rating always..... WELCOME
Be a good listener...Because Opprtunity knoughts softly...N-Joy
|
|
|
|
|
try using server.transfer...check ispostback property
|
|
|
|
|
Try checking if your button's AutoPostBack = true.
modified 27-May-14 5:06am.
|
|
|
|
|
Hi All,
I am using VS 2008, 3.5 and am trying to add drag and drop functionality to the treeview. However, the allowdrop property is non existent on the treeview control.
I am baffled as to why this is the case.
Even when Ive instantiated the control it is neither existant nor does it appear behind the server control. help is much appreciated.
Kind Regards
|
|
|
|
|
|
Hello, I've been working on an e-commerce site for a couple of weeks. I'm at a point where I want to use a datalist to display a subset of my catalog. Well, nothing in the datalist displays when I bring up the page in IE with either IIS 7 or VS built-in iis server.
I've isolated a simple piece of code that illustrates my dilemna within a defalut.aspx file:
<form id="form1" runat="server">
<div>
<asp:DataList ID="DataList1" runat="server">
<ItemTemplate>
Hello!
</ItemTemplate>
</asp:DataList>
</div>
</form>
This page should show: "Hello", yet the page is blank. More configuration details:
- running Windows 7
- VS 2008
- IIS 7
Any assistance or suggestions to point me in the right direction would be greatly appreciated. Thanks in advance.
|
|
|
|
|
on page loadon the server side , you are missing the following code
DataList1.DataBind();
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
I apologize, I knew there was something I left out. This is what I had in the code-behind:
protected void Page_Load(object sender, EventArgs e)
{
DataList1.DataBind();
}
So, I have a "Default3.aspx" file with the DataList1 control, and a "Default3.aspx.cs" file with the DataBind() call.
|
|
|
|
|
jboyd111 wrote: DataList1.DataBind();
That's OK, but you need to tell the datasource from where the data is to be used.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
I uploaded the default aspnetdb.mdf database an my web server but i still cannot figure out a way to make my web application interface with de data base.
the connection string on my localhost is:
Data Source=.\SQLEXPRESS;AttachDbFilename="D:\Documents and Settings\Abdulhafeez\Desktop\Runningcodes\App_Data\ASPNETDB.MDF";Integrated Security=True;User Instance=True
could any1 pls help me modify it to a working connection with a web server?
|
|
|
|
|
Do you get any Errors ? and what are the Erros ?
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
Do not attach file when you are in the production server, rather do like this :
1. Create a Login for ASPNET Account to the SQL Server instance
2. Attach the ASPNET.MDF file to the SQL Server itself using
CREATE DATABASE [ASPNET] ON <br />
( FILENAME = N'D:\Documents and Settings\Abdulhafeez\Desktop\Runningcodes\App_Data\ASPNETDB.MDF' ),<br />
( FILENAME = N'D:\Documents and Settings\Abdulhafeez\Desktop\Runningcodes\App_Data\ASPNETDB_log.LDF' )<br />
FOR ATTACH<br />
Run it in Master Database.
|
|
|
|
|
I still did not get the explaination you did. pls explain it to me cos am a bit too dol.
|
|
|
|
|
I meant you need to attach the database to a database instance installed in your operating system.
|
|
|
|
|
try changing the AttachDbFilename attribute in Connection string. It might help you.
Data Source=.\SQLEXPRESS;AttachDbFilename="|DataDirectory|ASPNETDB.MDF";Integrated Security=True;User Instance=True
|
|
|
|
|
Hi,
Has any one used AOP yet? What's the use of doing it this way?
Any helpful articles with some decent tutorials/explanations for beginners?
Regards,
Brendan
|
|
|
|