i have given 2 link on side navbar. it's not working why?
here code:
admin.master
<div class="w3-sidebar w3-bar-block w3-collapse w3-card-2 w3-animate-left" style="width: 200px; padding-top: 50px;" id="mysidebar"> <button type="button" class="w3-bar-item w3-button w3-large w3-hide-large" onclick="w3_close()">close ×</button> <a href="createuser.aspx" id="linkcreateuser" class="w3-bar-item w3-button">create user</a> <a href="adminsecurity.aspx" id="linksecurity" class="w3-bar-item w3-button">security</a> <%--<a href="#" class="w3-bar-item w3-button">link 3</a>--%> </div> <div class="w3-main" style="margin-left: 200px; padding-top: 50px;"> <div class="w3-container"> <asp:contentplaceholder id="contentplaceholder1" runat="server"> </asp:contentplaceholder> </div> </div>
update
<asp:linkbutton id="linkcreateuser" runat="server" postbackurl="https://www.google.co.in/?gws_rd=ssl" cssclass="w3-bar-item w3-button">create user</asp:linkbutton> <asp:hyperlink id="hyperlink1" runat="server" text="create user hyper" navigateurl="createuser.aspx" cssclass="w3-bar-item w3-button" ></asp:hyperlink> <a href="adminsecurity.aspx" runat="server" id="linksecurity" class="w3-bar-item w3-button">security</a>
it appears on chrome browser above code
chrome browser
<a id="hyperlink1" class="w3-bar-item w3-button" href="createuser.aspx">create user hyper</a> <a id="linkcreateuser" class="w3-bar-item w3-button active" href='javascript:webform_dopostbackwithoptions(new webform_postbackoptions("ctl00$linkcreateuser", "", false, "", "https://www.google.co.in/?gws_rd=ssl", false, true))'>create user</a> <a href="adminsecurity.aspx" id="linksecurity" class="w3-bar-item w3-button">security</a>
jquery click event
$('.w3-sidebar a').click(function (e) { e.preventdefault(); // it's not working because of this. how can set class = active clicking link? $('.w3-sidebar a').removeclass('active'); $(this).addclass('active'); })
try using asp.net control either works or no like:
<asp:linkbutton id="linkcreateuser" runat="server" postbackurl="createuser.aspx" cssclass="w3-bar-item w3-button">create user</asp:linkbutton> <asp:hyperlink id="linkcreateuser" runat="server" text="create user" navigateurl="createuser.aspx" cssclass="w3-bar-item w3-button" ></asp:hyperlink>
if still not working please share final html of anchor tag inspect element showing on web page?
Comments
Post a Comment