M
max_weinland
Hello,
the following short ASP.NET 2.0 page fails with error "Failed to load
viewstate".
Can someone please tell me why?
To reproduce the error, click the button, then click "Cancel", then
click the button again.
Thank you,
Max Weinland.
<%@ Page Language="C#" %>
<script runat="server">
protected void DetailsView1_ModeChanging(object sender,
DetailsViewModeEventArgs e)
{
MultiView1.ActiveViewIndex = 0;
}
protected void Button1_Click(object sender, EventArgs e)
{
DetailsView1.ChangeMode(DetailsViewMode.Edit);
MultiView1.ActiveViewIndex = 1;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<body>
<form id="form1" runat="server">
<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
<asp:View ID="View1" runat="server">
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click"
Text="Button" />
</asp:View>
<asp:View ID="View2" runat="server">
<aspetailsView ID="DetailsView1" runat="server"
AutoGenerateRows="False"
DataSourceID="XmlDataSource1"
OnModeChanging="DetailsView1_ModeChanging"
AutoGenerateEditButton="True">
<Fields>
<asp:TemplateField>
<EditItemTemplate>
<aspropDownList ID="DropDownList1" runat="server" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Fields>
</aspetailsView>
<asp:XmlDataSource ID="XmlDataSource1" runat="server">
<Data><Table><Row></Row></Table></Data>
</asp:XmlDataSource>
</asp:View>
</asp:MultiView>
</form>
</body>
</html>
the following short ASP.NET 2.0 page fails with error "Failed to load
viewstate".
Can someone please tell me why?
To reproduce the error, click the button, then click "Cancel", then
click the button again.
Thank you,
Max Weinland.
<%@ Page Language="C#" %>
<script runat="server">
protected void DetailsView1_ModeChanging(object sender,
DetailsViewModeEventArgs e)
{
MultiView1.ActiveViewIndex = 0;
}
protected void Button1_Click(object sender, EventArgs e)
{
DetailsView1.ChangeMode(DetailsViewMode.Edit);
MultiView1.ActiveViewIndex = 1;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<body>
<form id="form1" runat="server">
<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
<asp:View ID="View1" runat="server">
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click"
Text="Button" />
</asp:View>
<asp:View ID="View2" runat="server">
<aspetailsView ID="DetailsView1" runat="server"
AutoGenerateRows="False"
DataSourceID="XmlDataSource1"
OnModeChanging="DetailsView1_ModeChanging"
AutoGenerateEditButton="True">
<Fields>
<asp:TemplateField>
<EditItemTemplate>
<aspropDownList ID="DropDownList1" runat="server" />
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Fields>
</aspetailsView>
<asp:XmlDataSource ID="XmlDataSource1" runat="server">
<Data><Table><Row></Row></Table></Data>
</asp:XmlDataSource>
</asp:View>
</asp:MultiView>
</form>
</body>
</html>