[2008/06/30]code

一品梅 2008-06-30 08:57:02
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.

...全文
49 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
一品梅 2008-06-30
  • 打赏
  • 举报
回复
ex.
 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" });
}

}

MSDN:
// Construct a GenericPrincipal object based on the generic identity
// and custom roles for the user.
GenericPrincipal genericPrincipal =
new GenericPrincipal(genericIdentity, roles);
一品梅 2008-06-30
  • 打赏
  • 举报
回复
一品梅 2008-06-30
  • 打赏
  • 举报
回复
<link runat="server" 
id="csslnk1"
href="~/MyStyles.css"
rel="stylesheet" type="text/css" />


because the link is runat=server and were setting the href to ~/MyStyles.css, all your pages will get a proper link to the css stylesheet stored in the root of your app regardless of which subfolder your page is being pulled from.

since you defined any background-image urls inside the actual css stylesheet as being relative to the root of your app (where the stylesheet is stored) then all images will be found - again regardless of which subfolder your page is being pulled from.

一品梅 2008-06-30
  • 打赏
  • 举报
回复
Wrong solution
<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>

Right Answer
<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>


一品梅 2008-06-30
  • 打赏
  • 举报
回复
<asp:treeview ID="Treeview1"   CssClass="myclass"
runat="server"></asp:treeview>

<style type="text/css">.myclass a:visited {color:Fuchsia;}</style>

62,266

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