Page view counter

Update Panel width

Last post 09-02-2008 12:26 AM by Vince Xu - MSFT. 11 replies.

Sort Posts:

  • Update Panel width

    08-29-2008, 5:32 AM

    Hi

    I am using html table having width 100% inside update panel.

    But still width of update panel is not changing in vidual studio designer.

    If I run the application table is displayed properly with 100% width.

    Why this happens? Why update panel doesnt change its width?

    Bellow is my html code :

             <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                <ContentTemplate>
                   <table style="width:100%; border:solid 1px black;">
                    <tr>
                        <td>
                        </td>
                    </tr>
                </table>
                </ContentTemplate>
            </asp:UpdatePanel>

    I dont have any other code in design beside this.

    Thanks in advance.

     

     

    Check out my blog: Jeet on Writing...
  • Re: Update Panel width

    08-29-2008, 7:39 AM
    • Loading...
    • ilivewithian
    • Joined on 03-27-2007, 8:32 AM
    • Birmingham, UK
    • Posts 263
    • Points 986
    I've found that the studio designer isn't very good when you have master pages or update panels, you'll just have to live with it.
  • Re: Update Panel width

    08-29-2008, 7:46 AM
    Is there any fix for that?
    Check out my blog: Jeet on Writing...
  • Re: Update Panel width

    08-29-2008, 9:04 AM
    • Loading...
    • gt1329a
    • Joined on 06-23-2002, 8:53 PM
    • Atlanta
    • Posts 2,055
    • Points 12,287
    Try giving your UpdatePanel a width too.  An UpdatePanel just renders as a <div>.  Without styling information, the designer doesn't know how to render it.
    Encosia - ASP.NET, AJAX, and more.

    Latest article: Never worry about ASP.NET AJAX's .d again
  • Re: Update Panel width

    08-29-2008, 9:08 AM

    But Update Panel is not having width property

    Check out my blog: Jeet on Writing...
  • Re: Update Panel width

    08-29-2008, 9:22 AM
    • Loading...
    • gt1329a
    • Joined on 06-23-2002, 8:53 PM
    • Atlanta
    • Posts 2,055
    • Points 12,287

    Since it renders as a <div>, you can style it with CSS:

    #UpdatePanel1 { width: 800px; }

    etc.

    Encosia - ASP.NET, AJAX, and more.

    Latest article: Never worry about ASP.NET AJAX's .d again
  • Re: Update Panel width

    08-30-2008, 1:27 AM

    Thanks for your reply.

    It works for fixed width like 600px.

    But if I change width of table to 100%.

    Then width of update panel is not changing in designer.

     

     

    Check out my blog: Jeet on Writing...
  • Re: Update Panel width

    08-30-2008, 6:42 AM
    • Loading...
    • atanu.podder
    • Joined on 08-20-2008, 11:40 AM
    • Bangalore
    • Posts 191
    • Points 1,274

     Have a table inside it and set its width to 100%, thats it! Here is the sample 

                <asp:UpdatePanel ID="updatePanel" runat="server">
                    <ContentTemplate>
                        <table width="100%" style="background-color:OrangeRed">
                            <tr>
                                <td>
                                    Its set to 100%.
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                
     
    Thanks,
    Atanu, Symphony Services

    P.S. Dont forget to mark this as answer, if you have got resolution to your problem from this post.
  • Re: Update Panel width

    08-30-2008, 7:55 AM

    When I run the application, table is displayed properly.

    But in the vidual studio designer , Update Panel is not stretched to 100% width.

     I have some pages where design is very complicated. So I need to check layout in the designer. 

    Check out my blog: Jeet on Writing...
  • Re: Update Panel width

    09-01-2008, 10:49 PM

    Hi,

    The width of UpdatePanel is settled in design mode. We can't set the width to it. So we shouldn't lean on the design mode to confirm the layout.

    If you want to confirm the layout in design mode, the only thing you can do is using div instead of UpdatePanel to check the layout. And replace back before running.

    In a word, I don't suggest you adjust the layout in design mode. It will be changed after running in the browser. And in the different browsers, the layout is different.


    Vince Xu
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Re: Update Panel width

    09-02-2008, 12:12 AM

    Hi

    I got the solution here : http://www.codeproject.com/KB/ajax/TBUpdatePanel.aspx

    The only problem is that it shows message when moving from html source view to design view.

    Should I use this approach? Will this create any problems?

    Check out my blog: Jeet on Writing...
  • Re: Update Panel width

    09-02-2008, 12:26 AM
    Answer

    Hi,

    This is the third-party control which is based on UpdatePanel. I'm not sure if it will encounter some problems.

    However, the design mode can't be the absolutely same as on the browser. Maybe in FireFox, the layout is totally different.

     


    Vince Xu
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (12 items)