62,266
社区成员
发帖
与我相关
我的任务
分享if( treeview1.SelectedNode.Parent == null)
// that means your selected node is a root.
else
// that means your selected node is not a root.
to know whether it is a parent node or a leafnode
if(treeview1.selectednode.childnodes.count == 0)
// its a child node
else
//its a parent node.
void Application_PostAuthenticateRequest(Object sender, EventArgs e)
{
if (HttpContext.Current.User.Identity.IsAuthenticated == true)
{
if (HttpContext.Current.User.Identity.Name.ToLowerInvariant() == "AllSections".ToLowerInvariant())
HttpContext.Current.User = new GenericPrincipal(HttpContext.Current.User.Identity,new string[]{"Administrators"});
else
HttpContext.Current.User = new GenericPrincipal(HttpContext.Current.User.Identity, new string[] { "Regular Users" });
}
}
// Construct a GenericPrincipal object based on the generic identity
// and custom roles for the user.
GenericPrincipal genericPrincipal =
new GenericPrincipal(genericIdentity, roles);<link runat="server"
id="csslnk1"
href="~/MyStyles.css"
rel="stylesheet" type="text/css" />
<asp:ImageButton id="ImageButton2"
onmouseover="this.src='../Images/textRoll.png'"
onmouseout="this.src='../Images/text.png'"
runat="server"
ImageUrl="~/Images/text.png"></asp:ImageButton></td>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript" language=javascript>
function mouseover(arg)
{
arg.src = "<%= Page.ResolveUrl("~/Image/028439.jpg") %>";
}
function mouseout(arg)
{
arg.src = "<%= Page.ResolveUrl("~/Image/012316.jpg") %>";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ImageButton id="ImageButton2"
onmouseover="mouseover(this)"
onmouseout="mouseout(this)"
runat="server"
ImageUrl="~/Image/007004.gif"></asp:ImageButton></
</div>
</form>
</body>
</html>
<asp:treeview ID="Treeview1" CssClass="myclass"
runat="server"></asp:treeview><style type="text/css">.myclass a:visited {color:Fuchsia;}</style>