0
我有一個GridView有Hyperlinkfield.When被點擊的那場,我想一個奇特的盒子打開,並在盒子看中我想的iframe顯示是HyperLinkField字段的頁面的fancybox必須打開。打開時的GridView的HyperLinkField字段被點擊
我的GridView的是:
<asp:GridView ID="GridView" runat="server" AutoGenerateColumns="False"DataKeyNames="SrNumber"
OnRowDataBound="GridView2_RowDataBound"
Width="100%"
ShowFooter="false"
EnableViewState="false"
AutoPostBack="true">
<Columns>
<asp:HyperLinkField DataNavigateUrlFields="SrNumber" DataNavigateUrlFormatString="newpage.aspx?SrNumber={0}" DataTextField="Note" HeaderText=""/>
<asp:TemplateField HeaderText="Note" SortExpression="Note">
<ItemTemplate>
<a id="ahrefclick" class="forPopup" href="newpage.aspx?SrNumber <%#Eval("SrNumber")%>"><%#Eval("Note")%></a>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
目前,只有兩列,兩者其實一樣。 hyperlinkfiled正在帶我到下一頁。我嘗試使用Template字段將花哨的框邏輯添加到gridview。
的JavaScript代碼:
$("#ahrefclick").click(function (e) {
$(".forPopupGrid").fancybox({
'titlePosition': 'inside',
'transitionIn': 'elastic',
'transitionOut': 'none'
});
});
我仍然沒有得到彈出up.I是新來的fancybox.Please幫助!
謝謝!
編輯: 我jQuery和的fancybox鏈接:
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script src="http://fancybox.net/js/fancybox-1.3.4/jquery.fancybox-1.3.4.js" type="text/javascript"></script>
<link href="http://fancybox.net/js/fancybox-1.3.4/jquery.fancybox-1.3.4.css" rel="stylesheet"
type="text/css" />
我根據您的蘇改變了代碼仍然會在新窗口中打開頁面並彈出不顯示! – LearningToCode
確保您的路徑將jQuery和的fancybox js和css文件是正確的(而不是返回404錯誤)...或共享的鏈接,使其更快;) – JFK
我剛纔編輯我的問題,並已加入所有鏈接到Jquery和fancybox.Can你請檢查並告訴我,如果這是足夠和正確的? – LearningToCode