viewstate of dropdown
-
Hi all, I am creating dynamic dropdownlist in my webpage. Now on postback is it possible to get viewstate of this dynamically created dropdownlist in Page_Load methode? Thanks, Priyank
-
Hi all, I am creating dynamic dropdownlist in my webpage. Now on postback is it possible to get viewstate of this dynamically created dropdownlist in Page_Load methode? Thanks, Priyank
Yes.
SSK.
-
Yes.
SSK.
Thanks, But how can I get it? only thing I have is ID of the dropdownlist at that time. Priyank
-
Hi all, I am creating dynamic dropdownlist in my webpage. Now on postback is it possible to get viewstate of this dynamically created dropdownlist in Page_Load methode? Thanks, Priyank
priyank_ldce wrote:
I am creating dynamic dropdownlist in my webpage.
Are you using a content place holder ?
priyank_ldce wrote:
Now on postback is it possible to get viewstate of this dynamically created dropdownlist in Page_Load methode?
Viewstates will be loaded before
page_load
fires. Getting viewstate depends on where you are creating dynamic control. If it is inpage_load
or any other events fired afterInit()
, it won't be maintained. If ASP.NET want to maintain viewstate for your dynamic control, create it onInit()
event.
-
priyank_ldce wrote:
I am creating dynamic dropdownlist in my webpage.
Are you using a content place holder ?
priyank_ldce wrote:
Now on postback is it possible to get viewstate of this dynamically created dropdownlist in Page_Load methode?
Viewstates will be loaded before
page_load
fires. Getting viewstate depends on where you are creating dynamic control. If it is inpage_load
or any other events fired afterInit()
, it won't be maintained. If ASP.NET want to maintain viewstate for your dynamic control, create it onInit()
event.
N a v a n e e t h wrote:
Are you using a content place holder ?
Yes I am using content place holder.
N a v a n e e t h wrote:
Viewstates will be loaded before page_load fires. Getting viewstate depends on where you are creating dynamic control. If it is in page_load or any other events fired after Init(), it won't be maintained. If ASP.NET want to maintain viewstate for your dynamic control, create it on Init() event.
I am creating dropdownlist on Page_load event. I want to use value of this dropdownlist for other control in Page_load event.
-
N a v a n e e t h wrote:
Are you using a content place holder ?
Yes I am using content place holder.
N a v a n e e t h wrote:
Viewstates will be loaded before page_load fires. Getting viewstate depends on where you are creating dynamic control. If it is in page_load or any other events fired after Init(), it won't be maintained. If ASP.NET want to maintain viewstate for your dynamic control, create it on Init() event.
I am creating dropdownlist on Page_load event. I want to use value of this dropdownlist for other control in Page_load event.
priyank_ldce wrote:
Yes I am using content place holder.
Well, if you are using Content place holder, then what is the issue ?
FindControl()
is not working for you ?