Sunday, March 11, 2012

UpdatePanel and Tables within with 100% Width

/bump
This bothers me as well. I put my update panel on a masterpage (wrapping the content section) and it makes all pages using that master function with partialrendering. But the design view for everypage looks terrible. I have to take out the update panel while designing a new page, then put it back in.
Has this ever been addressed? I'm using the v1 Beta and had hoped that the design time experience with the UpdatePanel would have been improved. Not only did it not improve it appears to me to have gotten worse. I can't seem to get the UpdatePanel to expand at all - none of the "tricks" are working.
You can drop a Html div or an ASP.Net Panel inside the UpdatePanel and expand that to any size you might want to.
I've been fighting this problem for a couple days and here I see that it's been around for months. This makes the designer unusable for me. But the lack of outcry in general about this makes me wonder if I'm not missing something obvious. Anyone?

I second the outcry of the general public on this issue - this is really a problem that is way too obvious for the developers to have ignored, the QA people not to have noticed, and the public not to have complained about. I find it very difficult to use the designer this way, and I have searched the net and have not seen a remedy.


I'm going to join the outcry here. I was assuming that I was missing some obvious solution to this problem, but I can't find anything about it. It is definitely a frustrating oversight in an otherwise fantastic control.

I'm joining the forums just to post this. I cannot see but a few inches of my Update-Panel encapsulated multiview, same goes for my detailsview. Inserting div hacks seems a bit lacking as it compresses in both directions.

Can we at least get a reason for why this is happening and if anyone is looking into it?


BUMP!

I really need to join the outcry on this, but I'll also offer a quick & dirty hack to work around it.

1) Nest a div immediately inside the updatepanel (We shouldn't have to do this, so I named the div appropriately.;-) )

2) Set style->width: (your monitor size or your target monitor size as desired for design view)

3) Make the div scalable in page_load:

Asp.NET markup:

 <ajax:updatepanel id="UpdatePanel1" runat="server">
<contenttemplate>
<div runat="server" id="divShouldntHaveToDoThis" style="width: 768px;">
<asp:label id="Label1" runat="server" text="Summary"></asp:label><br />
Year: <asp:dropdownlist id="ddYear" runat="server">
<asp:listitem text="2007" value="2007"></asp:listitem>
<asp:listitem text="2008" value="2008"></asp:listitem>
</asp:dropdownlist>
Month: <asp:dropdownlist id="ddMonth" runat="server">
<asp:listitem text="1" value="1"></asp:listitem>
<asp:listitem text="2" value="2"></asp:listitem>
<asp:listitem text="3" value="3"></asp:listitem>
<asp:listitem text="4" value="4"></asp:listitem>
</asp:dropdownlist>
<asp:button id="btnSubmit" runat="server" text="Submit" onclick="btnSubmit_Click" />
</div>
</contenttemplate>
</ajax:updatepanel>

Page_Load:

protected void Page_Load(object sender, EventArgs e)
{
this.divShouldntHaveToDoThis.Style["width"] ="100%";
}

No comments:

Post a Comment