2
votes

I have a page that has some textboxes that are refreshed everytime page is loaded (Page_Load). Also have a table that takes too long to load (can't make it faster).

I thought using a UpdatePanel to load that table after textboxes are updated. I could use RegisterStartupScript (after textboxes updated) to update the UpdatePanel .

However, the UpdatePanel update always calls Page_Load, so the textboxes are always updated again. It's like UpdatePanel is useless.

How can this be solved?

3

3 Answers

0
votes

Simple solution in your case is to use asp.net ajax timer along with update panel. Utilize the postback triggers and you are done.

see more here: http://msdn.microsoft.com/en-us/library/bb386404(v=vs.100).aspx

let me know if you need more help

0
votes

You can check if it is a postback in the ASP.NET C# code-behind, e.g.:

if ( ! Page.IsPostBack )    

Or in clientside javascript thus:

<script type="text/javascript">
        function ClickHidenButton()
        {
            if (IsPostBack() != true)
                document.getElementById("hiddenAsyncTrigger").click();
        }

        function IsPostBack() {
             var ret = '<%= Page.IsPostBack%>' == 'True';
             return ret;
        }
</script>
0
votes

You can check in Page_Load to see whether it is being called via a partial postback (i.e. from the updatepanel) and if it is then don't update the textboxes.