|
Rank: Advanced Member Groups: Member
Joined: 8/25/2007 Posts: 34
|
I have used previous versions of AspxLabs for well over a year now, and have been very happy with their performance so I upgraded to the newer version in order to use them in more sites. Using almost identical technique I am getting errors in this page. The error is below:
Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.
Here is the code to drive the Tabstrip: (using tabitem = EO.Web;)
if (!Page.IsPostBack) { start_Date.SelectedDate = DateTime.Now.AddDays(-15); end_date.SelectedDate = DateTime.Now.AddDays(-2); //started = DateTime.Now.AddMonths(-2); tabitem.TabItem tab1 = new EO.Web.TabItem(); tab1.Text.Html = DateTime.Now.AddMonths(-1).ToString("MMMM"); tab1.Value = "1"; TabStrip1.Items.Add(tab1); tab1 = new tabitem.TabItem(); tab1.Text.Html = DateTime.Now.AddMonths(0).ToString("MMMM"); tab1.Value = "2"; TabStrip1.Items.Add(tab1); tab1 = new tabitem.TabItem(); tab1.Text.Html = DateTime.Now.AddMonths(1).ToString("MMMM"); tab1.Value = "3"; TabStrip1.Items.Add(tab1); int tester = DateTime.Now.AddMonths(2).Day; if (DateTime.Now.AddMonths(2).Day > 16) { tab1 = new tabitem.TabItem(); tab1.Text.Html = DateTime.Now.AddMonths(2).ToString("MMMM"); tab1.Value = "4"; TabStrip1.Items.Add(tab1); } tab1 = new tabitem.TabItem(); tab1.Text.Html = "By Date Range"; tab1.Value = "5"; TabStrip1.Items.Add(tab1); tab1 = new tabitem.TabItem(); tab1.Text.Html = "Overdue Inventory"; tab1.Value = "6"; TabStrip1.Items.Add(tab1); tab1 = new tabitem.TabItem(); tab1 = TabStrip1.Items[0]; //TabStrip1.Items[0].Selected = true; //TabStrip1.Items[0].RaisesServerEvent = false; //TabStrip1.Items[0].Disabled = true; DropDownList1.AppendDataBoundItems = true; ListItem item = new ListItem(); item.Text = "All Locations"; item.Selected = true; item.Value = "%"; DropDownList1.Items.Add(item); SqlCommand cmd = new SqlCommand("stv_locations_ma", connection); cmd.CommandType = CommandType.StoredProcedure; DataTable objtb = new DataTable(); cmd.CommandTimeout = 10000; try { connection.Open(); SqlDataAdapter adapter = new SqlDataAdapter(cmd); adapter.Fill(objtb); connection.Close(); DropDownList1.DataSource = objtb; DropDownList1.DataTextField = "locshort"; DropDownList1.DataValueField = "locid"; DropDownList1.DataBind(); } catch (Exception ex) { Response.Write(ex.Message); connection.Close(); } }
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
I ran your code and it works fine at here without causing any errors. The only thing that I changed is to remove DropDownList1 and the code that fills it from the DB. Can you try that and see if it works?
Thanks
|
|
Rank: Advanced Member Groups: Member
Joined: 8/25/2007 Posts: 34
|
It doesn't error out until I click a tab item, then I get that message, here is my aspx page:
<eo:TabStrip ID="TabStrip1" runat="server" ControlSkinID="None" OnItemClick="tab_click" RaisesServerEvent="True"> <LookItems> <eo:TabItem Height="21" HoverStyle-CssText="position: relative; top: 2px; background-image: url(00010502); background-repeat: repeat-x" ItemID="_Default" LeftIcon-HoverUrl="00010506" LeftIcon-SelectedUrl="00010508" LeftIcon-Url="00010504" NormalStyle-CssText="position: relative; top: 2px; background-image: url(00010501); background-repeat: repeat-x" RightIcon-HoverUrl="00010507" RightIcon-SelectedUrl="00010509" RightIcon-Url="00010505" SelectedStyle-CssText="background-image: url(00010503); background-repeat: repeat-x" Text-Padding-Bottom="2" Text-Padding-Top="1"> <SubGroup ItemSpacing="1" Style-CssText="background-image:url(00010510);background-position-y:bottom;background-repeat:repeat-x;color:black;cursor:hand;font-family:'Microsoft Sans Serif',Verdana;font-size:8.25pt;"> </SubGroup> </eo:TabItem> </LookItems> <TopGroup> <Items> <eo:TabItem Disabled="True" Selected="True" Text-Html="Select Pay Period or Option --->"> </eo:TabItem> </Items> </TopGroup> </eo:TabStrip>
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
We reproduced the error. Please give us a few moments to dig into it. We will update you as soon as we find anything.
Thanks
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
We've posted a new build that addressed this problem. Please see your private message for download location.
Thanks
|
|