I can do this with ASP.NET but the project I'm working
with is all written in C# and all in the .cs file using
WriteLine. I have tried a number of things to get at the
uploaded file, but with no success. I thought since it was
running on the Server I could use the same type of
ServerClick event to catch this but no luck. Can someone
enlighten me?
BTW: Why doesn't if(myPost.Poste dFile!=null) not work. It
doesn't stop if click the button without a file listed in
the type=file textbox.
Code below.
public void DisplayFileUplo ad(HtmlTextWrit er writer)
{
writer.WriteLin e("<table border='1' cellspacing='2'
cellpadding='2' class='form'>") ;
writer.WriteLin e("<tr><td><h 5> Select the File to
upload</h5></td><tr>");
writer.WriteLin e("<tr><td>") ;
writer.WriteLin e("<input type='file' id='ulFile' size='35'
runat='server'> ");
writer.WriteLin e("</td></tr>");
writer.WriteLin e("<tr><td>") ;
writer.WriteLin e("<input type='hidden' value='uploaded '
name='test'>");
writer.WriteLin e("<input type='submit' value='Upload'
OnServerclick=' UploadFile_Serv erClick;' runat='server'
name='UploadFil e' id='UploadFile' >");
writer.WriteLin e("</td></tr></table>");
}
thanks
with is all written in C# and all in the .cs file using
WriteLine. I have tried a number of things to get at the
uploaded file, but with no success. I thought since it was
running on the Server I could use the same type of
ServerClick event to catch this but no luck. Can someone
enlighten me?
BTW: Why doesn't if(myPost.Poste dFile!=null) not work. It
doesn't stop if click the button without a file listed in
the type=file textbox.
Code below.
public void DisplayFileUplo ad(HtmlTextWrit er writer)
{
writer.WriteLin e("<table border='1' cellspacing='2'
cellpadding='2' class='form'>") ;
writer.WriteLin e("<tr><td><h 5> Select the File to
upload</h5></td><tr>");
writer.WriteLin e("<tr><td>") ;
writer.WriteLin e("<input type='file' id='ulFile' size='35'
runat='server'> ");
writer.WriteLin e("</td></tr>");
writer.WriteLin e("<tr><td>") ;
writer.WriteLin e("<input type='hidden' value='uploaded '
name='test'>");
writer.WriteLin e("<input type='submit' value='Upload'
OnServerclick=' UploadFile_Serv erClick;' runat='server'
name='UploadFil e' id='UploadFile' >");
writer.WriteLin e("</td></tr></table>");
}
thanks