Hi ..

i am newbie in asp.net programming :funnyup

my problem was:

[objective] : to hide menu from the javascript dropdownmenu

[control] : 2 user, 1 as admin and another as user …

[introduction] : use same webpage, namely mainpage.aspx with js dropdownmenu

[problem] some of the links in the dropdownmenu were for Admin …

how to implement javascript that can differentiate the user… If-Else ?
helpp..

my boss said that, we can hide the menu from the dropdownmenu list according to the user access level, that is ‘admin’ and ‘user’

this is the dropdownmenu JS

PHP Code:


    <td width=“50″><ul id=“sddm”>
      <
li><a href=“#” onmouseover=“mopen(’m1′)” onmouseout=“mclosetime()”>Pengguna </a>
          <
div id=“m1″ onmouseover=“mcancelclosetime()” onmouseout=“mclosetime()”> <a href=“#”>Ubah Kata Laluan </a> <a href=“#”>Tambah Pengguna </a> <a href=“#”>Hapus Pengguna </a> </div>
      </
li>
      <
li><a href=“#” onmouseover=“mopen(’m3′)” onmouseout=“mclosetime()”>Rekod Kursus </a>
          <
div id=“m3″ onmouseover=“mcancelclosetime()” onmouseout=“mclosetime()”> <a href=“kursustambah.aspx”>Tambah Rekod Kursus</a> <a href=“pesertatambah.aspx”>Tambah Rekod Peserta</a> <a href=“kursuskemaskinicari.aspx”>Kemaskini Rekod Kursus</a> <a href=“kursushapus.aspx”>Hapus Rekod Kursus</a> </div>
      </
li>
      <
li><a href=“kajiselidik.aspx” onmouseover=“mopen(’m4′)” onmouseout=“mclosetime()”>Kaji Selidik </a>
      </
li>
      <
li><a href=“datacari.aspx” onmouseover=“mopen(’m4′)” onmouseout=“mclosetime()”>Cari Data </a></li>
      <
li><a href=“#” onmouseover=“mopen(’m5′)” onmouseout=“mclosetime()”>Laporan</a>
          <
div id=“m5″ onmouseover=“mcancelclosetime()” onmouseout=“mclosetime()”><a href=“laporankursuscari.aspx”>Laporan Rekod Kursus</a> <a href=“laporankursusbln.aspx”>Laporan Kursus Bulanan Tahunan</a> <a href “laporankursuscari.aspx”>Laporan Senarai Peserta</a></div>
      </
li>
      <
li><a href=“#” onmouseover=“mopen(’m6′)” onmouseout=“mclosetime()”>Keluar</a></li>
    </
ul>      <p></p></td>
  </
tr>
</
table>

=======================
default.css

#sddm
{
    
margin0;
    
padding0;
    
z-index300;
    
left45px;
    
top274px;
    
width920px;
}
    
#sddm li
{    margin0;
    
padding0;
    list-
stylenone;
    
floatleft;
    
fontbold 11px arial}

#sddm li a
{    displayblock;
    
margin0 1px 0 0;
    
padding4px 10px;
    
width110px;
    
background#5970B2;
    
color#FFF;
    
text-aligncenter;
    
text-decorationnone}

#sddm li a:hover
{    background#49A3FF}

#sddm div
{    positionabsolute;
    
visibilityhidden;
    
margin0;
    
width130px;
    
padding0;
    
background#EAEBD8;
    
border1px solid #5970B2}

    #sddm div a
    {    positionrelative;
        
displayblock;
        
margin0;
        
padding5px 10px;
        
widthauto;
        
white-spacenowrap;
        
text-alignleft;
        
text-decorationnone;
        
background#EAEBD8;
        
color#2875DE;
        
font11px arial}

    #sddm div a:hover
    
{    background#49A3FF;
        
color#FFF}