Xml serialization
Hello!
If i have a base class and a class deriving from that. Can I write something to just serialize baseclass when serializing the type of the derived class?
Can I return the instance of the base class from an derived class?
Thank you in advance!
Scott LyslePosted Oct 24, 2006, 3:29 PM
You also has a posting in here about a javascript function to submit (I assume upload) a file to a server; the response button in that posting does not work for some reason so I will answer that one here. If you are using the asp.net 2.0 (vs 2005) file upload control, the control has a property to save the file that is the target of the control. You can point this as at a file on your web server (or where you want to store the file) and write the file using the control without any javascript at all.
With a single FileUpload control added to the page, create a folder in your web application called "Uploads" and paste this code to the submit button's click event handler:
protected
void Button1_Click(object sender, EventArgs e){
try{
if (FileUpload1.HasFile){
FileUpload1.SaveAs(MapPath(
"~/Uploads/" + FileUpload1.FileName.ToString()));}
}
catch{
Response.Write(
"No joy on the file upload");}
}