Blinking of controls

Ravi Molasaria 21 Reputation points
2021-02-17T13:24:46.877+00:00

I've a web page that get list of items from a database. Upon selection of an item from list, I need to display certain details from database. But as soon as I select item in combo box, screen gets blink for a second. The same thing happens when I change the format of values in text boxes. I guess it is linked with "AUTO POST BACK" because as soon as I turned off the "AUTO POST BACK" part, everything is going smoothly. Is there anyway to stop refresh / blink screen with keeping the "AUTO POST BACK" on for text / combo boxes ?

Thanks in advance,

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,253 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,568 questions
0 comments No comments
{count} votes

Accepted answer
  1. Albert Kallal 4,651 Reputation points
    2021-02-18T02:49:10.703+00:00

    This sometimes will be the result of the browser (some browsers do a MUCH better job of refresh(s) on a screen. (the new Edge chrome engine browser I find now is VERY good for example).

    What you can do, and works very well? You can take all of the markup and "stuff" you have, and try placing the whole mess inside of a update panel.

    Update panels are rather nice. This means that ONLY that part of the web page will re-plot and update. In fact the browser "wait icon" and re-fresh icon will not even show the browsser is wiating for the postback.

    This trick results in what we call a "partial" page post-back.

    So from the tool box (ajax entensions) drag a update panel onto your form.

    (or just type in this in the markup:

             <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
    
                </ContentTemplate>
            </asp:UpdatePanel>
    

    Now in above, between the "contentTemplate is where YOUR stuff goes. I don't know what you have on the page, but the parts that you don't want to re-plot the whole page goes INSIDE of the above content Template section. (so your drop down list (combo box) and say the stuff that's supposed to be updated.

    So place the stuff you want to update and the dropdown list inside of the above.

    Note also how I dropped in what is called a script manager (you need that too!!).

    Place all that markup inside of the above.

    Now try it!!! - it is NEAR magic how well this works. Behind the scenes you get really what amounts to a advanced setup for JavaScript and ajax calls - but it all done automatic for you.

    Just keep in mind that the "code behind" you run and call as a result of events? It can only see, look at, and modify controls inside of the update panel when you do this. Controls or say buttons outside? They work fine, but then again they will re-post and re-plot the whole page.

    So, in general you can't just willy nilly dump everything into that update panel. But for say a grid view, and say some combo box (dropdown list) that filters the grid? That's a ideal candidate for the above use of a update-panel.

    once done, only that part of the browser screen will update - and the results should be rather nice!

    Regards,
    Albert D. Kallal (Access MVP 2003-2017)
    Edmonton, Alberta Canada


0 additional answers

Sort by: Most helpful