链接按钮的代码 [英] code for link button

查看:75
本文介绍了链接按钮的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

晚上好,



i已将链接按钮设为www.google.com。



if我点击那个链接按钮,我必须被重定向到谷歌网站。



i尝试了response.redirect,但它无法正常工作。



所以请帮帮我。



谢谢。

解决方案

< pre lang =xml> < 按钮 onclick = location.href ='www。 google.com' > 点击我转到Google.com < < span class =code-leadattribute> / button >





干杯,

Edo


 Response.Redirect(http://google.com); 


尝试以下代码: -

  protected   void  lnkBut​​ton_Click(< span class =code-keyword> object  sender,EventArgs e)
{
Page.ClientScript.RegisterStartupScript( this 。 GetType(), OpenWindow window.open('http://www.google.com','_ newtab'); true < /跨度>);
}





祝你好运。


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.

解决方案

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



Cheers,
Edo


Response.Redirect("http://google.com");


try these codes :-

protected void lnkButton_Click(object sender, EventArgs e)
{ 
   Page.ClientScript.RegisterStartupScript(this.GetType(),"OpenWindow","window.open('http://www.google.com','_newtab');",true);
}



Good luck.


这篇关于链接按钮的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