VjSharp newbie
Object reference not set to an instance of an object.
Here is a portion of the code
public
class UploadDataRSextends System.Web.UI.Page{
protected System.Web.UI.HtmlControls.HtmlInputFile File1;protected System.Web.UI.HtmlControls.HtmlSelect sYear;protected System.Web.UI.WebControls.Label Label3;protected System.Web.UI.WebControls.Label output;protected System.Web.UI.WebControls.Label Label1;protected System.Web.UI.WebControls.Label output2;protected System.Web.UI.HtmlControls.HtmlInputFile File4;protected System.Web.UI.HtmlControls.HtmlInputButton Submit2;protected System.Web.UI.WebControls.TextBox TextBox2;protected System.Web.UI.HtmlControls.HtmlSelect sMonth;privatevoid Page_Load(Object sender, System.EventArgs e){
// Put user code to initialize the page here}
#region
Web Form Designer generated codeprotectedvoid OnInit(System.EventArgs e){
//// CODEGEN: This call is required by the ASP.NET Web Form Designer. Donot remove this.//
InitializeComponent();super.OnInit(e);
}
privatevoid InitializeComponent(){
this.TextBox2.add_TextChanged(new System.EventHandler(this.TextBox2_TextChanged) );this.Submit2.add_ServerClick(new System.EventHandler(this.Submit2_ServerClick) );this.add_Load(new System.EventHandler(this.Page_Load) );........>>>error on this line}
// #endregion
privatevoid Submit2_ServerClick (Object sender, System.EventArgs e){
String strFullName = File4.get_PostedFile().get_FileName();
String strName, strFname="";
int intIndex = strFullName.lastIndexOf("\\");strName = (intIndex != -1) ? strFullName.substring(intIndex+1) : strFullName;
if (!strName.equals("")){
strFname = "d:\\dev\\PM\\" + strName;
File1.get_PostedFile().SaveAs(strFname);
}
else{
output.set_Text("<div align=center><h3>Error: please select a file for uploading first!</h3></div>");
return;}
Any help is appreciated .. Thanks

