1
Answer

Build Menu Dynamically.

Riaz IT

Riaz IT

9y
251
1
I do have a Hierarchical Data to build a menu sample data is as under, please guide me if I have this kind of data in a table Called MAINMENU then how can i dynamically build this menu in WinForm thru CSHARP. Thanks.
 
001   Setups
001001   Rooms
001002   Zones
001003   Room Inventory
002   Transaction
002001   Room Booking
002002   Room Vacancy
002003   Room Extension
002004   Room Changing
003   Reports
003001   MIS Reports
003001001   Occupancy/Vacancy DayWise With Lapses
003001002   Expected Revenue next month
003002   Booking Counter Reports
003002001   Vacancy Report
003002002   Current Occupied Room Vacant Today
004   Administion
004001   User Rights and Previllges Setting
004002   Password Change
 
 
 
 
 
Answers (1)
0
Niradhip Chakraborty

Niradhip Chakraborty

NA 6.5k 527k 15y

Your aspx page should look like this. You should call the javascript function on top of the page like below. Try this. You also can send the code.
 
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="EditProfile.aspx.cs" Inherits="Contents_EditMyProfile" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html xmlns="
http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Test</title>
      <script type="text/javascript" language="javascript">
       function colorchange()
        {
            alert("test");
        }  
             
    </script>
</head>
<body bottommargin="0" topmargin="0" leftmargin="0" rightmargin="0" class="body" onload="EditProfile_onload()">
    <form id="frmEditProfile" runat="server">
        <table cellpadding="0" cellspacing="0" width="900px" border="0">
            <tr align="left" valign="top">
              <td></td>    
            </tr>
         
        </table>
    </form>
  </body>
</html>
0
Abhay Mhatre

Abhay Mhatre

NA 29 0 15y
this is not working with my code. do you want to see my code?
0
Niradhip Chakraborty

Niradhip Chakraborty

NA 6.5k 527k 15y

To call a java script function from server side you can use the following code,and inside the javascript function you can call other javascript function.
Page.ClientScript.RegisterStartupScript(this.GetType(), "", "ColorChange();", true);