Click here to Skip to main content
15,912,932 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questiondownload Pin
hajixet8-Apr-07 0:16
hajixet8-Apr-07 0:16 
AnswerRe: download Pin
enjoycrack8-Apr-07 0:21
enjoycrack8-Apr-07 0:21 
QuestionHow to create subdomain ? Pin
amin_behzadi7-Apr-07 23:46
professionalamin_behzadi7-Apr-07 23:46 
AnswerRe: How to create subdomain ? Pin
enjoycrack8-Apr-07 0:23
enjoycrack8-Apr-07 0:23 
Questionhow can rename a table in sql server 2000 (with tsql in query analyzer)? Pin
B.A7-Apr-07 20:54
B.A7-Apr-07 20:54 
AnswerRe: how can rename a table in sql server 2000 (with tsql in query analyzer)? Pin
Kunal P7-Apr-07 21:11
Kunal P7-Apr-07 21:11 
AnswerRe: how can rename a table in sql server 2000 (with tsql in query analyzer)? Pin
B.A7-Apr-07 22:38
B.A7-Apr-07 22:38 
QuestionTreeview problems with childnodes depth Pin
simsen7-Apr-07 20:43
simsen7-Apr-07 20:43 
Hi,

I have the following treeview, wich works perfect if I only have a depth of childnodes of one. But my problem is that my menu has a childnode depth of two.... Like this

Home
Products
--Dogs
----Food
----Brushes
--Cats
----Food
----Brushes
--Horses
Links

My code only expand (when I click on Products) and shows
Home
Products
--Dogs
--Cats
--Horses
Links

When I try to clik on Dogs - it does'nt expand the nex childnode (Food and Brushes)..... I tried to made a "Run to curser", and I can see, it does not go back to the server, and runs TreeNodePopulate. Can anyone help me? I want to expand also when I click on Dogs and so on.

My code:
aspx:

<asp:treeview id="MenuTree" enableclientscript="true" runat="server" maxdatabinddepth="2" expanddepth="2" showexpandcollapse="False" ontreenodecollapsed="MenuTree_TreeNodeCollapsed" ontreenodeexpanded="MenuTree_TreeNodeExpanded" ontreenodepopulate="MenuTree_TreeNodePopulate" populatenodesfromclient="true">
<hovernodestyle font-underline="True">
<selectednodestyle backcolor="Gray" font-underline="True">


aspx.cs:

public partial class Admin_SideAdm : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
ANSIApi api = new ANSIApi();

if (IsPostBack == false)
{
try
{
if (api.GetTopMenu(MenuTree) == ANSIApi.FStatus.Success)
{ }
}
catch
{ }
}
}

protected void MenuTree_TreeNodePopulate(object sender, TreeNodeEventArgs e)
{
//hvis der ikke er nogen child nodes til noden
if (e.Node.ChildNodes.Count == 0)
{
try
{
api.GetSubMenu(e.Node);
}
catch
{ }
}
}

protected void MenuTree_TreeNodeCollapsed(object sender, TreeNodeEventArgs e)
{
try
{
int key_id = Convert.ToInt32(e.Node.Value);

lblMenuId.Text = key_id.ToString();

lblMenuId.Visible = true;
}
catch
{
}
}

protected void MenuTree_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
{
try
{
int key_id = Convert.ToInt32(e.Node.Value);

lblMenuId.Text = key_id.ToString();

lblMenuId.Visible = true;

if (e.Node.Depth == 0)
{
TreeView t = (TreeView)sender;

for (int i = 0; i < t.Nodes.Count; i++)
{
if (t.Nodes[i] != e.Node)
{
t.Nodes[i].CollapseAll();
}
}
}
}
catch
{
}
}
}


Kind regards,
simsen Smile | :)
QuestionSession Problem.. (Back Button) Pin
Kunal P7-Apr-07 19:41
Kunal P7-Apr-07 19:41 
AnswerRe: Session Problem.. (Back Button) Pin
_mubashir8-Apr-07 2:59
_mubashir8-Apr-07 2:59 
GeneralRe: Session Problem.. (Back Button) Pin
Kunal P9-Apr-07 18:19
Kunal P9-Apr-07 18:19 
AnswerRe: Session Problem.. (Back Button) Pin
Venkatesh Mookkan8-Apr-07 18:50
Venkatesh Mookkan8-Apr-07 18:50 
Questiontcp/ip port listening Pin
Harikrk7-Apr-07 19:03
Harikrk7-Apr-07 19:03 
QuestionControl/Access Local Web Service(SOAP) from C# Desktop Application [modified] Pin
oolatin797-Apr-07 14:28
oolatin797-Apr-07 14:28 
QuestionHow to send variable from aspx.cs page to aspx page Pin
mani_iips7-Apr-07 5:10
mani_iips7-Apr-07 5:10 
AnswerRe: How to send variable from aspx.cs page to aspx page Pin
Hayder Marzouk7-Apr-07 6:42
Hayder Marzouk7-Apr-07 6:42 
QuestionHow can i bind DetailsView Pin
mghiassi7-Apr-07 4:19
mghiassi7-Apr-07 4:19 
AnswerRe: How can i bind DetailsView Pin
Naveed Kamboh7-Apr-07 8:06
Naveed Kamboh7-Apr-07 8:06 
GeneralRe: How can i bind DetailsView [modified] Pin
mghiassi7-Apr-07 18:43
mghiassi7-Apr-07 18:43 
GeneralRe: How can i bind DetailsView Pin
Abolfazl Sheikhloo7-Apr-07 22:30
Abolfazl Sheikhloo7-Apr-07 22:30 
QuestionHow can i use Application Object Pin
mghiassi7-Apr-07 4:16
mghiassi7-Apr-07 4:16 
AnswerRe: How can i use Application Object Pin
kubben7-Apr-07 4:45
kubben7-Apr-07 4:45 
GeneralRe: How can i use Application Object Pin
mghiassi7-Apr-07 6:01
mghiassi7-Apr-07 6:01 
GeneralRe: How can i use Application Object Pin
kubben7-Apr-07 7:20
kubben7-Apr-07 7:20 
GeneralRe: How can i use Application Object Pin
mghiassi7-Apr-07 18:36
mghiassi7-Apr-07 18:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.