I know this is a simple question, but I really can't find anything on Google. Sorry if I'm not looking for the right. I created 2 pages, and in the first - a button.What should I write in C # code to change in order to redirect me to the second page?I usually know my way around C #, but I'm completely new in ASP.
Add an onclick event handler button.
In the event handler:
Response.Redirect("YOUR_NEW_PAGE");
Response.Redirect or Server.Transfer
A bit more complicated and probably not what you need to forward the page
Not quite sure about your question whether you will be after ASP VB or C # ... therefore ...
//FROM#
private void Button1_Click(object sender, System.EventArgs e) { Server.Transfer("Webform2.aspx"); }
'Visual Basic
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Server.Transfer("Webform2.aspx") End Sub
For more information, I refer you:
http://msdn.microsoft.com/en-us/library/540y83hx%28VS.71%29.aspx
You can also do this in aspx itself (without writing any code) using the PostBackUrl property of the button.
Use one of the following methods:
One-time redirect (HTTP 301)
Response.Redirect("page to redirect to");
Permanent redirect (HTTP 302), available only in ASP.NET 4.0
Response.RedirectPermanent("page to redirect to");
Source: https://habr.com/ru/post/1310508/More articles:In iTextSharp, can I set the vertical position of a pdfwriter file? - c #Hello World to Twitter from C # - c #The function C is called only once and the cyclic complexity is ctwitter in C # 2010 - c #How to check if NSPasteboard is updated? - objective-cGoogle Google widget for quick search is missing in Android 2.2 - androidDelphi Superobject, a general list for json - jsonAndroid 2.2 AVD: no quick search box? - androidHow to initialize a List in an empty class constructor? - javaWPF button in color state or off - c #All Articles