[英]link outside of updatepanel vanishes after partial postback
我在updatepanel 之外有一個簡單的href鏈接,該鏈接在部分回發后消失了。 我知道它是否會在更新面板中消失,但這不在更新面板的范圍內。
簡單標記
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
<asp:UpdatePanel runat="server" ID="updData" UpdateMode="Always" ChildrenAsTriggers="True">
<ContentTemplate>
<!--SOme asp.net grid view control -->
</ContentTemplate>
</asp:UpdatePanel>
<a href="#" class="scrollup" title="back to top">Scroll</a> <!-- Heres the vanishing link -->
<a href="http://www.yahoo.com">Yahoo</a> <!-- Added this for a test -->
</asp:Content>
具有類向上滾動的href消失了,為了進行測試,我添加了一個到yahoo的鏈接,甚至在部分回發后也消失了。 我不明白為什么它們消失了,因為它們在更新面板之外。
只是出於jquery的目的而存在類scrollup
,以引用此鏈接:
$(window).scroll(function () {
marginTop = ($(document).scrollTop() - scroll) + marginTop;
scroll = $(document).scrollTop();
if ($(this).scrollTop() > 50) {
cc.addClass("f-nav");
cc.addClass("addShadow");
cc.addClass("addShadow");
$('.scrollup').fadeIn();
} else {
cc.removeClass("f-nav");
cc.removeClass("addShadow");
$('.scrollup').fadeOut();
}
});
$('.scrollup').click(function () {
$("html, body").animate({ scrollTop: 0 }, 'slow');
return false;
});
看完這些之后,我發現,如果我將它放置在site.master頁面中,則超鏈接最終將起作用。 因此,這似乎是一個奇怪的問題,但是我能夠將其從.aspx頁面中刪除,而只需添加到站點母版頁中即可。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.