i generated a page with an ASP Button which loads another page.
<asp:Button ID="ServerCredentials" runat="server" Text="Server Credentials" Font-Names="Verdana" Font-Size="12px" OnClick="Credential_Click" Width="135px"/>
Function which loads another page:
Protected Sub Credential_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Response.Redirect("~/WebPage/Booking/ExchangeServer.aspx")
End Sub
This code only works when i registered on the page with exchange data.
when i am not registered, nothing happens.
But if i put a onclientclick with any function, it works again.
like this:
<asp:Button ID="ServerCredentials" runat="server" Text="Server Credentials" Font-Names="Verdana" Font-Size="12px" OnClientClick="return CheckDateVonBis()" OnClick="Credential_Click" Width="135px"/>
what is the difference between onclick and onclientclick?
how can i solve this problem?
onclick for server side functionandonclientclick for client sideOnClientClick : if you wish call javascript function
Link : http://msdn.microsoft.com/fr-fr/library/system.web.ui.webcontrols.button.onclientclick(v=vs.80).aspx
OnClick : if you wish call code behind function declared in server side
Link : http://msdn.microsoft.com/fr-fr/library/system.web.ui.webcontrols.button.onclick.aspx