c# - Button with onserverclick will not response -


i have code in

aspx:

<nav class="navbar navbar-inverse navbar-fixed-top">     <div class="container">         <div class="navbar-header">             <button type="button"                     class="navbar-toggle collapsed"                     data-toggle="collapse"                     data-target="#navbar"                     aria-expanded="false"                     aria-controls="navbar">                 <span class="sr-only">toggle navigation</span>                 <span class="icon-bar"></span>                 <span class="icon-bar"></span>                 <span class="icon-bar"></span>             </button>             <a class="navbar-brand"                href="#">project name</a>         </div>         <div id="navbar"              class="navbar-collapse collapse">             <form class="navbar-form navbar-right">                 <div class="form-group">                     <input type="text"                            placeholder="username"                            class="form-control"                            runat="server" required                            id="username" />                 </div>                 <div class="form-group">                     <input type="password"                            placeholder="password"                            class="form-control"                            runat="server" required                            id="password" />                 </div>                 <input type="submit"                        class="btn btn-success"                        runat="server"                        onserverclick="login_click"                        value="sign in" />             </form>         </div>         <!--/.navbar-collapse -->     </div> </nav> 

whenever press button not go login_click function in code behind. me please thanks.

just @mohit said firstly give id input tag in yourpagename.aspx page

<input type="submit" class="btn btn-success" runat="server" onserverclick="login_serverclick" id="login" value="sign in" /> 

and last thing need add on click event in code behind yourpagename.aspx.cs

protected void login_serverclick(object sender, eventargs e) {     //string = "alert('your request has been submitted !');";     //scriptmanager.registerstartupscript(this.page, typeof(page), "x", a, true); } 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -