Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

An Arraylist of HTMLInputFile. This arraylist is being stored in.....

Status
Not open for further replies.

toptomato

Programmer
Jul 22, 2005
62
0
0
US
Hi,
Senario:
I have ViewState["filelist"] statebag which hold an ArrayList. The ArrayList hold objects of type HTMLInputFile.
Everytime a user adds file. The HTMLinputfile gets added to ArrayList which is stored in ViewState["filelist"] statebag.
when user is done adding all the files he need to add he clicks on add all files and the the htmlinputfile in the Arraylist get saved to the server

the above isn't working and i am getting the following error message

The type 'System.Web.UI.HtmlControls.HtmlInputFile' must be marked as Serializable or have a TypeConverter other than ReferenceConverter to be put in viewstate.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The type 'System.Web.UI.HtmlControls.HtmlInputFile' must be marked as Serializable or have a TypeConverter other than ReferenceConverter to be put in viewstate.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): The type 'System.Web.UI.HtmlControls.HtmlInputFile' must be marked as Serializable or have a TypeConverter other than ReferenceConverter to be put in viewstate.]
System.Web.UI.LosFormatter.SerializeValue(TextWriter output, Object value) +1485
System.Web.UI.LosFormatter.SerializeValue(TextWriter output, Object value) +430
System.Web.UI.LosFormatter.SerializeValue(TextWriter output, Object value) +430
System.Web.UI.LosFormatter.SerializeValue(TextWriter output, Object value) +767
System.Web.UI.LosFormatter.SerializeValue(TextWriter output, Object value) +850
System.Web.UI.LosFormatter.SerializeValue(TextWriter output, Object value) +875
System.Web.UI.LosFormatter.SerializeInternal(TextWriter output, Object value) +102
System.Web.UI.Page.OnFormRender(HtmlTextWriter writer, String formUniqueID) +143
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +35
System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +260
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +72
System.Web.UI.Control.Render(HtmlTextWriter writer) +7
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.Page.ProcessRequestMain() +1926


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top