WebUIValidation.js

H

Haz

I am building a web custom control and I need to make sure that the file
/aspnet_client/system_web/{framework version'/WebUIValidation.js'
is included in the page.
Is there any way to force the page to make sure that it is included?

Thanks in advance....
 
A

Alvin Bruney [MVP]

the only way i know of is to go probe the directory with code to find the
file on initialization
 
S

Scott Mitchell [MVP]

Alvin said:
the only way i know of is to go probe the directory with code to find the
file on initialization

Alvin, I think Haz is wanting to know if he can programmatically
determine whether or not that JavaScript reference was added in the page
- not whether the file exists on the Web server's filesystem or not.

I assume he is wanting to have his custom control call one of the
client-side functions in WebUIValidation.js

--

Scott Mitchell
(e-mail address removed)
http://www.4GuysFromRolla.com

* When you think ASP.NET, think 4GuysFromRolla.com!
 
H

Hazim Dikenli

'inner wrapper BaseValidator class
Private Class DummyValidator
Inherits BaseValidator
Protected Overrides Function EvaluateIsValid() As Boolean
Return True
End Function
Public Sub RegisterScript()
RegisterValidatorCommonScript()
End Sub
End Class

'override the control's prerender function
Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs)
Dim aDummyValidator As New DummyValidator()
Dim text1 As New WebControls.TextBox()
text1.ID = "text1234349"
text1.visible=false
Me.Controls.Add(text1)
aDummyValidator.ControlToValidate = text1.ID
Me.Controls.Add(aDummyValidator)
aDummyValidator.RegisterScript()
End Sub
 

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
474,142
Messages
2,570,818
Members
47,362
Latest member
eitamoro

Latest Threads

Top