中继器控制和隐藏场 [英] Repeater Control and Hidden Field

查看:99
本文介绍了中继器控制和隐藏场的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Quote:

HI all,



我正在尝试使用asp重复控制。我填写了下面的项目模板。



HI all,

I am experimenting with the asp Repeateer Control. I have populated its item template like below.

<asp:Repeater ID="Repeater1" DataSourceID="dsrcWebChat" runat="server">
                                   <ItemTemplate>
                                       <span style="cursor:hand;text-decoration:underline;" onclick="OpenChatBox('<%#Container.DataItem("UserID")%>','<%#Container.DataItem("UserID")%>_<%#HttpContext.Current.User.Identity.Name%>_<%#DateTime.Now.Ticks.ToString()%>')"><%#Container.DataItem("Name")%></span><br />
                                   </ItemTemplate>
                               </asp:Repeater>





此外我在Repeater控件之外的表单中有一个隐藏字段,我还想添加隐藏字段的值在里面 OpenChatBox 函数作为参数。



任何人都可以告诉我这样做的想法?

在.cs方面或设计方面?



:)



Further I have a hidden field in the form outside of the Repeater control and i also want to add that hidden field's value inside the OpenChatBox function as parameter.

Any one can give me idea of doing this??
Either on the .cs side or design side??

:)

推荐答案

<%=HiddenField1.Value%>
     <asp:HiddenField ID="HiddenField1" Value ="test" runat="server" /



>





使用< %%>传递参数如上所述。

我希望上面的例子能给你一个线索。


>


Pass the parameter using <% %> as above.
I hope the above example gives you a clue.


这篇关于中继器控制和隐藏场的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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