473,756 Members | 9,576 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

validation control headache

NuB
The validation controls are giving me a headache. here is what i'm trying to
do and so far what I've tried has not worked.

I need to hide my grid if the page is not valid
how can i accomplish that?

I have one validation control that gives an error if there is no data
returned, so if the page is not valid on another search i need that to go
away. How can i hide and show controls and labels bases on the page.isvalid

has anyone done this before
Dec 21 '05 #1
12 1347
why dont you just check for the required data in the code?
it seem that you are using the validators for a different purpose, since
your page should not be ablt to postback until all validations are
passed...unless you want to do some extra server-side validation, and then I
think you dont need the validation web controls for that.
Hope that helps.
Alex.
"NuB" <me@me.com> wrote in message
news:O2******** *****@TK2MSFTNG P12.phx.gbl...
The validation controls are giving me a headache. here is what i'm trying
to do and so far what I've tried has not worked.

I need to hide my grid if the page is not valid
how can i accomplish that?

I have one validation control that gives an error if there is no data
returned, so if the page is not valid on another search i need that to go
away. How can i hide and show controls and labels bases on the
page.isvalid

has anyone done this before

Dec 21 '05 #2
NuB
i'm not following;

what happens is this: I have 4 text boxes on my web form to allow a user to
do a search.
If all textboxes are populated a grid with results is populated and
displayed, then if the user
decides to do another search and misses a textbox, the required field state
is missing message is displayed, THEN if
that message is visible I then need to hide the grid from the prior
successful search.


"Alex D." <al********@hot mail.com> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
why dont you just check for the required data in the code?
it seem that you are using the validators for a different purpose, since
your page should not be ablt to postback until all validations are
passed...unless you want to do some extra server-side validation, and then
I think you dont need the validation web controls for that.
Hope that helps.
Alex.
"NuB" <me@me.com> wrote in message
news:O2******** *****@TK2MSFTNG P12.phx.gbl...
The validation controls are giving me a headache. here is what i'm trying
to do and so far what I've tried has not worked.

I need to hide my grid if the page is not valid
how can i accomplish that?

I have one validation control that gives an error if there is no data
returned, so if the page is not valid on another search i need that to go
away. How can i hide and show controls and labels bases on the
page.isvalid

has anyone done this before


Dec 21 '05 #3
I think you should read a little bit about validators...va lidators are not
just for displaying messages, you can use them to keep the user in the page
until all requiered fields (textboxes, radiobuttons, checkboxes, etc..) are
validated. What I was saying in the previous message is that you can just
check your textboxes for a value ex: if ( this.TextBox1.T ext != "" ) {//do
something}

alex.

"NuB" <me@me.com> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
i'm not following;

what happens is this: I have 4 text boxes on my web form to allow a user
to do a search.
If all textboxes are populated a grid with results is populated and
displayed, then if the user
decides to do another search and misses a textbox, the required field
state is missing message is displayed, THEN if
that message is visible I then need to hide the grid from the prior
successful search.


"Alex D." <al********@hot mail.com> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
why dont you just check for the required data in the code?
it seem that you are using the validators for a different purpose, since
your page should not be ablt to postback until all validations are
passed...unless you want to do some extra server-side validation, and
then I think you dont need the validation web controls for that.
Hope that helps.
Alex.
"NuB" <me@me.com> wrote in message
news:O2******** *****@TK2MSFTNG P12.phx.gbl...
The validation controls are giving me a headache. here is what i'm
trying to do and so far what I've tried has not worked.

I need to hide my grid if the page is not valid
how can i accomplish that?

I have one validation control that gives an error if there is no data
returned, so if the page is not valid on another search i need that to
go away. How can i hide and show controls and labels bases on the
page.isvalid

has anyone done this before



Dec 21 '05 #4
NuB
yes i know, I didn't create this app, I just started working on it and they
have several validators for required
"Alex D." <al********@hot mail.com> wrote in message
news:ee******** ******@TK2MSFTN GP11.phx.gbl...
I think you should read a little bit about validators...va lidators are not
just for displaying messages, you can use them to keep the user in the page
until all requiered fields (textboxes, radiobuttons, checkboxes, etc..) are
validated. What I was saying in the previous message is that you can just
check your textboxes for a value ex: if ( this.TextBox1.T ext != "" ) {//do
something}

