Link to home
Start Free TrialLog in
Avatar of jazzIIIlove
jazzIIIloveFlag for Sweden

asked on

Professional ASP.NET developer approach to allocate the controls on aspx page. How? in a table or any good ways to construct?

Hi there;

When I want to put various controls in the design view of aspx file. I put the controls generally speaking, left to right but VS2010 wants me to put those not i horizontal order but vertical order by default. So, I put sometimes table and do it or a paragraph that I go for &nbsp several times(which seems childish to do) or sometimes in a panel. So, in a professional environment, which way?

Please answer the question in the point of selfpostback or not self postback (if it's relevant, that I am not sure).

Kind regards.
SOLUTION
Avatar of Luis Pérez
Luis Pérez
Flag of Spain image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jazzIIIlove

ASKER

Hi there;

Thanks for the response!

ok, the magic seems div, yet;

I have 2 issues with div:

One when I want to design my page, from left to right, I failed with div. I mean when I drag and drop another control inside div, it goes just straight down of the previous control in the div, i couldn't position the new control next to the other control in div. How can I do this?

>>the <div> tag supports the following event attributes:
Secondly, it supports event attributes but in this case, suppose that i have a button control in the div, which one should I give the event action? div or button? Imagine that that button should do something and behind code it's doing or a javascript should work on it. So, which one should I assign the event? div or button?

Kind regards.




SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
2) For example, after clicking button1, the button1 action in behind code(aspx.cs) initiates. So, if I put an action to div, then the content in div will be fired? (since it's inside the div)

moreover, for the user, the div is pointless whereas button is the case, as he/she will be clicking on the button.

And, what about assigning 2 actions?For example, sometimes, I stuck at the following scenario;

2a) I want to give 2 actions to that button, 1 is javascript action, 2 is a button action.
So, is it a good idea, to give 2. action to button and 1. action to div?

Kind regards.

and apart from above, when I go for attribute; float:left

<div container>
button1                      button2
</div container>

3) now, if I set an action for div, will it  propogate to both buttons?
4) what about the spacing in between buttons? I mean I just press space, but it adds &nbsp, is it professional enough? (It seems funny to me in the code)?

Those are the final questions. Thanks for your patience.

Kind regards.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the code, it resolves
>>2) For example, after clicking button1, the button1 action in behind code(aspx.cs) initiates. So, if I put an >>action to div, then the content in div will be fired? (since it's inside the div)

in the comment, 04/01/12 11:34 AM, ID: 37373120

as finally said, in the below comment, what about:

and apart from above, when I go for attribute; float:left

<div container>
button1                      button2
</div container>

3) now, if I set an action for div, will it  propogate to both buttons?
4) what about the spacing in between buttons? I mean I just press space, but it adds &nbsp, is it professional enough? (It seems funny to me in the code)?

Those are the final questions. Thanks for your patience.

Kind regards.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi, thanks for the inputs. :)

ok, but, putting &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; is a good practice? I mean it looks a little messy to me. Is it a good practice or any other way to do that?

Kind regards.