Bug 43033 - Button causes System.InvalidCast Exception
Summary: Button causes System.InvalidCast Exception
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Web (show other bugs)
Version: 4.4.0 (C7)
Hardware: Other Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-08-03 17:39 UTC by martin.schlobach
Modified: 2016-08-03 17:43 UTC (History)
2 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description martin.schlobach 2016-08-03 17:39:39 UTC
The following error happen while push a button:

System.InvalidCastException
Specified cast is not valid.

Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object): System.Web.
Exception stack trace:
  at System.Web.UI.StateBag.LoadViewState (System.Object savedState) <0xb2e3a560 + 0x00045> in <filename unknown>:0 
  at System.Web.UI.Control.LoadViewState (System.Object savedState) <0xb2e3a368 + 0x00033> in <filename unknown>:0 
  at System.Web.UI.Control.LoadViewStateRecursive (System.Object savedState) <0xb2e39dc0 + 0x000dd> in <filename unknown>:0 
  at System.Web.UI.Control.LoadViewStateRecursive (System.Object savedState) <0xb2e39dc0 + 0x0046f> in <filename unknown>:0 
  at System.Web.UI.Control.LoadViewStateRecursive (System.Object savedState) <0xb2e39dc0 + 0x0046f> in <filename unknown>:0 
  at System.Web.UI.Control.LoadViewStateRecursive (System.Object savedState) <0xb2e39dc0 + 0x0046f> in <filename unknown>:0 
  at System.Web.UI.Control.LoadViewStateRecursive (System.Object savedState) <0xb2e39dc0 + 0x0046f> in <filename unknown>:0 
  at System.Web.UI.Control.LoadViewStateRecursive (System.Object savedState) <0xb2e39dc0 + 0x0046f> in <filename unknown>:0 
  at System.Web.UI.Page.LoadPageViewState () <0xb2e39388 + 0x000af> in <filename unknown>:0 
  at System.Web.UI.Page.RestorePageState () <0xb3044338 + 0x0008f> in <filename unknown>:0 
  at System.Web.UI.Page.InternalProcessRequest () <0xb30df130 + 0x003c3> in <filename unknown>:0 
  at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context) <0xb30dc3b0 + 0x00163> in <filename unknown>:0 

The ASPX-Code of the button is:

<asp:Button ID="EditButton" runat="server" Text="" OnClick="EditButton_Click" Visible="false" Enabled="false" />

The C#-Code behind the button is:

protected void EditButton_Click(object sender, EventArgs e)
        {
            HttpCookie wachs_task_store = new HttpCookie("wachs_aufgaben_keks");
            wachs_task_store.Value = DropDownList1.Text;
            Response.Cookies.Add(wachs_task_store);
            Response.Redirect("../Content/EditContent.aspx");
        }

If more Code of the next Site is needed, i will paste it.

Note You need to log in before you can comment on or make changes to this bug.