alex.

"NuB" <me@me.com> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
i'm not following;

what happens is this: I have 4 text boxes on my web form to allow a user
to do a search.
If all textboxes are populated a grid with results is populated and
displayed, then if the user
decides to do another search and misses a textbox, the required field
state is missing message is displayed, THEN if
that message is visible I then need to hide the grid from the prior
successful search.


"Alex D." <al********@hot mail.com> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
why dont you just check for the required data in the code?
it seem that you are using the validators for a different purpose, since
your page should not be ablt to postback until all validations are
passed...unless you want to do some extra server-side validation, and
then I think you dont need the validation web controls for that.
Hope that helps.
Alex.
"NuB" <me@me.com> wrote in message
news:O2******** *****@TK2MSFTNG P12.phx.gbl...
The validation controls are giving me a headache. here is what i'm
trying to do and so far what I've tried has not worked.

I need to hide my grid if the page is not valid
how can i accomplish that?

I have one validation control that gives an error if there is no data
returned, so if the page is not valid on another search i need that to
go away. How can i hide and show controls and labels bases on the
page.isvalid

has anyone done this before



Dec 21 '05 #5
NuB
yes i know, I didn't create this app, I just started working on it and they
have several validators for required fields, make sure they are the correct
length, and that some are numeric.
so i need to keep the current flow and existing code and just work with that
is already there.

so i'll research it some more

"Alex D." <al********@hot mail.com> wrote in message
news:ee******** ******@TK2MSFTN GP11.phx.gbl...
I think you should read a little bit about validators...va lidators are not
just for displaying messages, you can use them to keep the user in the page
until all requiered fields (textboxes, radiobuttons, checkboxes, etc..) are
validated. What I was saying in the previous message is that you can just
check your textboxes for a value ex: if ( this.TextBox1.T ext != "" ) {//do
something}

alex.

"NuB" <me@me.com> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
i'm not following;

what happens is this: I have 4 text boxes on my web form to allow a user
to do a search.
If all textboxes are populated a grid with results is populated and
displayed, then if the user
decides to do another search and misses a textbox, the required field
state is missing message is displayed, THEN if
that message is visible I then need to hide the grid from the prior
successful search.


"Alex D." <al********@hot mail.com> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
why dont you just check for the required data in the code?
it seem that you are using the validators for a different purpose, since
your page should not be ablt to postback until all validations are
passed...unless you want to do some extra server-side validation, and
then I think you dont need the validation web controls for that.
Hope that helps.
Alex.
"NuB" <me@me.com> wrote in message
news:O2******** *****@TK2MSFTNG P12.phx.gbl...
The validation controls are giving me a headache. here is what i'm
trying to do and so far what I've tried has not worked.

I need to hide my grid if the page is not valid
how can i accomplish that?

I have one validation control that gives an error if there is no data
returned, so if the page is not valid on another search i need that to
go away. How can i hide and show controls and labels bases on the
page.isvalid

has anyone done this before



Dec 21 '05 #6
ok, I understand.
"NuB" <me@me.com> wrote in message
news:uu******** ********@TK2MSF TNGP10.phx.gbl. ..
yes i know, I didn't create this app, I just started working on it and
they
have several validators for required fields, make sure they are the
correct length, and that some are numeric.
so i need to keep the current flow and existing code and just work with
that is already there.

so i'll research it some more

