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?

Who is Participating?
allanau20Connect With a Mentor Commented:

Passing Values between User Controls and ASPX Page

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.

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!!!
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="" id="ImageUploader" name="ImageUploader" VIEWASTEXT>

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

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
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.