473,398 Members | 2,343 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,398 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 1202

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
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
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...
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.