Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Positioning of Controls in Visual Studio - ContentPlaceHolder Resizing

It becomes quite hectic when some controls in Visual Studio 2008 tend to be binded at a point and even Format menu with positioning option gets inactive. In order to get the position option in the format menu to get activated- You have to manually search the control in the source code and type in :  style="position:absolute;"
This will allow you to get the control to the position as per your wish through drag drop.




The biggest trouble: Resizing ContentPlaceHolder
Given that:  You have used a MasterPage for your Webforms and The MasterPage has been Designed through inserting table and The ContentPlaceHolder Tags have been positioned in the <tr><td></td></tr>as per your wish.

The problem arrives when you try to resize ContentPlaceHolder or any Coloumn,  for the benefit  that your page is visible completely on the Browser.

The Problem that arrives is: While trying to drag the ContentPlaceHolder box- It doesn't expand or even by manually changing the style defination by providing a width size as per your wish, it results in the moving away of the coloumn to further right and thus in order to see the entire webpage we have to scroll to the right and that is not recommended or a right approach.

The solution to this problem is by "manupulationg the defination through the use of
ie.First remove the style defination for the <td> which appears as  class="stylexx" which includes the ContentPlaceHolder tags;

Then use the following syntax instead of the one which was used as described above:
<tr><td><div style="height:500px;overflow:auto"><asp:ContentPlaceHolderID="ContentPlaceHolder1"
runat="server"></asp:ContentPlaceHolder></div></td>

The above syntax is using overflow:auto which allows your ContentPlaceHolder to expand as per the browser and available space; The space you decided while including the ContentPlaceHolder in the <tr><td> tags by draging rows and coloumns of the table as per your wish in the MasterPage.





DisclaimerThis site is not intended to replace professional opinion or recommendation. Its content are provided “as is” and without any liability for any damage or loss whatsoever related to this Blog’s use. The Logos, Trademarks and Graphics used in this Blog are solely the property of their respective owners. TechMyQuery doesn't in any way claim any representation neither is endorsed to promote any entity. 


This post first appeared on TechMyQuery, please read the originial post: here

Share the post

Positioning of Controls in Visual Studio - ContentPlaceHolder Resizing

×

Subscribe to Techmyquery

Get updates delivered right to your inbox!

Thank you for your subscription

×