"Alex D." <al********@hot mail.com> wrote in message
news:ee******** ******@TK2MSFTN GP11.phx.gbl...
I think you should read a little bit about validators...va lidators are not
just for displaying messages, you can use them to keep the user in the
page until all requiered fields (textboxes, radiobuttons, checkboxes,
etc..) are validated. What I was saying in the previous message is that
you can just check your textboxes for a value ex: if ( this.TextBox1.T ext
!= "" ) {//do something}

alex.

"NuB" <me@me.com> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
i'm not following;

what happens is this: I have 4 text boxes on my web form to allow a user
to do a search.
If all textboxes are populated a grid with results is populated and
displayed, then if the user
decides to do another search and misses a textbox, the required field
state is missing message is displayed, THEN if
that message is visible I then need to hide the grid from the prior
successful search.


"Alex D." <al********@hot mail.com> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
why dont you just check for the required data in the code?
it seem that you are using the validators for a different purpose,
since your page should not be ablt to postback until all validations
are passed...unless you want to do some extra server-side validation,
and then I think you dont need the validation web controls for that.
Hope that helps.
Alex.
"NuB" <me@me.com> wrote in message
news:O2******** *****@TK2MSFTNG P12.phx.gbl...
> The validation controls are giving me a headache. here is what i'm
> trying to do and so far what I've tried has not worked.
>
> I need to hide my grid if the page is not valid
> how can i accomplish that?
>
> I have one validation control that gives an error if there is no data
> returned, so if the page is not valid on another search i need that to
> go away. How can i hide and show controls and labels bases on the
> page.isvalid
>
> has anyone done this before
>



Dec 21 '05 #7
NuB
is there anyway to really get the grid.visible = false with using the
validationsumma ry controls, required field control, etc?

"Alex D." <al********@hot mail.com> wrote in message
news:uH******** ******@tk2msftn gp13.phx.gbl...
ok, I understand.
"NuB" <me@me.com> wrote in message
news:uu******** ********@TK2MSF TNGP10.phx.gbl. ..
yes i know, I didn't create this app, I just started working on it and
they
have several validators for required fields, make sure they are the
correct length, and that some are numeric.
so i need to keep the current flow and existing code and just work with
that is already there.

so i'll research it some more

"Alex D." <al********@hot mail.com> wrote in message
news:ee******** ******@TK2MSFTN GP11.phx.gbl...
I think you should read a little bit about validators...va lidators are
not just for displaying messages, you can use them to keep the user in
the page until all requiered fields (textboxes, radiobuttons, checkboxes,
etc..) are validated. What I was saying in the previous message is that
you can just check your textboxes for a value ex: if ( this.TextBox1.T ext
!= "" ) {//do something}

alex.

"NuB" <me@me.com> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
i'm not following;

what happens is this: I have 4 text boxes on my web form to allow a
user to do a search.
If all textboxes are populated a grid with results is populated and
displayed, then if the user
decides to do another search and misses a textbox, the required field
state is missing message is displayed, THEN if
that message is visible I then need to hide the grid from the prior
successful search.


"Alex D." <al********@hot mail.com> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
> why dont you just check for the required data in the code?
> it seem that you are using the validators for a different purpose,
> since your page should not be ablt to postback until all validations
> are passed...unless you want to do some extra server-side validation,
> and then I think you dont need the validation web controls for that.
> Hope that helps.
> Alex.
>
>
> "NuB" <me@me.com> wrote in message
> news:O2******** *****@TK2MSFTNG P12.phx.gbl...
>> The validation controls are giving me a headache. here is what i'm
>> trying to do and so far what I've tried has not worked.
>>
>> I need to hide my grid if the page is not valid
>> how can i accomplish that?
>>
>> I have one validation control that gives an error if there is no data
>> returned, so if the page is not valid on another search i need that
>> to go away. How can i hide and show controls and labels bases on the
>> page.isvalid
>>
>> has anyone done this before
>>
>
>



Dec 21 '05 #8
foreach (Control c in this.Page) { if (c is BaseValidator && !(c as
BaseValidator). EvaluateIsValid ()) this.DataGrid1. Visible = false; }

ALEX.

"NuB" <me@me.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
is there anyway to really get the grid.visible = false with using the
validationsumma ry controls, required field control, etc?

"Alex D." <al********@hot mail.com> wrote in message
news:uH******** ******@tk2msftn gp13.phx.gbl...
ok, I understand.
"NuB" <me@me.com> wrote in message
news:uu******** ********@TK2MSF TNGP10.phx.gbl. ..
yes i know, I didn't create this app, I just started working on it and
they
have several validators for required fields, make sure they are the
correct length, and that some are numeric.
so i need to keep the current flow and existing code and just work with
that is already there.

so i'll research it some more

"Alex D." <al********@hot mail.com> wrote in message
news:ee******** ******@TK2MSFTN GP11.phx.gbl...
I think you should read a little bit about validators...va lidators are
not just for displaying messages, you can use them to keep the user in
the page until all requiered fields (textboxes, radiobuttons,
checkboxe s, etc..) are validated. What I was saying in the previous
message is that you can just check your textboxes for a value ex: if (
this.TextBo x1.Text != "" ) {//do something}

alex.

"NuB" <me@me.com> wrote in message
news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
> i'm not following;
>
> what happens is this: I have 4 text boxes on my web form to allow a
> user to do a search.
> If all textboxes are populated a grid with results is populated and
> displayed, then if the user
> decides to do another search and misses a textbox, the required field
> state is missing message is displayed, THEN if
> that message is visible I then need to hide the grid from the prior
> successful search.
>
>
>
>
> "Alex D." <al********@hot mail.com> wrote in message
> news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
>> why dont you just check for the required data in the code?
>> it seem that you are using the validators for a different purpose,
>> since your page should not be ablt to postback until all validations
>> are passed...unless you want to do some extra server-side validation,
>> and then I think you dont need the validation web controls for that.
>> Hope that helps.
>> Alex.
>>
>>
>> "NuB" <me@me.com> wrote in message
>> news:O2******** *****@TK2MSFTNG P12.phx.gbl...
>>> The validation controls are giving me a headache. here is what i'm
>>> trying to do and so far what I've tried has not worked.
>>>
>>> I need to hide my grid if the page is not valid
>>> how can i accomplish that?
>>>
>>> I have one validation control that gives an error if there is no
>>> data returned, so if the page is not valid on another search i need
>>> that to go away. How can i hide and show controls and labels bases
>>> on the page.isvalid
>>>
>>> has anyone done this before
>>>
>>
>>
>
>



Dec 21 '05 #9
break;
"Alex D." <al********@hot mail.com> wrote in message
news:ur******** ******@TK2MSFTN GP15.phx.gbl...
foreach (Control c in this.Page) { if (c is BaseValidator && !(c as
BaseValidator). EvaluateIsValid ()) this.DataGrid1. Visible = false; }

ALEX.

"NuB" <me@me.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
is there anyway to really get the grid.visible = false with using the
validationsumma ry controls, required field control, etc?

"Alex D." <al********@hot mail.com> wrote in message
news:uH******** ******@tk2msftn gp13.phx.gbl...
ok, I understand.
"NuB" <me@me.com> wrote in message
news:uu******** ********@TK2MSF TNGP10.phx.gbl. ..
yes i know, I didn't create this app, I just started working on it and
they
have several validators for required fields, make sure they are the
correct length, and that some are numeric.
so i need to keep the current flow and existing code and just work with
that is already there.

so i'll research it some more

"Alex D." <al********@hot mail.com> wrote in message
news:ee******** ******@TK2MSFTN GP11.phx.gbl...
>I think you should read a little bit about validators...va lidators are
>not just for displaying messages, you can use them to keep the user in
>the page until all requiered fields (textboxes, radiobuttons,
>checkboxes , etc..) are validated. What I was saying in the previous
>message is that you can just check your textboxes for a value ex: if
>( this.TextBox1.T ext != "" ) {//do something}
>
> alex.
>
>
>
> "NuB" <me@me.com> wrote in message
> news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
>> i'm not following;
>>
>> what happens is this: I have 4 text boxes on my web form to allow a
>> user to do a search.
>> If all textboxes are populated a grid with results is populated and
>> displayed, then if the user
>> decides to do another search and misses a textbox, the required field
>> state is missing message is displayed, THEN if
>> that message is visible I then need to hide the grid from the prior
>> successful search.
>>
>>
>>
>>
>> "Alex D." <al********@hot mail.com> wrote in message
>> news:%2******** *******@TK2MSFT NGP12.phx.gbl.. .
>>> why dont you just check for the required data in the code?
>>> it seem that you are using the validators for a different purpose,
>>> since your page should not be ablt to postback until all validations
>>> are passed...unless you want to do some extra server-side
>>> validation, and then I think you dont need the validation web
>>> controls for that.
>>> Hope that helps.
>>> Alex.
>>>
>>>
>>> "NuB" <me@me.com> wrote in message
>>> news:O2******** *****@TK2MSFTNG P12.phx.gbl...
>>>> The validation controls are giving me a headache. here is what i'm
>>>> trying to do and so far what I've tried has not worked.
>>>>
>>>> I need to hide my grid if the page is not valid
>>>> how can i accomplish that?
>>>>
>>>> I have one validation control that gives an error if there is no
>>>> data returned, so if the page is not valid on another search i need
>>>> that to go away. How can i hide and show controls and labels bases
>>>> on the page.isvalid
>>>>
>>>> has anyone done this before
>>>>
>>>
>>>
>>
>>
>
>



Dec 21 '05 #10

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

Similar topics

6
2518
by: Kenneth | last post by:
Hello, I'm having some serious problems debugging a script that I'm trying to make work. I'm working on a form where a user can type in a time (in the format of HH:MM), and another script automatically calculate how much time is inbetween. That part of it is working fine, but what ISN'T working fine is the script that validates whether or not the user has entered the time in proper syntax, and to make sure that the Time In does not...
4
2627
by: Tim Meagher | last post by:
I am trying to use both validation controls and to add submit button attributes, but when I add the button attributes, the javascript fpr the validation controls is no longer created for the page. How can I use both? Thank you, Tim Meagher
6
3709
by: Nedu N | last post by:
Hi, I want to have confirmation(Yes/No) on a button of the webform in which there are many validation controls. I want all the validation controls to be triggered first and then Yes/No confirmation message. By adding just an confirm attribute for 'onclick' event of the button doesn't work with validation controls. Is there any short way to go around this. Thanks Nedu
7
2874
by: A.M | last post by:
Hi, I have a validation control in my page that upon any invalid data, it disables all buttons in the page. basicly i don't have any postback in the page if the validator finds any error. How can have the validator just disable certain control's postback and other part of page continue their functionality. Thanks,
14
6310
by: Matt | last post by:
I want to know if ASP.NET Web Forms Validation Controls are Server-Side or Client-Side form validation? Since I think each validator control can select either 1) JavaScript based error dialog or 2) show the error message next to the control. For example, if the text field is empty with RequiredField Validator control, it can show the value in ControlToValidate property in two ways as I mentioned. Please advise. Thanks!
2
4002
by: Martyn Fewtrell | last post by:
Dear All I have a Windows 2003 Server with IIS6 where the validation controls on ASP.Net pages no longer work. I believe it to be specific to the server as if I create an ASP.Net page on the IIS Server of my Workstation (Win XP) with a text box, button and required field validator, this works fine. If I create the same page on the IIS6 Windows 2003 Server the validation control doesn't stop the post. I've tried different browsers and...
2
3734
by: Barbara Alderton | last post by:
I setup some standard Required Field Validation controls and one Custom validation control on an ASP.NET page (within a user control) to validate text entry. I also setup a Summary Control to post all the messages to a message box (ShowMessageBox=true). The required field validation error messages show up in the summary just fine but I can't get the custom validation message to show up if invalid. So far I have the summary control...
9
2227
by: AFN | last post by:
I was just dropped into someone else's code (isn't that always so fun?). I can't figure out why a custom validation control's server event function is executing. There is nothing (that I see) in page_load, or elsewhere, that says page.validate, no control says "causesvalidation=true", and the AutoEventWireup is set to false. So I would think that the control's server event function would NOT execute, but it does execute right after...
2
6710
by: Tim Frawley | last post by:
Source code attached indicates my problem with validation and a button bar save button. Fill the Textbox with some text then tab off the control. The message box will display the text in the textbox from the Validating event. Now put the focus back on the textbox click the button bar button. Nothing happens. The form causes validation is true, so is the button bar and the control.
0
9482
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...
1
9878
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
9728
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...
1
7282
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
6551
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5322
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3827
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
3
2694
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.