473,769 Members | 2,062 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
12 1350
NuB
would that go in the page load or my button click method?
"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 #11
in the page load..I guess

"NuB" <me@me.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
would that go in the page load or my button click method?
"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,
>>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.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 #12
I think there should be a way to execute validation code on server
side. So whenever you post your server side validation executed and
based on the result of validation you can show hide your grid.

Correct me if I am wrong.

B

Dec 22 '05 #13

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

Similar topics

6
2519
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
2629
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
2875
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
4004
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
3736
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
2229
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
10215
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10049
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9865
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...
0
8872
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
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
5307
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
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3964
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
2
3564
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.