asp.net - Property from a custom UserControl that is saved in viewstate loses its value -
I have a custom control in the ASPX page in which size is the property named
public int Size {get {return Convert.ToInt32 (viewstate ["Creative Size"]); } Set {ViewState ["Creative Size"] = Value; }}
This property is set for a value in the aspx page, which tells 500 during a postback, through a button control which is in the page (not in the custom control) is.
I also have a button inside the custom control that raises a postback like this
secure void btnUpload_Click (object sender, EventArgs e) {if (fuBannerfile. HasFile) if (FuBannerfile.FileContent.Length / 1024> this size.); // code is not important here
When this event is called "this.Size" property 0. I also viewed during debugging of page's page_load, if I like this I use the property of:
int size = customControlId.Size;
The property is set to 500. But then when the debugger reaches the incident within control then the asset is 0.
Why is this happening to any idea, or what can happen?
Just got to know what the problem is.
I have only one control in the same page, and I have set the property of the size of the wrong control ....
I wish I had 2 Lost the hour
Comments
Post a Comment