|
-
Jul 20th, 2005, 07:52 AM
#1
Re: how to perform validation on textbox in templatecolumn of datagrid?
OK, a few changes to what I said.
Instead of
validator.ControlToValidate = txtbox.ClientID
put
validator.ControlToValidate = txtbox
That should do it.
Btw, you never said what the error was, but try what I just said right now.
-
Jul 20th, 2005, 09:00 AM
#2
I wonder how many charact
Re: how to perform validation on textbox in templatecolumn of datagrid?
That won't work - the ControlToValidate property expects a string, not a control class object.
You never stated what the error was, but you need the UniqueID property.
validator.ControlToValidate = txtbox.UniqueID.
-
Jul 20th, 2005, 09:28 AM
#3
Thread Starter
Junior Member
Re: how to perform validation on textbox in templatecolumn of datagrid?
The error is
Code:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 613: txtbox = CType(e.Item.FindControl("textbox"), System.Web.UI.WebControls.TextBox)
Line 614:
Line 615: validator.ControlToValidate = txtbox.UniqueID
-
Jul 20th, 2005, 10:39 AM
#4
Re: how to perform validation on textbox in templatecolumn of datagrid?
 Originally Posted by nemaroller
That won't work - the ControlToValidate property expects a string, not a control class object.
You never stated what the error was, but you need the UniqueID property.
validator.ControlToValidate = txtbox.UniqueID.
My bad, but not-so-bad, I had no IDE and Intellisense
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|