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


Please Help Members By Posting Answers For Below Questions

What is preprocessor in .net? Where it use?

532


What is asp.net localization?

503


If I have more than one version of one assemblies, then how will I use old version (how/where to specify version number?) In my application?

522


When does a session actually start?

575


How do you implement sql caching in asp.net?

566






Differentiate between authentication and authorization.

565


What is ispostback method in asp.net?

563


What are the differences between clr & cts?

543


Explain about asp.net caching?

577


What is server side routing?

511


How ViewstateMac works?

2366


Explain the difference between web user control and web custom control?

539


What’s the difference between response .redirect and server.transfer?

524


Will the asp.net validators run in server side or client side?

646


Is asp.net and .net are same or different?

528