Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CompareValidator Controls 1

Status
Not open for further replies.

Waynest

Programmer
Jun 22, 2000
321
GB
Hi

I have an audit record form which shows before and after values for a given record.

I've used CompareValidator controls to highlight which fields have changed.

I want to see the message from the CV controls when the form is initially displayed - not after a postback.

How can I achieve this?

Thanks
 
I think the following code added to the Page Load event handler shoudl work
Code:
private void Page_Load(object sender, System.EventArgs e){
	//Only for first load
	if(!Page.IsPostback){
		Page.Validate();
	}		
}
This should cause validation to be performed on the first load showing the appropriate messages.

Rob

Every gun that is made, every warship launched, every rocket fired, signifies in the final sense a theft from those who hunger and are not fed, those who are cold and are not clothed - Eisenhower 1953
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top