Web Control question (newbie)

B

Bill Cohagan

I'm working through the ASP.Net Quick Start book and have managed to get
pretty confused about something. I've created a WebForm and am trying to
"place" a Label Web Form control on the form. I've got Grid mode turned on.

If I drag the control from the ToolBox I can drop it wherever I want
(subject to the grid of course). If however I just double click the control
then it gets placed in the upper left corner. Subsequently I'm unable to
drag it and place it elsewhere. When I attempt to drag the cursor changes
as though it's going to work, but when I release the mouse button the
control remains where it is. Also, if I use the first technique to place
it, then change (say) the font, then it ends up back in the corner.

So, can anyone explain this behaviour to me? Seems to me that I should be
able to place a control anywhere on the grid, even after it's been placed in
its original position.

Thanks in advance,
Bill
 
S

Steve C. Orr [MVP, MCSD]

I, and most developers it seems, prefer Flow Layout. It is much more
flexible.
Grid Layout can be nice for some things, such as fixed size dialogs, but I
don't use it unless I have a good reason. I wish FlowLayout was the default
in Visual Studio.NET.
At least you can change this to be the default layout on a per project
basis.
In the solution explorer window, right click on your project and select
properties.
Then under Common Properties select Designer Defaults.
There you can set the default page layout for your project.
 
L

Larry Brindise

You might also try just editing the HTML directly by
clicking the "html" tab in the bottom-left portion of
vs. It takes what's in your GUI designer and show it to
you in HTML format where you can edit it directly. I
usually get things close to the way I want them to look
in the GUI mode, then tweak in HTML.
Hope this helps,
-Larry
 
B

Bill Cohagan

OK. But why does grid work so inconsistently? I thought the whole purpose
for the grid was so that you could place controls easily (as is the case
when you drag one off the toolbox.) Is this just a bug in VS? (BTW I'm using
VS.Net 2003)

Thanks for the response,
Bill
 
B

Bill Cohagan

Larry
Thanks for the response. Since I'm not "in the heat of battle" on a
project, but am simply trying to learn how to use VS.Net and ASP.Net I'm
more interested in understanding why I'm having this problem than I am in
working around it. Have you got any idea why I'm experiencing these problems
placing web form controls on a grid?

Thanks again,
Bill
 
B

Bill Cohagan

OK, I've discovered the source of the problem. Somehow while experimenting
with the designer I added a SPAN element. Subsequent new web controls ended
up being placed within that span element. This (somehow) disabled the
control's ability to be repositioned. I don't yet understand the details for
this, but I think I can figure that out with a little more research/reading.

Onward...

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top