Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
EDIT: OK, I think I have my solution, but maybe someone else can explain why. I am not doing any AJAX on the content or master page, but if I add AJAX's ToolkitScriptManager to my page, it seems to work fine. An AJAX requirement where there is no AJAX? Is there AJAX hidden in the master/content interaction?
 
ORIGINAL QUESTION STARTS HERE:
 
I've got a master page, and a content page with 2 listboxes that works fine. Another content page has 2 listboxes as well, but sometimes (2-3 times out of 10) the listboxes show as collapsed, either on postback or on initial load. The notable difference between the two pages is that the one that works is taking a lot longer to fetch and load its data into the listboxes.
 
I've broken this out to a simpler test app, and I find that I can repeat the same result when I include the master page's image logos. If I exclude the images, the listboxes load correctly every time; same back in the original app. I tried copying the images to my app's subfolders, but no change. Any ideas what's happening?
 
EDIT: some additional information. The presence of a script tag in the content page is also important, even if nothing is calling the script. Try it for yourself (hopefully this isn't limited to my machine) ...
 
1. Start a new ASP.NET web application.
2. Add a couple images above the navigation menu:
            
            <div class="logos">
                <img alt="icon 1" src="images/image1.png" height="50" />
                <img alt="icon 2" src="images/image2.png" height="50" />
            </div>
3. In the default page, add this to the body content:
    <div>
        <div>
            <span>
                listbox 1
                <asp:ListBox ID="lstMyTask" runat="server" Height="30%" Width="100%">
                </asp:ListBox>
            </span>
       </div>
    </div>
    <div style="width:100%;margin-removed5px;">
        <asp:Button ID="btnPostback" runat="server" Text="Postback"/>
    </div>
    <script type="text/javascript">
        function someFunction() {
            alert('something running this?');
        }
    </script>
4. In the code behind for the default page, add this (this is VB):
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            For i As Integer = 0 To 9
                lstMyTask.Items.Add(New ListItem(i + 1 & ": item " & i))
            Next
        End If
    End Sub
5. Configure and run your web app
6. Click the Home tab and/or the Postback button 20 times or so, and you should see it glitch at least once.
Posted 23-Apr-12 7:04am
Edited 24-Apr-12 4:08am
v3
Comments
Sandeep Mewara at 23-Apr-12 13:09pm
   
Interesting. Strange behavior. I will follow the question and see how the discussion goes. My 5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 365
1 Nirav Prabtani 268
2 Richard Deeming 215
3 CHill60 170
4 _Amy 145
0 OriginalGriff 8,104
1 Sergey Alexandrovich Kryukov 7,045
2 Maciej Los 4,039
3 Peter Leow 3,738
4 CHill60 2,912


Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 24 Apr 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100