- Jun 22 Mon 2015 16:38
ASP.net,C#,在UpdatePanel中動態加入Trigger
- Jun 11 Thu 2015 16:30
ASP.net 使用Ajax連接前後端資料
- Jun 02 Tue 2015 20:42
ASP.net 在Postback後 使panel的Scrollbar維持在原位置
前端:
<script type="text/javascript">
window.onload = function (){var h = document.getElementById("<%=hfScrollPosition.ClientID%>");
document.getElementById("<%=scrollArea.ClientID%>").scrollTop = h.value;}
function SetDivPosition(){var intY = document.getElementById("<%=scrollArea.ClientID%>").scrollTop;var h = document.getElementById("<%=hfScrollPosition.ClientID%>");
h.value = intY;}
function afterpostback(){var h = document.getElementById("<%=hfScrollPosition.ClientID%>");
document.getElementById("<%=scrollArea.ClientID%>").scrollTop = h.value;}</script><asp:HiddenField ID="hfScrollPosition" runat="server"Value="0"/><div id="scrollArea" onscroll="SetDivPosition()" runat="server" style="height:225px;overflow:auto;overflow-x:hidden;">
後端: