Viewstate Work-Around?
Hello,
I am aware of the viewstate issue and am wondering if there is a workaround of some type?
My requirements need me to create pages in Sitefinity (by whatever means) with both a horizontal menu across the top, and a vertical menu on the left.
In the main content pane is where I will put my custom user controls created in visual studio, but these will obviously need view state, so I can't use the layout mode in Sitefinity, and master pages won't work either.
Thanks
Hello,
You can try using session or cookies to get/set some values.
Regards,
Ivan Dimitrov
the Telerik team
Is this going to be fixed in Q1?
I databind a dropdown in the Page_Load event and when the Button_Click event fires, I don't have a value in the dropdown any more.
I suppose with some JavaScript I could add get this to work with cookies, but that'd be pretty clunky.
Hello Eric,
Yes, the view state will be fixed in Q1.
On the other hand, you cannot persist dropdown values in a viewstate automatically even on a regular asp.net page. The drop down is a composite control with list items as child controls, so you should have a custom logic for persisting their values.
I'll defer to you as the ASP.NET expert, but I have code something like this. On the button click event in a normal ASPX page, the dropdownlist has a selected value. On the button click event on a SF page, the dropdownlist has a selected value. On the button click event on a SF page where the control is inside a column layout, the dropdownlist has no selected value (or any values).
protected void Page_Load(object sender, EventArgs e)
if (!IsPostback)
myDropDownList.DataSource = Enumerable.Range(0, 10);
myDropDownList.DataBind();
protected void myButton_Click(object sender, EventArgs e)