Showing posts with label content. Show all posts
Showing posts with label content. Show all posts

Wednesday, March 28, 2012

Multiple update panels: content disappears when modalpopup is used

Hello there,

I'm experiencing a rather annoying issue at the moment. I'm working on a webapplication, which contains quite a big page. This page contains multiple updatepanels, which in their turn contain dropdownlists/checkboxes. The page also uses a TextboxWatermarkExtender on one textbox control, and a ModalPopup which is shown conditionally by calling .Show() from the codebehind.

The ModalPopupExtender and TextboxWatermarkExtender are not on an updatepanel or anything.

Everything seems to work as it should, but I'm having a rather annoying cosmetic issue: at the moment the modalpopup is shown on my page, all the content of the updatepanels dissapears: none of the dropdownlistboxes are visible anymore!

Something weird also happens when I do any action in any of the updatepanels: when I do this, the TextboxWatermarkExtender seems to "refresh" its text (you see the text "flash").

I'm thinking these issues might be connected somehow... Has anyone got any idea on how to solve this issue, or has anyone else ran into this?

I took a few screnshots to illustrate the problem.

This is how the page looks without the modal popup:

This is with the modal popul:

As you can see, all the dropdownboxes have disappeared. Also, I noticed not only the dropdownboxes in updatepanels diasppear, but those that aren't also disappear.

Any ideas/suggestions? Tnx!


No-one? :( I've been looking all over the internet for this, but I can't seem to find anyone having the same issue. I do find issues with dropdownboxes floating "on top of" a layer when using Internet Explorer, but that's not the problem I have here... Also, I noticed this behaviour doesn't appear in Firefox: everything looks ok when using that browser...

My DDL(s) also disapeer with modal popup!!

And I had another problem with them when the modal popup causes a postback.

So I solved that by wrapping my DDL in another update panel... (with updatemode="always", dunno if that was necessary...)

But it seems to be working now...


And another update: I installed IE7 recently, and in that browser, the problem seems to be solved: the dropdownboxes don't disappear anymore.

So, this really seems to be an IE6-browser issue. I tried putting the ddl's in updatepanels (some of them already were), but that didn't help...

Browser-specific issues... gotta hate 'em ;-)

Monday, March 26, 2012

MultiView within UpdatePanel causes PostBack... =(

The subject says it all. Due to a video playing, when new content is requested I need the page to NOT post back so the video doesn't restart. However, the page is still seeing a postback. Any ideas are welcome.

[removed by author]

Hi,

Is the video in the updatepanel?

Saturday, March 24, 2012

Navigation using Master pages and Update panel without refresh

Hi

I have a master page in which there are hyperlinks to go to different pages. Its a header basically. I got the relevant content pages for the hyperlinks.

But when I click the master page links, a postback occurs and the whole page is refreshed and directed to the new page.

I need a way by which when I click the hyperlinks in master page the content pages change without any refreshing. I heard about the Iframe implementaion in update panel is it a feasible way to do this or multiview might solve my problem ?

Having a master page sort of defeats the purpose of keeping the same page and dynamically updating portions on postback. The master page is meant to be a supplement for the page the user is viewing. This means the master page is never browsed directly, it only contains master code for each of the pages that are browsed to directly.

Also, hyperlink controls should not perform postbacks -- they are simply meant for navigation. Therefore, anytime a user clicks a hyperlink, the user will be taken to the new page, causing flicker. I suggest using a link button instead. These perform postbacks and can capture events much better than a hyperlink.

In order to do what you're trying to do, consider not using a master page. Instead, use a single page that makes use of either an iframe or a multiview enclosed in an updatepanel. Example is below:

<htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server">
<title>Untitled Page</title>
</head>
<body>
<formid="theForm"runat="server">
<divid="wrapper">
<asp:ScriptManagerID="scriptManager"runat="server"></asp:ScriptManager>
<divid="header">
<asp:LinkButtonID="lnkClickMe"runat="server"OnClick="lnkClickMe_Click">Click Me!</asp:LinkButton>
</div>
<asp:UpdatePanelID="pnlDynamicContent"runat="server"UpdateMode="Conditional">
<ContentTemplate>
<asp:MultiViewID="mvDynamicContent"runat="server"ActiveViewIndex="0">
<asp:ViewID="viewBeforeClick"runat="server">
This is before the link above is clicked
</asp:View>
<asp:ViewID="viewAfterClick"runat="server">
This is after the link above is clicked
</asp:View>
</asp:MultiView>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTriggerControlID="lnkClickMe"EventName="Click"/>
</Triggers>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>

And the code-behind:

PartialClass Test_ForumTest
Inherits System.Web.UI.Page

ProtectedSub lnkClickMe_Click(ByVal senderAsObject,ByVal eAs EventArgs)
mvDynamicContent.ActiveViewIndex = 1
EndSub
EndClass


Convert your hyperlink to linkbuttons then register these buttons as AsyncTrigger in the Update Panel. Convert Your Content Pages to User Control. Load the Proper User Control on Button Click.