首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

哪位高手有根据权限来控制显示菜单的例子

2012-01-31 
谁有根据权限来控制显示菜单的例子?谁有根据权限来控制显示菜单的例子?要webform的。我现在有个登录界面(lo

谁有根据权限来控制显示菜单的例子?
谁有根据权限来控制显示菜单的例子?要webform的。我现在有个登录界面(login.aspx)如果为管理员登录,登录成功后显示的index.aspx里的菜单就全显示,如果为别的用户登录,就在index.aspx里显示部分菜单。这种如何实现?另外我的index.aspx代码如下:(是普通的HTML网页)
BODY   onselectstart= "return   false "   bgColor= "#fffbf7 "   leftMargin= "0 "   topMargin= "5 "   onload= "getPrivate() ">
<FIELDSET   style= "MARGIN:   3px;   WIDTH:   100%;   CURSOR:   default ">
<TABLE   cellSpacing= "1 "   cellPadding= "1 "   width= "590 "   border= "0 ">
<TBODY>
<TR>
<TD   align= "center "   width= "42 "   height= "22 ">
<DIV   class= "small_button "   id= "toolbar_m1000 "   onmouseover= "m_in(1000) "   onclick= "expandMenu(1000,7,26); "
onmouseout= "m_out(this.id) "> 文件 </DIV>
</TD>
<TD   align= "center "   width= "74 "   height= "22 ">
<DIV   class= "small_button "   id= "toolbar_m10 "   onmouseover= "m_in(10) "   onclick= "expandMenu(10,69,26); "
onmouseout= "m_out(this.id) "> aa </DIV>
</TD>
<TD   align= "center "   width= "72 "   height= "22 ">
<DIV   class= "small_button "   id= "toolbar_m20 "   onmouseover= "m_in(20) "   onclick= "expandMenu(20,176,26); "
onmouseout= "m_out(this.id) "> bb </DIV>
</TD>
<TD   align= "center "   width= "72 "   height= "22 ">
<DIV   class= "small_button "   id= "toolbar_m30 "   onmouseover= "m_in(30) "   onclick= "expandMenu(30,281,26); "
onmouseout= "m_out(this.id) "> cc </DIV>
</TD>
<TD   align= "center "   width= "72 "   height= "22 ">
<DIV   class= "small_button "   id= "toolbar_m70 "   onmouseover= "m_in(70) "   onclick= "expandMenu(70,386,26); "
onmouseout= "m_out(this.id) "> dd </DIV>
</TD>
<TD   align= "center "   width= "72 "   height= "22 ">
<DIV   class= "small_button "   id= "toolbar_m80 "   onmouseover= "m_in(80) "   onclick= "expandMenu(80,491,26); "
onmouseout= "m_out(this.id) "> 操作员管理 </DIV>
</TD>
</TR>
</TBODY>
</TABLE>
</FIELDSET>
<DIV   class= "menu "   id= "menu1000 ">
<TABLE   cellSpacing= "1 "   cellPadding= "1 "   border= "0 ">
<TBODY>
<TR>
<TD   noWrap   height= "20 ">
<DIV   class= "menuout "   onmouseover= "javascript:this.className= 'menuover ' "   onclick= "javascript:show( '关于 ', 'about.htm ',486,370) "
onmouseout= "javascript:this.className= 'menuout ' "> 关于 </DIV>
</TD>
</TR>
<TR>


<TD   noWrap   height= "20 ">
<DIV   class= "menuout "   onmouseover= "javascript:this.className= 'menuover ' "   onclick= "javascript:show( '退出系统 ', 'exit ',0,0) "
onmouseout= "javascript:this.className= 'menuout ' "> 退出系统 </DIV>
</TD>
</TR>
</TBODY>
</TABLE>
</DIV>
<DIV   class= "menu "   id= "menu10 ">
<TABLE   cellSpacing= "1 "   cellPadding= "1 "   border= "0 ">
<TBODY>
<TR>
<TD   noWrap   height= "20 ">
<DIV   class= "menuout "   onmouseover= "javascript:this.className= 'menuover '; "   onclick= "winopen( 'ge_note.aspx ') "
onmouseout= "javascript:this.className= 'menuout ' "> aa1 </DIV>
</TD>
</TR>
<TR>
<TD   noWrap   height= "20 ">
<DIV   class= "menuout "   onmouseover= "javascript:this.className= 'menuover '; "   onclick= "windowsopen( 'rent_ge.aspx ') "
onmouseout= "javascript:this.className= 'menuout ' "> aa2 </DIV>
</TD>
</TR>
<TR>
<TD   noWrap   height= "20 ">
<DIV   class= "menuout "   onmouseover= "javascript:this.className= 'menuover '; "   onclick= "windowsopen( 'rent_car.aspx ') "
onmouseout= "javascript:this.className= 'menuout ' "> aa3 </DIV>
</TD>
</TR>
</TBODY>
</TABLE>
</DIV>
<DIV   class= "menu "   id= "menu20 ">
<TABLE   cellSpacing= "1 "   cellPadding= "1 "   border= "0 ">
<TBODY>
<TR>
<TD   noWrap   height= "20 ">
<DIV   class= "menuout "   onmouseover= "javascript:this.className= 'menuover '; "   onclick= "winopen( 'ge_note_jk.aspx ') "
onmouseout= "javascript:this.className= 'menuout ' "> bb1 </DIV>
</TD>
</TR>
</TBODY>
</TABLE>
</DIV>
<DIV   class= "menu "   id= "menu30 ">
<TABLE   cellSpacing= "1 "   cellPadding= "1 "   border= "0 ">
<TBODY>
<TR>
<TD   noWrap   height= "20 ">
<DIV   class= "menuout "   onmouseover= "javascript:this.className= 'menuover '; "   onclick= "windowsopen( 'area.aspx ') "
onmouseout= "javascript:this.className= 'menuout ' "> cc1 </DIV>
</TD>
</TR>
<TR>
<TD   noWrap   height= "20 ">
<DIV   class= "menuout "   onmouseover= "javascript:this.className= 'menuover '; "   onclick= "windowsopen( 'place.aspx ') "
onmouseout= "javascript:this.className= 'menuout ' "> cc2 </DIV>


</TD>
</TR>
<TR>
<TD   noWrap   height= "20 ">
<DIV   class= "menuout "   onmouseover= "javascript:this.className= 'menuover '; "   onclick= "windowsopen( 'generator.aspx ') "
onmouseout= "javascript:this.className= 'menuout ' "> cc3 </DIV>
</TD>
</TR>
<TR>
<TD   noWrap   height= "20 ">
<DIV   class= "menuout "   onmouseover= "javascript:this.className= 'menuover '; "   onclick= "windowsopen( 'oil.aspx ') "
onmouseout= "javascript:this.className= 'menuout ' "> cc4 </DIV>
</TD>
</TR>
<TR>
<TD   noWrap   height= "20 ">
<DIV   class= "menuout "   onmouseover= "javascript:this.className= 'menuover '; "   onclick= "windowsopen( 'userinfo.aspx ') "
onmouseout= "javascript:this.className= 'menuout ' "> cc5 </DIV>
</TD>
</TR>
</TBODY>
</TABLE>
</DIV>
<DIV   class= "menu "   id= "menu70 ">
<TABLE   cellSpacing= "1 "   cellPadding= "1 "   border= "0 ">
<TBODY>
<TR>
<TD   noWrap   height= "20 ">
<DIV   class= "menuout "   onmouseover= "javascript:this.className= 'menuover '; "   onclick= "windowsopen( '.aspx ') "
onmouseout= "javascript:this.className= 'menuout ' "> 统计信息 </DIV>
</TD>
</TR>
</TBODY>
</TABLE>
</DIV>
<DIV   class= "menu "   id= "menu80 ">
<TABLE   cellSpacing= "1 "   cellPadding= "1 "   border= "0 ">
<TBODY>
<TR>
<TD   noWrap   height= "20 ">
<DIV   class= "menuout "   onmouseover= "javascript:this.className= 'menuover '; "   onclick= "winopen( 'password.asp ') "
onmouseout= "javascript:this.className= 'menuout ' "> 密码修改 </DIV>
</TD>
</TR>
</TBODY>
</TABLE>
</DIV>
<DIV   class= "menu "   id= "menu90 ">
<TABLE   cellSpacing= "1 "   cellPadding= "1 "   border= "0 ">
<TBODY>
</TBODY>
</TABLE>
</DIV>
</BODY>

如何控制呢?谢谢大家能为我解决这个问题!

[解决办法]
看你的情况可以把每个DIV加一个ID

<DIV id=div1 class= "small_button " id= "toolbar_m10 " onmouseover= "m_in(10) " onclick= "expandMenu(10,69,26); "
onmouseout= "m_out(this.id) "> aa </DIV>

如果不是管理员则
div1.style.display = 'none '

热点排行