Passing data to user control in a view

P

paul

I have a user control that uses some javascript to fire a popup which
is used for a date picker. The textbox (and the button that fires the
popup box) needing to get the date is in a user control which reside
in the view of a multiview on a .aspx page. I tried wiring it up with
an html input but I can't use the <form> tag on the control (runtime
error for to many <form> tags since the aspx page has one). So I'm
trying to figure out a way to get the date into the control when the
pop up window is closed or even when the date is clicked. Can anybody
help? I'm using VS 2005 and asp.net 2.0 Thanks. I've been searching
google but haven't found an option.


paul
 
N

Neutrino

One of the problems usually is that the name of the control generated
by ASP.NET when it is rendered the HTML to the client (browser) is not
the same name that your control has in the ASP.NET page or user
control. You must use the ClientID property of the ASP.NET server
control when creating your JavaScript. You will need to dynamically
generate the JavaScript statement in order to replace the controls name
with the output of the ClientID property.

More info here:
http://msdn2.microsoft.com/en-US/library/system.web.ui.control.clientid.aspx
 

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,755
Messages
2,569,537
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top