Web userControl

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi to all
i have a web user control mycontrol.ascx and a form myform.aspx
when i fire some events in myform.aspx i load mycontrol in a frame i that
form
i want to get some property of that control how ??
thanks
 
Hi, Sara.

Code in aspx-page could be something like:

Code
-------------------

Dim oCtrl as myControl
Dim sName as String

oCtrl = CType(Page.Controls.FindControls("MyControlName"), myControl)
sName = oCtrl.Name

Code
-------------------


Sorry if the Page.Controls... -line has incorrect syntax, but I don't
have VS in this machine :( so this was written only by memory..

-tom-

*Hi to all
i have a web user control mycontrol.ascx and a form myform.aspx
when i fire some events in myform.aspx i load mycontrol in
frame i that
form
i want to get some property of that control how ??
thanks *


-
tomBon
 
Hi,
I'me not sure I have correctly understood the question but, this is waht I
hope you mean. How to get properties of my web user control from thweb form
in which I have instancied it ?

If I'me right, you can also declare the web user control in the declaration
block of your webform cade - behind page like this:

protected GlobalOTT.usc.Calendrier2 clFinUtilisation;

where GlobalOTT.usc is my web user control definition class namespace and
Calendrier2 the web user control class name.

After doing this you can acces to any public property of the web user
control from the webform
 

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

Back
Top