隐藏字段数据-绑定HTML [英] Hidden Field Data - Binding HTML

查看:106
本文介绍了隐藏字段数据-绑定HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我希望我的问题很容易回答...

我有两个隐藏的字段,我想用它们的值构建一个URL.到目前为止,我已经有了它,但是它不起作用.

Hi guys,

My question I hope is an easy one to answer...

I have two hidden fields which I want to build a URL with their values. I have this so far but it does not work.

<asp:Image ID="Image" runat="server" ImageUrl="~/ShowImage.ashx?id='<%=hdID.Value%>'&name='<%=hdName.Value%>'" Width= "300" ImageAlign="Left"/>



有人可以帮我吗?

问候,

Caz



Could anyone please give me a hand?

Regards,

Caz

推荐答案

检查这些博客
将数据从sql语句绑定到隐藏字段? [ http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:41060 [ ^ ]
--NDK
check these blogs
Bind data from a sql statement to a hidden field?[^]
http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:41060[^]
--NDK


在.aspx页面中不能这样
另一种选择是您可以在ur .aspx.cs页面中编写以下代码.

在页面加载事件"中,编写代码以从hiddenfield获取值,然后将其分配给imageurl属性(如果图像或javascript中也是如此)

在页面加载事件中执行的示例代码
You can not do like this in .aspx page
The alternative is you can write the following code in ur .aspx.cs page.

In Page Load Event write the code to get the value from hiddenfield and assign it to the imageurl property if the image or in the javascript also

sample code to do in pageload event
protected void Page_Load(object sender, EventArgs e)
{
      Image.ImageUrl = hdID.Value;
}


尝试一下
<asp:image id="Image" runat="server" imageurl="~/ShowImage.ashx?id='<%=hdID.Value%>'&name='<%#hdName.Value%>'" width="300" imagealign="Left"></asp:image>


这篇关于隐藏字段数据-绑定HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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