想要在imagebutton的postbackurl中绑定查询字符串 [英] Want to bind querystring in postbackurl of imagebutton
问题描述
这段代码是否正确????????
< 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 pageEnergy.aspx.cs
For example
protected void Page_Load(object sender, EventArgs e)
{
string var = Request.QueryString["var"].ToString();
Response.Write(var);
}
这篇关于想要在imagebutton的postbackurl中绑定查询字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!