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
    • Participant
      966 point Participant
    • abhijeet_dighe
    • Member since 03-22-2007, 11:57 AM
    • Nasik, India
    • Posts 265

    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.

     

     

    Please Mark As Answer if this helps.

    Regards,
    Abhijeet Dighe
  • Re: Update Panel width

    08-29-2008, 7:39 AM
    • Participant
      986 point Participant
    • ilivewithian
    • Member since 03-27-2007, 8:32 AM
    • Birmingham, UK
    • Posts 263
    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
    • Participant
      966 point Participant
    • abhijeet_dighe
    • Member since 03-22-2007, 11:57 AM
    • Nasik, India
    • Posts 265
    Is there any fix for that?
    Please Mark As Answer if this helps.

    Regards,
    Abhijeet Dighe
  • Re: Update Panel width

    08-29-2008, 9:04 AM
    • Star
      13,605 point Star
    • gt1329a
    • Member since 06-24-2002, 12:53 AM
    • Atlanta
    • Posts 2,248
    • ASPInsiders
      TrustedFriends-MVPs
    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, jQuery, AJAX, and more.

    Latest article: Emulate ASP.NET validation groups with jQuery validation
  • Re: Update Panel width

    08-29-2008, 9:08 AM
    • Participant
      966 point Participant
    • abhijeet_dighe
    • Member since 03-22-2007, 11:57 AM
    • Nasik, India
    • Posts 265

    But Update Panel is not having width property

    Please Mark As Answer if this helps.

    Regards,
    Abhijeet Dighe
  • Re: Update Panel width

    08-29-2008, 9:22 AM
    • Star
      13,605 point Star
    • gt1329a
    • Member since 06-24-2002, 12:53 AM
    • Atlanta
    • Posts 2,248
    • ASPInsiders
      TrustedFriends-MVPs

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

    #UpdatePanel1 { width: 800px; }

    etc.

    Encosia - ASP.NET, jQuery, AJAX, and more.

    Latest article: Emulate ASP.NET validation groups with jQuery validation
  • Re: Update Panel width

    08-30-2008, 1:27 AM
    • Participant
      966 point Participant
    • abhijeet_dighe
    • Member since 03-22-2007, 11:57 AM
    • Nasik, India
    • Posts 265

    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.

     

     

    Please Mark As Answer if this helps.

    Regards,
    Abhijeet Dighe
  • Re: Update Panel width

    08-30-2008, 6:42 AM
    • Participant
      1,274 point Participant
    • atanu.podder
    • Member since 08-20-2008, 11:40 AM
    • Bangalore
    • Posts 191

     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
    • Participant
      966 point Participant
    • abhijeet_dighe
    • Member since 03-22-2007, 11:57 AM
    • Nasik, India
    • Posts 265

    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. 

    Please Mark As Answer if this helps.

    Regards,
    Abhijeet Dighe
  • 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
    • Participant
      966 point Participant
    • abhijeet_dighe
    • Member since 03-22-2007, 11:57 AM
    • Nasik, India
    • Posts 265

    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?

    Please Mark As Answer if this helps.

    Regards,
    Abhijeet Dighe
  • 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)