473,783 Members | 2,574 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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


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
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
3 9503
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.2003 APR.1033/cpgenref/html/cpconaspnetsynt
axforvalidation controls.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.

Jul 19 '05 #2
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:30 0px;height:200p x:overflow-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
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3
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.2003 APR.1033/vsintro7/html/csconPositionin
gElementsInWebP ages.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

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
427
by: Ahmed Jewahar | last post by:
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
5
12063
by: Jason Huang | last post by:
Hi, I would like to set the GroupBox's border to invisible, how to do that? Thanks for help. Jason
5
2967
by: WilliamRLinden | last post by:
Hi world! we are pretty new to JavaScript and have been struggling for now 2 days on this problem ... We would appreciate mercy if anyone can give us some. Basically we are trying to simulate the tab key when the down arrow key is pressed. (we know there are other way to control focus flow but we use a lot of dynamic jsp fields, that will make the flow control a nightmare, we just want basic tabbing from the arrow key)
3
2340
by: Bill | last post by:
I'm using the POST method to submit a simple form html page with yes/no and checkbox fields to an asp response page which stores the values in a new dim string, then uses it to build a new table using ADO. I'm getting sometimes correct values, sometimes null values (when I know I pass a valid default value) and other times multiple values! I know what the values coming over are because I do a response.write to see it before the error...
2
3633
by: alwaysintune | last post by:
I'm using the McFedries email form, and I can't seem to get an upload form to work. Instead of it saving to my server, I want it to send the information and the picture to my email. Here is the html for my form. If anyone could help, that'd be greatly appreciated. <form action="http://www.mcfedries.com/mailform/mailform.asp" method="POST"> <input type=hidden name="MFAddress" value="My email address"> <input type=hidden name="MFCode"...
1
3511
by: Sithlord999 | last post by:
Hello. I'm working on an email form on Dreamweaver and I'm looking for a PHP code to make it work. The form with some required fields would send the submitted information and two image attachments to my email address. I just started looking at PHP two weeks ago for an answer and the only code that worked for me, so far, was a simple php email form: <html> <head></head> <body> <? if(isset($submit)) { //check for email injection attack;...
8
3590
by: Ryan | last post by:
Ok.. I have a form with lots of stuff on it; a tool strip panel, menu strip, data binding elements (dataset, binding source, table adapter), tab control with 7 tab pages, each page contains a picture box, lots of text boxes (for input).. you get the idea. All of a sudden everything on the form has disappeared, it looks like a blank, newly created form. I can still get to the properties of every item on the form using the drop-down box in...
5
2549
by: plumba | last post by:
Hi all I have a form (see below), which for some reason has decided to stop functioning all together. It just does not call up the function. It is called up in the opening <form> tag but fails.... Any ideas??? <html> <head><title>New Details</title> </head> <center> <H2><IMG SRC="$(path)smlogo.gif"><br>
13
1854
by: DDragon | last post by:
ok here is the problem, i have to forms which have values i wish to be added together i can add together the values in one form all right but im having problems with adding the values of the other form to it... ill post the code for you to look at and try to explaine in detail what im trying to do. here is the code (HTML and Javascript so you get the whole picture): Javascript: var gen, lights; var lammount;
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10083
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9946
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.