473,378 Members | 1,380 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,378 software developers and data experts.

Is ViewState required for CompareValidator or other validator controls

I have seen examples that seem to indicate that if we extend a
validator, the extended properties must be preserved in ViewState.
That seems unnessary to me since we usually will declare the validators
on every trip to the server.
Am I missing something?.
The example I am thinking about, the validator class declares a property
ControlToCompare, this Property preservers and loads its values from
Viewstate as follows:
public string ControlToCompare
{
get
{
string temp = (string)ViewState
["ControlToCompare"];

if (temp != null)
{
return temp;
}
else
{
return string.Empty;
}
}
set
{
ViewState["ControlToCompare"] = value;
}
}
[This followup was posted to microsoft.public.dotnet.general and a copy
was sent to the cited author.]

Jul 21 '05 #1
0 1200

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

Similar topics

3
by: Rick | last post by:
I have an interesting problem when I run the following code in Netscape (7.02) vs. IE. This page works great in IE and all my controls bring up the validation summary dialog box if the required...
3
by: Steve Drake | last post by:
All, I have a CONTROL that contains 1 control (Control ONE), the 1 control that it can contain 1 or 2 control (Control A and B). Control A, raises and event and Control ONE receives this event...
2
by: Eric Maia | last post by:
I have a textbox (StartDateTextBox) in a UserControl on my page, that is supposed to have a date entered into it. I have a RequiredFieldValidator that has its ControlToValidate property set to the...
3
by: hooterbite | last post by:
The range validator works, the compare validator doesn't. Dim txbNew As New TextBox txbNew.ID = "txb" & arStyles(i) Dim rvNew As New RangeValidator rvNew.Text = "Must be a number greater then...
4
by: MattB | last post by:
I have a page that has gone through a lot of editing. It has many text box and validator controls, and one compare validator just isn't working. I have the control to validate set, and control to...
1
by: spidur1 | last post by:
For some reason these fields are not being validated before the postback. Here the HTML page. Am I missing something from the validator controls that needs to be set? <table cellpadding="0"...
0
by: Guess | last post by:
I have seen examples that seem to indicate that if we extend a validator, the extended properties must be preserved in ViewState. That seems unnessary to me since we usually will declare the...
1
by: tshad | last post by:
The CompareValidator doesn't seem to work correctly. I have the following to compare 2 controls that are Currency and no matter what I enter, it seems to give me an error. I saw in the MSDN that...
2
by: bogdan | last post by:
Is it possible to have a CompareValidator to compare values from two cells in a gridview row? I'd like to do that while in edit mode. Thanks, Bogdan
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.