I am trying to redirect another site on button click.
Answer Posted / richard des jardins
Assign the OnClick property of the Button the the Method
that will handle the OnClick Event" OnClick
= "MyButton_Click" for C#. Alternatively for VB.NET ue the
Handles Keyword on the Method lie this :
Protected Sub MyButton_Click(ByVal Sender As Onbject, ByVal
e S EventArgs) Handles MyButton.Click
C#;
Protected Void MyButton_Click(Object sender, EventArgs e).
Inside the method handle the event:
Response.Redirect("")
Response.Transfer("",false)
This way, you can perform any other tasks you may want to
do such as writing to an event log, or updated a database
record before redirecting the user.
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What is rich control in asp.net?
How long do session variables last?
Write a code for passing ArrayList in Web API?
How do we ensure view state has not tampered?
What are the parts of an http response?
What is Difference between Production Serves and Development Servers? And Suppose, m adding/deleting C# file in a project based on the Specific Requirement. These Files are Automatically updated in Production Servers? So Which tool is needed to do This One?
What is distributed system in asp.net?
How do you implement postback with a text box?
What is the difference between union and structure?
What are navigation controls? How many navigation controls are there in ASP.NET 4.0?
Name the method that needs to be invoked on the dataadapter control to fill the generated dataset with data?
What is cookies in asp net?
How does windows service lifecycle differ from a .standard. Exe?
What is AutoPostback?
What are session and cookies?