No Validation

T

tshad

I have a page that has no Validation objects, but I also have the following
code:

if not Page.IsValid
exit sub
end if

For some reason, the page is hitting the "exit sub" statement?

How can that be? What else would invalidate a page and how can I find out
what caused it to be invalid?

Thanks,

Tom
 
G

Guest

FROM THE HELP FILE:
(Read Property Value and Remarks to see why you have your issue)
-----------------------------------------------------------------------------
Page.IsValid Property
Gets a value indicating whether page validation succeeded.

[Visual Basic]
Public ReadOnly Property IsValid As Boolean

[C#]
public bool IsValid {get;}

[C++]
public: __property bool get_IsValid();

[JScript]
public function get IsValid() : Boolean;

Property Value
true if page validation succeeded; otherwise, false.

Remarks
For this property to return true, all validation server controls in the
Page.Validators property must validate successfully. You should check this
property only after you have called the Page.Validate method, or set the
CausesValidation property to true in the OnServerClick handler for an ASP.NET
server control that initiates form processing. These server controls include
the Button, HtmlButton, HtmlInputButton, HtmlInputImage, ImageButton, and
LinkButton classes.

---------------------------------------------

The default is fail. That is why your exit works. Best advice: Do not
include validation when there is none on the page.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
T

tshad

Cowboy (Gregory A. Beamer) - MVP said:
FROM THE HELP FILE:
(Read Property Value and Remarks to see why you have your issue)
-------------------------------------------------------------------------- ---
Page.IsValid Property
Gets a value indicating whether page validation succeeded.

[Visual Basic]
Public ReadOnly Property IsValid As Boolean

[C#]
public bool IsValid {get;}

[C++]
public: __property bool get_IsValid();

[JScript]
public function get IsValid() : Boolean;

Property Value
true if page validation succeeded; otherwise, false.

Remarks
For this property to return true, all validation server controls in the
Page.Validators property must validate successfully. You should check this
property only after you have called the Page.Validate method, or set the
CausesValidation property to true in the OnServerClick handler for an ASP.NET
server control that initiates form processing. These server controls include
the Button, HtmlButton, HtmlInputButton, HtmlInputImage, ImageButton, and
LinkButton classes.

That would make sense.

Thanks,

Tom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top