How to pass Parameter to a Web User Control?

A would like to develop a Web User Control that will handle a data insert/update process. So, my control needs to know when it will attempt to insert data and when it should modify data. So, is there anyway to pass some parameters to my WebUserControl to inform it whitch operation should it perform?

Thanks!
regisdanielAsked:
Who is Participating?
 
allanau20Connect With a Mentor Commented:

Passing Values between User Controls and ASPX Page

http://www.c-sharpcorner.com/Code/2005/Jan/PassingValuesfrmUCtoASPX.asp

HtH.
0
 
cyberdevil67Commented:
Hi regisdaniel,

 Yep use the <param name="Layout" value="ThreePanes"> of the <object> and just use a normal property get/set method for this param name.

Cheers!
0
 
regisdanielAuthor Commented:
Thanks cyberdevil67!!!

But, I'm newbie to ASP.Net. Could you please give me a more complete example of how doing this?

Thanls a lot!!!
0
 
cyberdevil67Connect With a Mentor Commented:
Any control in a website mus be used with object in html..

             <object type="application/x-oleobject"
                  classid="clsid:A18962F6-E6ED-40B1-97C9-1FB36F38BFA8" width="600" height="500"
                  CodeBase="ImageUploader3.cab" id="ImageUploader" name="ImageUploader" VIEWASTEXT>

                  <param name="Layout" value="ThreePanes">
                                  </object>

Then just as I said in your code, write a get/set method to use this, there are plent of these examples of using set/get ini your MSDN if you installed that.

Or use the example from here

http://blogs.msdn.com/robgruen/archive/2004/06/15/156348.aspx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.