0

Hello i have asp:button and i want to make him link to another page in my website and i dont really know how to do it because i am using asp:button... Can anyone help me with that problem? Please :) My HTML Button code:

<asp:button ID="RegisterButton" runat="server" Text="הירשם" class="RegisterStyle" onclientclick="var isValid = checkform(); return isValid;" onclick="RegisterButton_Click1" />    

How can i make this button to linked to another page in my html... :)

Roie
  • 3
  • 5
  • You can either do a Response.Redirect("YourPage.aspx"); or a Server.Transfer("YourPage.aspx") on button click event – Vishvadeep singh Oct 20 '18 at 11:05
  • Its not working... please send me how to write it.. – Roie Oct 20 '18 at 11:10
  • you can follow this link https://stackoverflow.com/questions/23976683/asp-net-button-to-redirect-to-another-page – Vishvadeep singh Oct 20 '18 at 11:19
  • the page that this button is inside has form? you want only to redirect or has a form on the page ? – Charles Cavalcante Oct 20 '18 at 11:28
  • @Roie If you just want to redirect to another page than you can set PostbackURL property ([link](https://learn.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.button.postbackurl?view=netframework-4.7.2)) of button `` like this or if you want to perform some action on page data than you can use `Response.Redirect("PageName.aspx")` or `Server.Transfer("PageName.aspx")` as @vishu minhas said – Gaurav Oct 20 '18 at 11:41
  • Its not working bro... I just did like that – Roie Oct 20 '18 at 11:59
  • iTS NOT LINKING TO MY HOME PAGE :( – Roie Oct 20 '18 at 11:59
  • Don't add localhost to property value just add page name like this `PostBackUrl = "MyWebsite/Home.aspx" ` if your home page is in MyWebsite folder or if your page is in root folder just add page name `PostBackUrl = "Home.aspx" ` – Gaurav Oct 20 '18 at 12:41

0 Answers0