473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Stupid Validator Question

I want the little "*" error message that displays next to a text box of
my validation to display when the page loads NOT on the button click so
that the user knows what fields are required BEFORE the try to save the
form.....Im sure this is obvious but I could not find the answer any
help greatly appreciated.

Mar 28 '06 #1
4 953
protected void Page_Load(object sender, EventArgs e)
{
Page.Validate();
}

<se********@gmail.com> wrote in message
news:11*********************@e56g2000cwe.googlegro ups.com...
I want the little "*" error message that displays next to a text box of
my validation to display when the page loads NOT on the button click so
that the user knows what fields are required BEFORE the try to save the
form.....Im sure this is obvious but I could not find the answer any
help greatly appreciated.

Mar 28 '06 #2
Won't that also display the validation summary?

Mar 28 '06 #3

"Maarten" <No****@me.com> wrote in message
news:OO*************@TK2MSFTNGP09.phx.gbl...
protected void Page_Load(object sender, EventArgs e)
{
Page.Validate();
}

<se********@gmail.com> wrote in message
news:11*********************@e56g2000cwe.googlegro ups.com...
I want the little "*" error message that displays next to a text box of
my validation to display when the page loads NOT on the button click so
that the user knows what fields are required BEFORE the try to save the
form.....Im sure this is obvious but I could not find the answer any
help greatly appreciated.



This will work but has a drawback. If you use this, and also have a
ValidationSummary control on your page, the errors will be listed on the
first page load, instead of just postbacks. If you do have a
ValidationSummary control on the page, then what you can do is set the
Display property of the Validation control(s) you are using to "None".
Place a label (styled) next to the controls that you are validating with an
'*' char as the text. This way, the '*' are always visible (styled to Red
forecolor if you so desire) and the error messages are only displayed in the
ValidationSummary on a validation check. You would no longer need
Page.Validate() in your Page_Load event.

HTH,
Mythran

Mar 28 '06 #4
Perhaps do

if(!page.ispostback)
{
Page.Validate();
myvldsummary.visible = false;
}

Mar 28 '06 #5

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

Similar topics

24
by: Nick Kew | last post by:
There's a new beta of the W3C Markup Validation Service now live at <URL:http://validator.w3.org:8001/> Probably the most important change is verbose output, including attempts to explain the...
195
by: Torbjørn Pettersen | last post by:
As you might have noticed I'm trying to clean up my web site's HTML code. The way I do it is simply more or less redoing to complete site, testing it on a web server I have set up on my local...
5
by: johnleemk | last post by:
I download the source for W3C's validator from http://validator.w3.org/source/ to validate pages on my own server. I commented a block of code that checks for non-public hosts so the validator...
4
by: Jane Withnolastname | last post by:
I am trying to re-work an old site by replacing the html with css. On the main page, I have a logo image which I needed centred on the initial screen. I found the solution here:...
2
by: Bril | last post by:
I am creating my first website and need some help desperatley. I have choosen to use Front Page XP for this simple Intranet project. All I am trying to do is: 1. Collect childrens names for a...
22
by: Lee K. Seitz | last post by:
What are this group's members' ideas about including W3C validator (http://validator.w3.org) graphics on web pages? Specifically, should they be on every page? I can see including an HTML/XHTML...
13
by: Niki Kovacs | last post by:
Hi, I'm an Austrian writer living in Montpezat (South France). I just installed a local W3C validator on my machine (Slackware 10.1, local Apache server). It's accessible as...
40
by: VK | last post by:
Hi, After the response on my request from W3C I'm still unclear about Tidy vs. Validator discrepansies. That started with <IFRAME> issue, but there is more as I know. Anyway, this very basic...
3
by: Howard | last post by:
I use a regex validator to check if a textbox is in email format. How do I make sure zero length input is not accepted? Do I need to use another requiredfield validator? or is check zero length...
37
by: Prisoner at War | last post by:
Actually, it doesn't have to be a blockquote...but I'm at my wits' end: I want to make bold several lines of text which have a pair of <br /tags between them...seems like the <b></bdo not "carry...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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,...
0
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...

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.