This is a migrated thread and some comments may be shown as answers.

Setting Web Form Appearance

3 Answers 53 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
William Corry
Top achievements
Rank 1
William Corry asked on 24 Apr 2009, 12:25 PM
The only way I've found of controlling the placement of controls on a Web Form is to create a table and place the controls within the cells of the table.  In other environments it is possible to simply move the control onto a form and it stays in the position it was placed.  Is there a way to do this with Ajax Web Forms?  I saw a video that showed use of the layout menu option in Visual Studio but I haven't seen that menu option for the Ajax Web Form.

Thanks,

3 Answers, 1 is accepted

Sort by
0
ManniAT
Top achievements
Rank 2
answered on 24 Apr 2009, 02:26 PM
Hi,

you can achive absolute positioning in VS very easy.
Create a new page. With the cursor on your div (is autmatically created) choose Format/Position... and the Absoulte.
Next (in design mode) drag the size of the div to give you enough space.
Place a control in the div (drag from Toolbox) and again choose "Position Absolute" - drag the control to what ever place you want.
The following code shows the result:
  <div style="z-index: 1; left: 10px; top: 15px; position: absolute; height: 286px; width: 1873px">  
        <asp:TextBox ID="TextBox1" runat="server" ontextchanged="TextBox1_TextChanged" style="z-index: 1; left: 407px; top: 169px; position: absolute"></asp:TextBox> 
    </div> 
You can copy it to a new page an see who it works.

In VS - options there is a setting (I can just guess the names since my VS is german) at:
Extras (tools I think)
Options
HTML Designer (left in the tree)
CSS Styles (the fourth entry)
For controls ... via Toolbox or paste or drag and drop.... use absolute positioning.
Set this checkbox - so absolute positionin will be default.

HTH

Manfred
0
Svetlina Anati
Telerik team
answered on 24 Apr 2009, 03:00 PM
Hello William,

I assume that you have seen the VS 2003 with page layout set by using ms_positioning set to grid layout. However, this functionality relied on absolute positioning and since it leads to different results under different browsers, it was removed for VS 2005 and later.

You can use different techniques to build your layout - most of them are available on the web:
http://www.google.bg/search?hl=bg&q=position+element+on+page&meta=&aq=f&oq=

and we recommend to examine them and choose what is most suitable for your exact scenario and requirements.

Regards,
Svetlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
William Corry
Top achievements
Rank 1
answered on 24 Apr 2009, 04:51 PM
Thanks, Svetlina/Manfred  that's what I was looking for.
Tags
General Discussions
Asked by
William Corry
Top achievements
Rank 1
Answers by
ManniAT
Top achievements
Rank 2
Svetlina Anati
Telerik team
William Corry
Top achievements
Rank 1
Share this question
or