日期:2014-05-17 浏览次数:20507 次
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="testPage.aspx.cs" Inherits="testWeb.testPage" %> <%@ Register Src="~/UserControls/MulSelectDropList.ascx" TagName="MulSelector" TagPrefix="mulDrop" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript"> function onClick(varStr) { var hidField = document.getElementById("hidFiled"); hidField.value = hidField.value + varStr; alert(hidField.value); } </script> </head> <body> <form id="form1" runat="server"> <div> <asp:Repeater ID="Repeater1" runat="server"> <ItemTemplate> <asp:Label runat="server" ID="hangye" Text='<%# Eval("hangye")%>' onclick=<%# "onClick('" + Eval("hangye")+"');" %>> </asp:Label><br /> </ItemTemplate> </asp:Repeater> <asp:Repeater ID="Repeater2" runat="server"> <ItemTemplate> <asp:Label runat="server" ID="hangye" Text='<%# Eval("yanse")%>' onclick=<%# "onClick('" + Eval("yanse")+"');" %>> </asp:Label><br /> </ItemTemplate> </asp:Repeater> </div> <asp:HiddenField runat="server" ID="hidFiled" /> </form> </body> </html>