I try to use XML serilization in gridview, but it gives me: InvalidOperationException user code without action was
My code:
Using the system; Using System.Collections.Generic; Using System.Linq; Using System.Web; Using System.Web.UI; Using System.Web.UI.WebControls; Using System.Xml.Serialization; Using System.IO; Name Location WebAppl_serilization {Public Partial Category _Default: System.Web.UI.Page {Protected Zero Page_Load (Object Sender, EventArgs e) {FileStream myStream = New FileStream ("GridView.XML", FileMode.Create); XmlSerializer myXs = New XmlSerializer (TypeGridView); MyXs.Serialize (Mystream, GV); MyStream.Close (); Console.light line ("devam atmak iskin brir tusa basin"); Console.ReadLine (); Filestream mesecondfs = new filestream ("gridview xml", file mod.open); XmlSerializer mySecondXs = New XmlSerializer (TypeGridView); Gridview Test = (Gridview) mySecondXs.Deserialize (mySecondFS); MySecondFS.Close (); // foreach (GridView grd in trial) // // // console (grd.); Console console Readkey (); }}}
throw me t: XmlSerializer myXs = new XmlSerializer (typeof (GridView)); Error Message: InvalidOperationException User Code Without Action Description: There was an error reflecting the 'System.Web.UI.WebControls.GridView' type
my html source: .
I doubt the GridView is serial. A better option would be to serialize the data, not the gridview.
Comments
Post a Comment