|
That comes closer but your code will only add nodes at the root level. This will not give hierarchical structure. To get a hierarchical structure, you should have some mechanism to identify the nodes parent and child nodes.
I have answered a similar question a while back. See here[^] if you are interested.
|
|
|
|
|
Are you aware about the existence of documentation?[^]. Here is what it says:
The TreeView control can also be bound to data. You can use either of two methods to bind the TreeView control to the appropriate data source type:- The TreeView control can use any data source control that implements the IHierarchicalDataSource interface, such as an XmlDataSource control or a SiteMapDataSource control. To bind to a data source control, set the DataSourceID property of the TreeView control to the ID value of the data source control. The TreeView control automatically binds to the specified data source control. This is the preferred method to bind to data.
- The TreeView control can also be bound to an XmlDocument object or a DataSet object with relations. To bind to one of these data sources, set the DataSource property of the TreeView control to the data source, and then call the DataBind method.
|
|
|
|
|
Better If you use xml.
Create a xml file xtracting data from both the table(Suppose filename is x.xml)
<menu type="root" value="HOME" url="~/Accounts/Index1.aspx">
<submenu type="folder" value="Fruits">
<state type="document" url="~/HR/a.aspx" value="Apple"/>
<state type="document" url="~/HR/b.aspx" value="Mango"/>
<state type="document" url="~/hr/c.aspx" value="Grapes"/>
</submenu>
</menu>
Add a treeview Control on your form page
in page_load section paste following codes:
In CodeBehindfile
XmlDataSource obxlmAdditional = new XmlDataSource();
obxlmAdditional.DataFile = "/x.xml";
treeMenu.DataSource = obxlmAdditional;
treeMenu.DataBind();
|
|
|
|
|
I am binding to the Gridview as follows:
BusinessUnitPartsGrid.DataSource = GetBusinessUnitsForParts(partnumberstring, ProjectId);
BusinessUnitPartsGrid.DataBind();
//GetBusinessUnitsForParts returns a dataset.
After this, I am doing as below:
foreach (GridViewRow gvr in BusinessUnitPartsGrid.Rows)
{
if (gvr.Cells[0].Text.Trim() == " ")
{
gvr.BackColor = Color.Red;
}
}
However, control never comes inside this loop because when I checked BusinessUnitPartsGrid.Rows.Count, it is 0. However, there are actually 5 rows and all the 5 are displaying in UI. What's happening here? Am I doing something wrong in the above code? Please help.
Thanks
meeram395.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
If you are binding GridView in PageLoad, then you have to take care of PostBack.
From next time, post code in Code Block tag.
|
|
|
|
|
This is not in pageload event. Actually,there is a Wizard control and when clicking on last but-one Next button, I am calling the above code in ActiveStep change event.
From next time onwards, I will make sure that the code will be in code block itself.
Thanks
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Hello everyone,
Please I need help on the How to send E-mail from an ASPX page with VB.NET.
Thanks all.
Tunsten
|
|
|
|
|
Did you searched about it?
Read This[^]
|
|
|
|
|
Well, google has thousands of examples, so why not look there?
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
Hello everybody,
Is there any control like NumericUpDown(spinner) that is available in .Net framework specifically for web applications? I want it to use in web applications that is with asp.net. Thank you all.
|
|
|
|
|
|
Hey I thank you very much. I included the .dll file of (ajax control toolkit) in my visual studio and a can see for it and many other controls, but they are not active. How do I make them active? There is no refresh. Thank you.
|
|
|
|
|
It is an extender so you have add it to textbox..!by clicking smart tad on textbox add extender..!
|
|
|
|
|
HI,
I want to change the shape of the DIV using the CSS. I want the circular DIV rather than the general square DIV.
Please need help on this topic.
Thanks in advance.
Yogesh
|
|
|
|
|
|
hi
i am having 3 server (load balancing),however when i use this i am getting issue in session
i.e session in one server cannot access by other server..how to overcome this?
Please help me
Ramkumar
|
|
|
|
|
Which session mode are you using in Load Balancing enviroment ? Is it S/W LB or NLB ?
Please read this article, I have explained each and every thing on Session under LB enviroment.
Exploring Session in ASP.Net[^]
It may help you
|
|
|
|
|
when i upload my code i got this error
Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type '_Default'.
Source Error:
Line 1: <%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>
Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Source File: f:\inetpub\suntvaus\Default.aspx Line: 1
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET Version:1.1.4322.2300
any one pls explain this
|
|
|
|
|
AS you're still in the stone age ( ASP.NET 1.1 ), it means you didn't upload your dlls.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
can you pls explain me detailed
|
|
|
|
|
I don't really get why people are writing code, posting here, but have no idea what they are doing.
ASP.NET 1.1 compiles all your code into a dll, as far as I recall. That dll contains your .cs files. It needs to be on the server. With newer versions, the .cs files themselves need to be on the server. Either way, it's saying that the class that it needs to generate to generate an instance of the page ( which is your code behind ) has not been uploaded.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Now i am getting this error
Server Error in '/' Application.
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.
Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File -->
<configuration>
<system.web>
<customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
|
|
|
|
|
EVERY DAY !!! Every day, someone posts this here. Why can you people not READ what the error message says ? Why can't you think for yourselves ? The message means what it says. It means your website is broken, and your web.config settings need to be changed for you to see the actual error. What you posted, are explicit instructions on what to do, in order to see the actual error.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I think these people just see the bold big caption Server Error in '/' Application. and immediately come to the conclusion that something broke down and they should take help of somebody to solve the problem.
The pertinent software vendors should seriously consider revising the text and caption of the error message to something more catchy and inspiring for these lazy guys to continue reading the rest of the text in the page.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
Only thing u can do to catch the error.. u go and debug that site on ur server where u published this site..
there actual error u get...
|
|
|
|