Showing posts with label example. Show all posts
Showing posts with label example. Show all posts

Wednesday, March 28, 2012

Why templating the content of the UpdatePanel?

Many ASP controls use template for their content (theGridView being a good example). TheUpdatePanel has aContentTemplate property that, as the name suggests, contains the content of the UpdatePanel.

Yet, since the UpdatePanel is not a repeater control, I do not grasp (as a consumer of the ATLAS library) the interest of templating the content of the UpdatePanel. Does some has an idea why a ContentTemplate is used instead of the regular control children?

Thanks in advance,
Joannès
http://www.peoplewords.com

hello.

i'd say that a template let's you have complete control over the content of the updatepanel. if you had a property of another type, you'd only be able to use elements of that type (or of a derived type)


ThePlaceHolder is not templated and but can include any element (as long as they inheritControl which is not a real constraint). My question can maybe be rephrased as "Why did the UpdatePanel not follow the PlaceHolder design pattern?".

Joannès

hum...how about designer integration? i'm not sure because i really don't use the designer, but can you drag-n-drop controls from the toolbox into a placeholder control?

Why?

Why is it that the example below works just fine, but if I move the updatepanel anywhere else, it stops working? It won't work if I put it directly below the asp:Panel. It won't work if I put it inside the <table>... Is there some rule I should be following here for where an updatepanel should be placed?

<asp:Panel ID="pnlOptions2" runat="server"> <tr> <td valign="top"><strong>Additional Options</strong></td> <td colspan="2"> <asp:UpdatePanel ID="upOptions2" runat="Server"> <ContentTemplate> <table cellpadding="0" cellspacing="0" width="650"> <tr> <td width="175"><asp:CheckBox ID="cbTransparencies" runat="server" Checked="false" AutoPostBack="true" />Transparencies</td> <td width="125"><asp:CheckBox ID="cbLetter" runat="server" checked="false" AutoPostBack="true" />Letter</td> <td width="175"><asp:CheckBox ID="cb11x171" runat="server" checked="false" AutoPostBack="true" />11x17 1's</td> <td width="175"><asp:CheckBox ID="cbPaper" runat="Server" checked="false" AutoPostBack="true" />Provided Paper</td> </tr> <tr> <td><asp:CheckBox ID="cbNCR2" runat="Server" checked="false" AutoPostBack="true" />2 part NCR</td> <td><asp:CheckBox ID="cbLabels" runat="server" checked="false" AutoPostBack="true" />Labels</td> <td><asp:CheckBox ID="cb11x172" runat="server" checked="false" AutoPostBack="true" />11x17 2's</td> <td><asp:CheckBox ID="cbLaminate" runat="server" checked="false" AutoPostBack="true" />Laminate</td> </tr> <tr> <td><asp:CheckBox ID="cbNCR3" runat="Server" checked="false" AutoPostBack="true" />3 part NCR</td> <td><asp:CheckBox ID="cbTabs" runat="server" checked="false" AutoPostBack="true" />Tabs</td> <td><asp:CheckBox ID="cbCards" runat="server" checked="false" AutoPostBack="true" />Business Cards</td> </tr> <tr> <td><asp:CheckBox ID="cbNCR4" runat="Server" checked="false" AutoPostBack="true" />4 part NCR</td> <td><asp:CheckBox ID="cbCerts" runat="server" checked="false" AutoPostBack="true" />Certs</td> <td><asp:CheckBox ID="cbBrochures" runat="server" checked="false" AutoPostBack="true" />Brochures</td> </tr> </table> </ContentTemplate> </asp:UpdatePanel> </td> </tr> </asp:Panel>

The UpdatePanel prefer to work within a DIV or a SPAN object. Try setting the RenderMode property of the UpdatePanel toInline


See it here for RenderMode property, try to set it

http://www.asp.net/AJAX/Documentation/Live/mref/P_System_Web_UI_UpdatePanel_RenderMode.aspx

See for most common problem of UpdatePanel

http://blogs.visoftinc.com/archive/2007/09/23/asp.net-ajax--updatepanel-not-working--common-problems.aspx

wierd behavior on submit button (partial postback acting as full postback randomly)

I setup this example from here, but I am getting some weird behaviour.

First off I was getting the pretty famous popup error of "unknown error" I was able to fix this by adding

<xhtmlConformancemode="Transitional"/>

to the web.config.

Right now the weird error that I am experiencing however is when I do a partial postback, the button actually does a full postback the first time, then after that it turns to partial post backs. This behaviour isn't always consistent, sometimes it takes 10 postbacks before it starts working as a proper AJAX partial postback.

Doesn't make any sense to me ?

Any one got an idea on this one? I copied the source directly from here, its very straightforward.

article

I have the same behavior. But I think in my case it is because I'm running vista RC1

If I clear my temporary internet files it seems to work ok for a while tho


I'm still running windows 2000 and its messing up, so I don't think it has anything to do with that.


At first clearing temp files seemed to help, but now it doesn't. It's so erratic that I can't come up with any possible ideas right now.

Anyone else experiencing this?

Thanks,

mike123