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
Post a Comment