想要在imagebutton的postbackurl中绑定查询字符串 [英] Want to bind querystring in postbackurl of imagebutton

查看:81
本文介绍了想要在imagebutton的postbackurl中绑定查询字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这段代码是否正确????????

< asp:ImageButton ID =image_Geothermalrunat =serverImageUrl =pictures / Desert.jpgclass = designPostBackUrl ='<%#〜/ Energy.aspx?var =+ Eval(Geo-Thermal Energy)%>'target =_ blankstyle =top:0px; left:0px;的z-index:1; />





i我是初学者..我希望每当用户点击此图片时..下一页将加载查询字符串使用此图片传递的值... plz help



谢谢

is this code is correct ????????
<asp:ImageButton ID="image_Geothermal" runat="server" ImageUrl="pictures/Desert.jpg" class="design" PostBackUrl='<%# "~/Energy.aspx?var="+Eval("Geo-Thermal Energy") %>' target="_blank" style=" top:0px; left:0px; z-index:1;" />


i am a beginner.. i want that whenever user click on this image ..next page will load with query string value passed with this image...plz help

thank you

推荐答案

此代码是正确的。



您可以在下一页获得查询字符串 Energy.aspx.cs



例如



This code is correct.

You can get query string on next page Energy.aspx.cs

For example

protected void Page_Load(object sender, EventArgs e)
       {
           string var = Request.QueryString["var"].ToString();
           Response.Write(var);
       }


这篇关于想要在imagebutton的postbackurl中绑定查询字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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