Click here to Skip to main content
12,450,981 members (53,727 online)
Rate this:
 
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
Updated 24-Apr-12 4:08am
v3
Comments
Sandeep Mewara 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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160826.1 | Last Updated 24 Apr 2012
Copyright © CodeProject, 1999-2016
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