Thanks for your help Mark. Here is my actual code. Its pretty simple. I
have a field where user uploads an excel file. I have to process that
excel file and save it. The webpage doesn't seem to be doing anything.
I enabled running 'active server pages' on IIS admin. Whole office is
installed on this server.
thanks
Webform1.aspx
=================
<%@ Page aspcompat=true language="c#" Codebehind="WebForm1.aspx.cs"
AutoEventWireup="false" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
<meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="
http://schemas.microsoft.com/intellisense/ie5"
name="vs_targetSchema">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form action="WebForm1.aspx" method="post"
encType="multipart/form-data" runat="server">
<P><asp:label id="uploadLabel" style="Z-INDEX: 101; LEFT: 33px;
POSITION: absolute; TOP: 53px" runat="server" Width="135px"
Font-Bold="True" Font-Names="Arial" Font-Size="Smaller">Upload your bid
file:</asp:label><INPUT id="File1" style="Z-INDEX: 102; LEFT: 185px;
WIDTH: 432px; POSITION: absolute; TOP: 50px; HEIGHT: 22px" type="file"
size="52" name="uploadControl" runat="server">
<asp:button id="uploadButton" style="Z-INDEX: 103; LEFT: 343px;
POSITION: absolute; TOP: 134px" runat="server" Font-Bold="True"
Font-Names="Arial" Text="Upload"></asp:button>
<asp:label id="resultNum" style="Z-INDEX: 104; LEFT: 31px; POSITION:
absolute; TOP: 202px" runat="server" Width="548px" Font-Bold="True"
Font-Names="Arial" Font-Size="X-Small" BackColor="#FFFFC0"
Visible="False">Label</asp:label><asp:table id="tblResults"
style="Z-INDEX: 105; LEFT: 33px; POSITION: absolute; TOP: 231px"
runat="server" Width="332px" Font-Bold="True" Font-Names="Arial"
Font-Size="X-Small" BackColor="InactiveCaptionText" Visible="False"
CellPadding="0" CellSpacing="0" BorderColor="Black" BorderStyle="Solid"
BorderWidth="1px" Height="24px"></asp:table><asp:label id="lblVendor"
style="Z-INDEX: 106; LEFT: 31px; POSITION: absolute; TOP: 174px"
runat="server" Width="275px" Font-Bold="True" Font-Names="Arial"
Font-Size="Smaller" BackColor="#FFFFC0"
Visible="False">Label</asp:label><asp:image id="imgChart"
style="Z-INDEX: 107; LEFT: 401px; POSITION: absolute; TOP: 237px"
runat="server" Width="552px" Visible="False"
Height="432px"></asp:image><asp:label id="lblPasswd" style="Z-INDEX:
108; LEFT: 34px; POSITION: absolute; TOP: 99px" runat="server"
Width="84px" Font-Bold="True" Font-Names="Arial"
Font-Size="Smaller">Password:</asp:label><asp:textbox id="txtPassword"
style="Z-INDEX: 109; LEFT: 186px; POSITION: absolute; TOP: 91px"
runat="server" MaxLength="10"
TextMode="Password"></asp:textbox><asp:requiredfieldvalidator
id="RequiredFieldValidator1" style="Z-INDEX: 110; LEFT: 357px;
POSITION: absolute; TOP: 94px" runat="server"
ControlToValidate="txtPassword" ErrorMessage="Password cannot be
empty"></asp:requiredfieldvalidator><asp:requiredfieldvalidator
id="RequiredFieldValidator2" style="Z-INDEX: 111; LEFT: 635px;
POSITION: absolute; TOP: 52px" runat="server" ControlToValidate="File1"
ErrorMessage="Please specify your excel bid
file"></asp:requiredfieldvalidator></P>
</form>
</body>
</HTML>
here is my webform1.aspx.cs file
=========================
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Reflection;
using System.Runtime.InteropServices;
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label uploadLabel;
protected System.Web.UI.HtmlControls.HtmlInputFile File1;
protected System.Web.UI.WebControls.Label resultNum;
protected System.Web.UI.WebControls.Table tblResults;
protected System.Web.UI.WebControls.Label lblVendor;
protected System.Web.UI.WebControls.Image imgChart;
protected System.Web.UI.WebControls.Label lblPasswd;
protected System.Web.UI.WebControls.TextBox txtPassword;
protected System.Web.UI.WebControls.RequiredFieldValidator
RequiredFieldValidator1;
protected System.Web.UI.WebControls.RequiredFieldValidator
RequiredFieldValidator2;
protected System.Web.UI.WebControls.Button uploadButton;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
resultNum.visible = true;
resultNum.text = "visible";
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.uploadButton.Click += new
System.EventHandler(this.uploadButton_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void uploadButton_Click(object sender, System.EventArgs e)
{
if ( File1 != null )
{
resultNum.text = "file field is not
blank";
}
}
}