2014-09-06 52 views
0

我目前正在一個網站上工作。當我點擊GridView表中的超鏈接字段時,我想打開一個彈出窗口。從Gridview中點擊HyperLinkField打開[ModalPopLite]彈出窗口

<asp:GridView ID="EmployeeList" runat="server"/> 

        <Columns> 
         <asp:HyperLinkField 
          DataNavigateUrlFields="EmpID" 
          HeaderText="EMP ID" 
          Target="_blank" 
          DataNavigateUrlFormatString="google.com" 
          DataTextField="EmpID"> 
         </asp:HyperLinkField> 
        </Columns> 
</asp:GridView> 

這裏是我的示例腳本:

<script type="text/javascript"> 
    $(function() { 
     $('#newuser_pop').modalPopLite({ openButton: '#clicker1'}); 
    }); 
</script> 

在這方面的任何幫助,將不勝感激。謝謝!

回答

0

你的情況的問題是,在asp.net控件是服務器端,從而以獲得ID jQuery中做如下所示:

<script type="text/javascript"> 
    $(function() { 
    $('#<%= newuser_pop.ClientID %>').modalPopLite({ openButton: '#clicker1'}); 
    }); 
</script> 
+0

,我應該做出什麼改變我的HyperLinkField字段呢? – 2014-09-09 12:46:45

相關問題