Validating in a web user control

The checkbox control is functional in Word 2010 only.

Note: The illustrations in this tips page may or may not reflect that actual appearance or arrangement of the content controls contained in the demonstration document that you can download using the link at the end of this tips page.

While the built-in Document_Content Control On Enter and Document_Content Control On Exit events have improved with the release of Word2010, there remains a persistent bug in the Word2007 On Exit event.

Using this method, you can avoid that bug and any text or changes that your document users make in content controls can be evaluated and processed in real time, thus eliminating the need for the document user to first "exit" a content control.

The control validates only server-side, not client-side. Text = value End Set End Property End Class I have a Required Field Validator on the same web page as my user control.

The html source for my page contains the following: I cannot get a web user control to validation client-side using a required field validator. I put the user control's id in the Control To Validate property of the validator (please note that I must type it in, it doesn't show up in the dropdown list). User Control Public Property Text() As String Get Return Text Box1.

Each of the content controls is locked to prevent deletion.

The control validates only server-side, not client-side. I have a public Text property defined below: _ Partial Class My Web User Control Inherits System. Text End Get Set(By Val value As String) Text Box1.

The html source for my page contains the following: I tried this already and I get a "Unable to find control id 'Web User Control1_Text Box1' referenced by the 'Control To Validate' property of 'Required Field Validator1'" error, even when I expose the textbox in my user control as a property. Text = value End Set End Property End Class I have a Required Field Validator on the same web page as my user control.

I would also like to mention and offer my appreciation to two regular contributors in the Microsoft Answers forum; "Hans V" and Andreas Killer.

The pseudonym is all I have in the case of Hans V, but both assisted in this effort with solutions to several nagging problems in the code.

Leave a Reply