Click here to Skip to main content
15,880,905 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
good evening,

i have given link button as www.google.com.

if i click that link button, i must be redirected to google site.

i have tried response.redirect,but it is not working.

so please help me.

thank you.
Posted
Comments
bbirajdar 11-Feb-13 8:08am    
Show your code

XML
<button onclick="location.href='www.google.com'">Click me to go to Google.com</button>


Cheers,
Edo
 
Share this answer
 
Response.Redirect("http://google.com");
 
Share this answer
 
Comments
Avik Ghosh22 11-Feb-13 8:12am    
try this...tested code...
try these codes :-
C#
protected void lnkButton_Click(object sender, EventArgs e)
{ 
   Page.ClientScript.RegisterStartupScript(this.GetType(),"OpenWindow","window.open('http://www.google.com','_newtab');",true);
}


Good luck.
 
Share this answer
 
You can do this like :

ASP.NET
<asp:LinkButton runat="server" ID="lnk1" PostBackUrl="http://www.google.com">www.google.com</asp:LinkButton>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900