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

Explain parts of assembly?

637


Will the asp.net validators run in server side or client side? How do you do client-side validation in .net? How to disable validator control by client side javascript?

626


What is a uri query?

639


what is silver light when will we use silver light,

1544


Asp pages that worked pefectly on windows 2000 server and iis 5.0 do not work on windows 2003 server with iis 6.0. Asp.net pages work fine. Why?

654






What is a 404 redirect?

692


What is the function used for removing an event listener?

633


Explain the concept of MVC Scaffolding?

670


Which ASP.NET configuration options are supported in the ASP.NET implementation on the shared web hosting platform?

731


what is a .xap file? Explain with an example.

675


Which method has beenintroduced in asp.net 4.0 to redirect a page permanently?

633


Explain about solution explorer window?

704


Can you explain the importance of finalize method in .net?

693


What are the new web part controls in asp.net 2.0 ?

610


Where is session cookies stored?

613