passing value from user control to webform
-
hi, I recently asked the question, of how to pass a value FROM webform TO usercontrol, I figured this out with help from mike ellison(Cheers!), but now i need to pass a value FROM usercontrol TO webform?? I've tried reversing the technique i used before but that doesnt work. I have a usercontrol which allows people to enter their address details, but becuase i have different usercontrols that are called from a dropdownlist, I have a button on the webform, the button should READ the details entered into the user control and then pass to database. Button code is fine apart from I am unable to Pass the details entered into the usercontrol to the webform....any ideas people! Thanks in advance. jetset
-
hi, I recently asked the question, of how to pass a value FROM webform TO usercontrol, I figured this out with help from mike ellison(Cheers!), but now i need to pass a value FROM usercontrol TO webform?? I've tried reversing the technique i used before but that doesnt work. I have a usercontrol which allows people to enter their address details, but becuase i have different usercontrols that are called from a dropdownlist, I have a button on the webform, the button should READ the details entered into the user control and then pass to database. Button code is fine apart from I am unable to Pass the details entered into the usercontrol to the webform....any ideas people! Thanks in advance. jetset
One way to do this is to provide public properties to your user control. In my controls, I would supply a property for setting or getting the address. This way, your form that hosts the control can set or get that information. If you need any help on this, let me know and I will provide some code showing how this can be done.