locked
updatepanel and postback RRS feed

  • Question

  • User-1687766116 posted

    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

    Friday, March 6, 2020 4:45 PM

All replies

  • User-1687766116 posted

    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

    Friday, March 6, 2020 5:58 PM
  • User-719153870 posted

    Hi mehr_83,

    i want this code only onec in per page.

    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

    Monday, March 9, 2020 6:13 AM
  • User-979855076 posted

    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.

    Monday, April 20, 2020 9:58 AM