Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

How to pass value of a variable from one usercontrol to another usercontrol. for example: I have 2 usercontrols UC1.ascx, UC2.ascx and both ascx are registered and called in one aspx page. UC1 have a public variable (pubVariable1) and a button. UC2 has a public variable (pubVaraible2) and a public function (pubFunction).

 

How to pass value of pubVariable1 to pubVariable2 on a click event of a button in UC1. Note: button and pubVariable are in UC1?

Note: I think as a programmer not as a human, so use my answer at your will
Posted

You could add a public property to each usercontrol. This allows you to see and set the property. You could then say:

 

uc1.pubVariable1 = uc2.pubVariable2

rustyd
Posted
I tried but i can see the value is moving in the debug mode but when i run without debug mode the value is still the same.
Note: I think as a programmer not as a human, so use my answer at your will

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...