M
mitdej
Hi,
I'm building a user control with two buttons and a FileUpload control
for oploading/downloading files.
I've created 3 properties for keeping information about a file
(content, name and mime type) as bindable properties.
I'm calling explicit DataBind() in the Page_Load event of the hosting
control of my user control.
When the button is clicked, first the Page_Load event of the hosting
page is fired, the binding is happening then the Page_Load event of
the user control is fired. Until now everithing is OK.
The problem is when event handler for the button click is executing.
It seems like the execution of the event is running in a new object
instance of the user control.
This means that all the bound properties are lost.
So the question is: Is there a way to forbid the creation of a new
object of the user control.
Thanks in advance,
mitdej
I'm building a user control with two buttons and a FileUpload control
for oploading/downloading files.
I've created 3 properties for keeping information about a file
(content, name and mime type) as bindable properties.
I'm calling explicit DataBind() in the Page_Load event of the hosting
control of my user control.
When the button is clicked, first the Page_Load event of the hosting
page is fired, the binding is happening then the Page_Load event of
the user control is fired. Until now everithing is OK.
The problem is when event handler for the button click is executing.
It seems like the execution of the event is running in a new object
instance of the user control.
This means that all the bound properties are lost.
So the question is: Is there a way to forbid the creation of a new
object of the user control.
Thanks in advance,
mitdej