ASP.NET Web form, how to center the cotrols ?

A

Ahmed Jewahar

Hi All,

I'm new to this forum as well as new to ASP.NET. My backgorund is ASP.
But, I'm just doing my .NET course with MS Certified training center
currently.

I have couple of questions (it may be silly for you !) and really
appreciate if you could share your expertise with me.

QUESTION - 1
-----------------

In my ASP (not NET) I managed to display HTML controls such as TEXT BOX,
BUTTON etc.. in the center of screen using HTML TAG <DIV>. and <CENTER>.

I just done one ASP.NET Applicaiton with one WebForm1 for testing which
contain number of "Server Controls". It's working fine. But, I don't
know how to center all the CONTROLS in the center of screen while it
runs !. For instance I have a client from 17" monitor or client with
screen resolution 1056x ?.

Basically I want put my all control similar to I have done in my Classic
ASP using HTML TAGS <CENTER> and <DIV> which helped me out to display
all the controls in the center of screen with size I defined with <DIV
style> Tag.

QUESTION 2
--------------
If I use ASP.NET to design form and develop applicaiton, can I do all
sort of Client validation using ASP.NET ?. For instance in Classical
ASP, I run "JavaScript" functions which execute upon "Form" onSubmit
event. This function I used to check whether user entered values in all
the fileds required !. How can I do the same in ASP.NET ?. Still do I
required JavaScript funciton to do the Client Validaiton in ASP.NET ?

QUESTION 3
-*------------

If we use ASP.NET to develop applicaiton, shall we still required HTML
controls and Client side scripts whcih normally developes uss in the
Classical ASP ?.

Hope all above make sense. Sorry for such a lenghty question..

Appreciate all your advise towards my questions.

Many thanks in advance..

Best regards,

Ahmed Jewahar
 
T

Tiki Wan

Hi,

I hope I understand your questions correctly.


#1

To center your control, you can delete the style attribute in the ASP
control which generate automatically when you drag it from the toolbox to
the webform. Then, you can use "<TABLE><TR><TD
align="center">Control</TD></TR></TABLE>" to put your control in the center.

#2

Several ASP.NET validate controls is available,

#3

You still need client side script sometime when you don't want to initial a
post back to the server.

You can check out this help topic using VS 2003

ms-help://MS.VSCC.2003/MS.MSDNQTR.2003APR.1033/cpgenref/html/cpconaspnetsynt
axforvalidationcontrols.htm

--

Tiki . C# Team

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
 
A

Ahmed Jewahar

Hi,

Thanks for your reply...

I can't avoid <DIV> as you know that it has lot of features.
for instance, suppose I have a <TABLE> contains 100+ rows, when user
user "scroll" he will be moving from first screen. If I put table within
<DIV style='width:300px;height:200px:blush:verflow-y:scroll'>
<TABLE>
<TR><TD>
.....
<TABLE>
</DIV>

above example will provide a "scroll" within the height of 200px. So
user will be able to scroll all the records from TABLE from same screen.
When he press scroll button he will not move from first screen.
Basically this will give more readability !.

Any luck to use <CENTER> tag in ASP.NET

REgards,

Ahmed


tags
 
T

Tiki Wan

You can use the html tag in the same way in the ASP.NET application.

But to use "<Center>", the web application need to set to use Flow Layout.
For more information, please refer to

ms-help://MS.VSCC.2003/MS.MSDNQTR.2003APR.1033/vsintro7/html/csconPositionin
gElementsInWebPages.htm

I hope this help.

Tiki . C# Team

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
 

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

Top