How to layout controls?

Hi,

I have opened a new ASP.NET web application. I have dragged a button control to the page from the toolbox. The control is left justified (i.e. it is tied to the left of the form). I want to move it more centrally in the form, but when I try dragging it, it doesn't move like it would in a windows form.

Is there a way for me to do this in design mode without having to make code changes?

Thanks

0
akpuk
4/13/2009 11:23:28 AM
asp.net.web-dev-2008-express 1205 articles. 0 followers. Follow

12 Replies
217 Views

Similar Articles

[PageSpeed] 24
Get it on Google Play
Get it on Apple App Store

Try dragging it into one table. Then, right click on the container, select "Properties" and check the "Align" property to "center".
Sic itur ad astra
0
kaldan2k
4/13/2009 11:43:00 AM

akpuk:
I want to move it more centrally in the form, but when I try dragging it, it doesn't move like it would in a windows form.

 

If you are using VS 2005 , when you are in design mode, go to the tiop menu click Layout-->position-->Auto positioning options-->checkselect absolutely positioned from the ddl under positioning options.

 

For VS2008 clikc format-->set position-->absolute

And you are free to move teh controls.


Joydeep Sen
Dotnet Developer

Dont forget to click “Mark as Answer” on the post that helped you.
This credits that member, earns you a point and mark your thread as Resolved for the sake of Future Readers


0
joydeepsen
4/13/2009 11:43:08 AM

first select your control (means single click) then go to LAYOUT menu then move to POSITION and select ABSOLUTE,.....

now you can drag your control any where on your form...............


Mayursinh B Rana
9898010015

Marking a Reply as 'Answered', not only GAIN us some POINTS, but it also HELP others to find RIGHT solution.
0
Mayursinh
4/13/2009 11:49:29 AM

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

<title>Untitled Page</title>

</head>

<body>

<form id="form1" runat="server">

 

<div style="position:absolute">

// any control in this tag.....you can drag.....because of style="position:absolute"

 

 

</div>

 

</form>

</body>

</html>


Mayursinh B Rana
9898010015

Marking a Reply as 'Answered', not only GAIN us some POINTS, but it also HELP others to find RIGHT solution.
0
Mayursinh
4/13/2009 11:53:38 AM

Thanks all.

 I am using VS 2008 Professional edition.

 When I click my control, I select format --> Position --> Absolute. After doing this I am able to move the control using cursors but not with my mouse (it keeps flipping back to the original position). How can I get it to move with my mouse?

Also, I cannot find format --> Set position. Am I missing something?

 

 

0
akpuk
4/13/2009 2:22:03 PM

after seting Format---->Position-------->Absolute.

 

select button(single click) then it will give one tag like asp:Button#Button1 click on this and drag the button.

dont click on Button and drag........

 


Mayursinh B Rana
9898010015

Marking a Reply as 'Answered', not only GAIN us some POINTS, but it also HELP others to find RIGHT solution.
0
Mayursinh
4/13/2009 5:56:41 PM

Are you moving control by white tab?

http://blogs.msdn.com/webdevtools/archive/2008/03/11/absolute-and-relative-positioning-in-visual-web-developer-2008-designer.aspx


Thanks

------------------------------------------------------------

This posting is provided "AS IS" with no warranties, and confers no rights.
0
Mikhail
4/13/2009 10:01:30 PM
Thanks - thats sorted the problem. I was dragging the button....
0
akpuk
4/13/2009 10:46:13 PM

akpuk:
Also, I cannot find format --> Set position. Am I missing something?

 

Hi akpuk,

I am also using Vs 2008 professional edition but in my case i can find format-->Set Position not format-->Position. I am not sure but may be it differs for VS 2008 90 days free trial version (available in msdn)and lisenced version of VS 2008.

I am also able to move the controls using mouse freely. No problem is there

Also kindly mark the post/posts as answered that helped you to get your sollution for the sake of future users.

 

 


Joydeep Sen
Dotnet Developer

Dont forget to click “Mark as Answer” on the post that helped you.
This credits that member, earns you a point and mark your thread as Resolved for the sake of Future Readers


0
joydeepsen
4/14/2009 5:30:11 AM

so i thing my above post was solved problem...............

so

 akpuk Mark As Answer which every post help you..........so other can take help form this


Mayursinh B Rana
9898010015

Marking a Reply as 'Answered', not only GAIN us some POINTS, but it also HELP others to find RIGHT solution.
0
Mayursinh
4/14/2009 5:40:25 AM

Hi,

I set the thread to "Resolved" yesterday and also clicked on the messages that answered my question. I'm not sure why it reverted back - I'll try again.

 Cheers

0
akpuk
4/14/2009 10:40:02 AM

You need to install SP1.


Thanks

------------------------------------------------------------

This posting is provided "AS IS" with no warranties, and confers no rights.
0
Mikhail
4/14/2009 3:55:00 PM
Reply: