Hi guys!!!!!!!!!
Can anyone help me out in this. I have .ascx file with one
textbox control in it. I am using it in my .aspx file. What happens is
i am giving the id of textbox control in ascx as ID="text1" when i try
to view the source once the page is loaded i can see the id as
"ctl4_text1". why is that. I need the Id because i need to do
validations for that control
can someone help me in this!!!!!!!!!!!
thanks
dharani pattabiPattabi wrote:
> Hi guys!!!!!!!!!
> Can anyone help me out in this. I have .ascx file with one
> textbox control in it. I am using it in my .aspx file. What happens is
> i am giving the id of textbox control in ascx as ID="text1" when i try
> to view the source once the page is loaded i can see the id as
> "ctl4_text1". why is that. I need the Id because i need to do
> validations for that control
> can someone help me in this!!!!!!!!!!!
> thanks
> dharani pattabi
Pattabi,
would you be doing server or client side validation?
Jonel
Hi jonel,
thanks for immediate response. I need to do serverside valiation
using
validationcontrols
<asp:comparevalidator...requiredvalidator
since the id is changed during the load, the controls is not getting
validated.
waiting for your response
thanks
dharni
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Dharani,
the problem you are facing is that you have wrapped your text control in a
custom user control,
therefore the control gets renamed to "ctl4_text1", where ctl4 is the id of
your user control.
This is to allow for multiple instances of the same user control on the same
page without naming
collisions (since forms send back in http in key-value-pairs).
VS.Net does not support your approach and I haven't found a solution for
your problem.
I tried dynamically setting the controlToValidate in the validator, but it
only takes a string value
(otherwise you could have looked up the text control using FindControl())
Let me know if you found a solution
Good luck
Stefan
"Dharani Ravindran" <dpattabi@.saipeople.com> wrote in message
news:OLfBLNusDHA.2456@.TK2MSFTNGP12.phx.gbl...
>
> Hi jonel,
> thanks for immediate response. I need to do serverside valiation
> using
> validationcontrols
> <asp:comparevalidator...requiredvalidator
> since the id is changed during the load, the controls is not getting
> validated.
> waiting for your response
> thanks
> dharni
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
Dharani,
the problem you are facing is that you have wrapped your text control in a
custom user control,
therefore the control gets renamed to "ctl4_text1", where ctl4 is the id of
your user control.
This is to allow for multiple instances of the same user control on the same
page without naming
collisions (since forms send back in http in key-value-pairs).
VS.Net does not support your approach and I haven't found a solution for
your problem.
I tried dynamically setting the controlToValidate in the validator, but it
only takes a string value
(otherwise you could have looked up the text control using FindControl())
Let me know if you found a solution
Good luck
Stefan
"Dharani Ravindran" <dpattabi@.saipeople.com> wrote in message
news:OLfBLNusDHA.2456@.TK2MSFTNGP12.phx.gbl...
>
> Hi jonel,
> thanks for immediate response. I need to do serverside valiation
> using
> validationcontrols
> <asp:comparevalidator...requiredvalidator
> since the id is changed during the load, the controls is not getting
> validated.
> waiting for your response
> thanks
> dharni
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment