i use this code for get user view in page load in master page
and i use updatepanel to load data (one by on by page scrollin whiteout refresh) but this code rus many time. (run is per get data whitout pagerefresh)
//scroll
window.onscroll = function () {
var button = document.getElementById('<%=LinkButton1.ClientID%>');
var top = button.getBoundingClientRect().top //the distance from element top to visible region top //alert(top)
var se = document.documentElement.clientHeight // browser visible region height
// alert(se)
if (top <= se) {
If Not IsPostBack = False Then means only when the page refresh, below code will be fired. It's not clear what you want exactly, maybe you could provide more code including all you related front code and back code, especially the linkbutton
click event code and SP code if it's necessary. Then a detailed description about the current issue and what you want to achieve.
Member
151 Points
473 Posts
updatepanel and postback
Mar 06, 2020 04:45 PM|mehr_83|LINK
hi,
i use this code for get user view in page load in master page
and i use updatepanel to load data (one by on by page scrollin whiteout refresh) but this code rus many time. (run is per get data whitout pagerefresh)
how i do
i want this code only onec in per page.
If Not IsPostBack = False Then
Try
Dim cmd2 As New SqlCommand("bazdid_ins", con)
cmd2.CommandType = CommandType.StoredProcedure
cmd2.Parameters.Add(New SqlParameter("@ip", Request.UserHostAddress))
cmd2.Parameters.Add(New SqlParameter("@date1fa", date22))
cmd2.Parameters.Add(New SqlParameter("@date2fa", date2))
cmd2.Parameters.Add(New SqlParameter("@time1", TimeOfDay.ToString("HH:mm:ss")))
cmd2.Parameters.Add(New SqlParameter("@now1", Now))
cmd2.Parameters.Add(New SqlParameter("@typeos", Request.Browser.Platform))
cmd2.Parameters.Add(New SqlParameter("@typebr", Request.Browser.Type + "" + Request.Browser.Version))
cmd2.Parameters.Add(New SqlParameter("@page1", Request.Url.AbsoluteUri))
cmd2.Parameters.Add(New SqlParameter("@user1", Request.ServerVariables("LOGON_USER")))con.Open()
cmd2.ExecuteNonQuery()
con.Close()
Catch
End Try
End If
Member
151 Points
473 Posts
Re: updatepanel and postback
Mar 06, 2020 05:58 PM|mehr_83|LINK
and i use this code for automatic load data
<script type="text/javascript">
//scroll
window.onscroll = function () {
var button = document.getElementById('<%=LinkButton1.ClientID%>');
var top = button.getBoundingClientRect().top //the distance from element top to visible region top //alert(top)
var se = document.documentElement.clientHeight // browser visible region height
// alert(se)
if (top <= se) {
//alert("show");
button.click();
button.style.visibility = "hidden";
}
}
var tim = setTimeout(function () {
$('#<%= Page.Master.FindControl("ContentPlaceHolder1").FindControl("LinkButton1").ClientID%>').click();
//var a = document.getElementById('<%= Page.Master.FindControl("ContentPlaceHolder1").FindControl("LinkButton1").ClientID%>');
// a.click();
}, 15000);
setInterval(function () { document.getElementById('<%= LinkButton1.ClientID%>').click(); }, 300000);
//scroll
//end scroll
</script>
please help me
Contributor
3140 Points
983 Posts
Re: updatepanel and postback
Mar 09, 2020 06:13 AM|Yang Shen|LINK
Hi mehr_83,
If Not IsPostBack = False Then
means only when the page refresh, below code will be fired. It's not clear what you want exactly, maybe you could provide more code including all you related front code and back code, especially the linkbutton click event code and SP code if it's necessary. Then a detailed description about the current issue and what you want to achieve.Best Regard,
Yang Shen
None
0 Points
1 Post
Re: updatepanel and postback
Apr 20, 2020 09:58 AM|sonamsinghvns|LINK
when i use update panel first time then page load not work
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
</ContentTemplate>
</asp:UpdatePanel>
Login page in asp.net using c#
after some time page load work why ?
so kindly solve this.