Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.Net Menu Bar is not being displayed
    primarykey
    data
    text
    <p>I built a Menu Bar to my site master in ASP.net:</p> <pre><code>&lt;div class="MenuBar"&gt; &lt;asp:ContentPlaceHolder ID="MainContent" runat="server"&gt; &lt;asp:Menu ID="menuBar" runat="server" Orientation="Vertical" Width="100%"&gt; &lt;DynamicHoverStyle CssClass="DynamicHover" /&gt; &lt;DynamicMenuItemStyle CssClass="DynamicMenuItem" /&gt; &lt;DynamicSelectedStyle CssClass="DynamicHover" /&gt; &lt;StaticHoverStyle CssClass="staticHover" /&gt; &lt;StaticMenuItemStyle CssClass="StaticMenuItem" ItemSpacing="1px" /&gt; &lt;StaticSelectedStyle CssClass="staticHover" /&gt; &lt;/asp:Menu&gt; &lt;/asp:ContentPlaceHolder&gt; &lt;/div&gt; </code></pre> <p>Code behind:</p> <pre><code>public partial class SiteMaster : System.Web.UI.MasterPage { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { getMenu(); } } private void getMenu() { Menu menuBar = new Menu(); SqlConnection con = new SqlConnection(); con.ConnectionString = "server=(local);database=PhilipsMaterials;Integrated Security=SSPI;"; con.Open(); DataSet ds = new DataSet(); DataTable dt = new DataTable(); string sql = "Select [Material Name] from Materials"; SqlDataAdapter da = new SqlDataAdapter(sql, con); da.Fill(ds); dt = ds.Tables[0]; DataRow[] drowpar = dt.Select(); String s = "sss"; foreach (DataRow dr in drowpar) { menuBar.Items.Add(new MenuItem(dr["Material Name"].ToString())); } con.Close(); } </code></pre> <p>}</p> <p>For some reason the menu is not being displayed when I view the site on the browser. Someone knows why? Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload