在一个界面上有一个GridView,然后在每一个模板列中都有不同的label且绑定了值,现在想要将模板列中label的值赋值给一个弹出层中lblremainVd,其中弹出层是经过js实现的,那么给label赋值要怎么办?  
页面的主要代码:
 <div id="div_vacation" align="left" valign="top" style="position:static;top:100;left:100;background-color:#ffffff;visibility:hidden; "> &nbsp;
     
        <table align="center" border="0" cellpadding="0" cellspacing="0" height="120" style="border-right: #c0cfb2 1px solid;
            border-top: #c0cfb2 1px solid; left: 304px; border-left: #c0cfb2 1px solid; width: 304px;
            border-bottom: #c0cfb2 1px solid; position: absolute; top: 168px; background-color: menu">
            <tr>
                <td bgcolor="#6666ff" style="padding-left: 30px; width: 236px; cursor: move; color: #ffffff;
                    border-bottom: #c0cfb2 1px solid; height: 26px; background-color: activeborder">
                    <strong style="font-size: small">Vacation Day</strong></td>
            </tr>
            <tr style="font-size: 12pt">
                <td class="xiaoxi_bg" style="padding-right: 30px; padding-left: 30px; width: 236px;
                    padding-top: 5px; height: 100px; font-size: 12px;" valign="top">
                    <asp:Label ID="lblCNNameVD" runat="server" Font-Size="X-Small" Text="CNName" Font-Bold="True" Font-Names="Calibri"></asp:Label>
                    <asp:Label
                        ID="lblDateVD" runat="server" Font-Size="X-Small" Text="Date" Font-Names="Calibri"></asp:Label>
                    <asp:Label ID="lblEmployeeIDVD" runat="server" Font-Size="X-Small" Visible="False"></asp:Label><br />
                    <asp:Label ID="lblvacationsun" runat="server" Text="Vacation" Font-Size="Small" Font-Bold="True" Font-Names="Calibri"></asp:Label>&nbsp;
                    <asp:DropDownList ID="ddlvacationVD" runat="server" DataSourceID="SqlDataSourceVacation" DataTextField="VacationName"
                        DataValueField="VacationCode" Font-Size="X-Small">
                    </asp:DropDownList><br />
                    <asp:Label ID="lblvacationdaysVD" runat="server" Text="Hour" Font-Size="Small" Font-Bold="True" Font-Names="Calibri"></asp:Label>
                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
                   <input type="text" id="txthourVD" style="width: 64px; font-size: 12px; height: 13px;" />
                   <input type="checkbox" onclick="show(this,1,'8')" title="oneday" />1天<br />
                    <asp:Label ID="lblstarttimeVD" runat="server" Text="Start Time" Font-Size="Small" Font-Bold="True" Font-Names="Calibri"></asp:Label>
                    &nbsp;&nbsp;&nbsp;
                    <asp:TextBox ID="txtboxstarttimeVD" runat="server" Font-Size="X-Small" ToolTip="时间格式为:HH:MM"
                        Width="64px"></asp:TextBox><asp:RequiredFieldValidator ID="rvfstartVD" runat="server"
                            ControlToValidate="txtboxstarttimeVD" ErrorMessage="RequiredFieldValidator" Font-Size="X-Small"
                            ValidationGroup="ValidataGroup1">输入时间不能为空</asp:RequiredFieldValidator><br />
                    <asp:RegularExpressionValidator ID="revstartVD" runat="server" ControlToValidate="txtboxstarttimeVD"
                        ErrorMessage="RegularExpressionValidator" Font-Size="X-Small" ValidationExpression="\d{1,2}:\d{1,2}" ValidationGroup="ValidataGroup1">请输入正确的时间格式,如:08:30</asp:RegularExpressionValidator><br />
                    <asp:Label ID="lblendtimeVD" runat="server" Text="End Time" Font-Size="Small" Font-Bold="True" Font-Names="Calibri"></asp:Label>
                    &nbsp;&nbsp; &nbsp;&nbsp;
                    <asp:TextBox ID="txtendtimeVD" runat="server" Width="64px" Font-Size="X-Small" ToolTip="时间格式为HH:MM"></asp:TextBox><asp:RequiredFieldValidator ID="rfvendVD"
                            runat="server" ControlToValidate="txtboxstarttimeVD" ErrorMessage="RequiredFieldValidator"
                            Font-Size="X-Small" ValidationGroup="ValidataGroup1">输入时间不能为空</asp:RequiredFieldValidator><br />
                    <asp:RegularExpressionValidator ID="revendVD" runat="server" ControlToValidate="txtendtimeVD"
                        ErrorMessage="RegularExpressionValidator" Font-Size="X-Small" ValidationExpression="\d{1,2}:\d{1,2}"
                        ValidationGroup="ValidataGroup1">请输入正确的时间格式,如:08:30</asp:RegularExpressionValidator><br />
                   <asp:Button ID="btnsubmitVD" runat="server" Text="Sumbit" OnClick ="btnsubmitVD_Click" Font-Size="X-Small" ValidationGroup="ValidataGroup1"/>
                    <asp:Button ID="btncancelVD" runat="server" Text="Cancel" Font-Size="X-Small" UseSubmitBehavior="False" />
                    &nbsp;&nbsp;&nbsp;
                    <asp:Label ID="lblremainVd" runat="server" Text="Remain" Font-Size="X-Small" Visible="False"></asp:Label>
                    <asp:Label ID="lblremainsuntxt" runat="server" Text="Label" Font-Size="X-Small" ToolTip="该假期剩余天数" Visible="False"></asp:Label></td>
            </tr>
        </table>
            </div> 
<input id="btneditvacation" type="button"  onclick="change1()" style="background-position: center center; width: 16px; background-repeat: no-repeat; height: 16px; position: static; font-size: 7px; background-image: url(images/books_edit.png); background-color: transparent;" size="20"/>
JS代码:
<script type="text/javascript"> 
function change1()

  document.getElementById('div_vacation').style.visibility='visible'; 
 } 
</script>

解决方案 »

  1.   

    用js的window.showmodeldailog打开可以接受一个返回值,然后在确定按钮中输出脚本Window.close;ReturnValue= '你要的值 '就可以了
      

  2.   

    你自己都块写出来了,把你的lable的值传递到函数里去啊,
    你onclick的时候就可以了或者在你控件加载的时候用个隐藏域来记录你的lable 的值
    在你onclick 的时候去读取隐藏域的值,然后在赋值到你弹出的控件上JS代码:
    <script type="text/javascript">  
    function change1(obj)
    {  
      document.getElementById('div_vacation').style.visibility=obj;  
     }  
    </script>
      

  3.   

    document.getElementById('<%=LabelID.ClientID%>').innerHTML='设置的值';
      

  4.   

    我一般在弹出层中用iframe 静 动 都好处理
      

  5.   

    你在收台用一个静态恋量接收一下,在静态页和<%=getinfo%>就可又得到的