473,396 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

publish asp.net web application

Guys

I developed a small asp web service app in Visual Studio .NET. To
deploy on another server, I just copied the whole dir as is from my
c:\inetpub\wwwroot to the same dir on destination server, but I get
this error. I'm using excel automation etc:

Compiler Error Message: CS0246: The type or namespace name 'Excel'
could not be found (are you missing a using directive or an assembly
reference?)

Source Error:

Line 110: GC.Collect();
Line 111: /* src excel */
Line 112: Excel.Application srcExcel = new Excel.ApplicationClass();
Line 113: Excel._Workbook srcWb = srcExcel.Workbooks.Open(fName,
Missing.Value, Missing.Value,
Line 114: Missing.Value, Missing.Value, Missing.Value,

Can you tell me what I'm doing wrong? Please help.,

thanks

May 14 '06 #1
7 1177
"berkeleydb_user" <pr*********@gmail.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
Can you tell me what I'm doing wrong? Please help.,


Presumably, Microsoft Office (or, at least, Excel) is installed on your
development box and not your web server...?
May 14 '06 #2
Excel is there for sure. I'm trying this on Windows Server 2003.

Actually it was my mistake. I edited the file so I could put without
"codebehind" etc. Now I really copied the whole dir from development to
server but when I click on my submit button, nothing happens, page just
comes back and I see 'Done' at the bottom of browser. whats going on?

thanks

May 14 '06 #3
"berkeleydb_user" <pr*********@gmail.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com...
Excel is there for sure. I'm trying this on Windows Server 2003.
Excel is not part of Windows Server 2003 - are you absolutely certain you
installed it on your server...?
Actually it was my mistake. I edited the file so I could put without
"codebehind" etc. Now I really copied the whole dir from development to
server but when I click on my submit button, nothing happens, page just
comes back and I see 'Done' at the bottom of browser. whats going on?


Impossible to say without more information...
May 14 '06 #4
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:requiredfieldvalid ator
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";
}
}
}

May 14 '06 #5
I just verified that msexcl40.dll is there in c:\windows\system32.

tthanks

May 14 '06 #6
Hi Mark

I made up this small app from a working app. This one does same thing.
It just returns the same page back without doing anything. I select a
file from my c: on server, and click upload. I expect 'resultNum' field
to be visible and show some text. it doesn't. the page just comes back
as it is :((

here is the code:
=============

<% @Page Language="C#" %>
<html>
<head>
<title>File upload in ASP.NET</title>
</head>
<body bgcolor="#ffffff" style="font:8pt verdana;">
<script language="C#" runat="server">

void uploadButton_Click(object sender, System.EventArgs e)
{
resultNum.Visible = true;
if ( File1 != null ) {
resultNum.Text = "abcd";
}
else {
resultNum.Text = "efgh";
}
}
</script>
<form action="apacx.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:requiredfieldvalid ator
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>

<span id=txtOutput style="font: 8pt verdana;" runat="server" />

</body>
</html>

here is working code for uploading a file. this one works on same
server.
==============================
<% @Page Language="C#" %>
<html>
<head>
<title>File upload in ASP.NET</title>
</head>
<body bgcolor="#ffffff" style="font:8pt verdana;">
<script language="C#" runat="server">
void btnUploadTheFile_Click(object Source, EventArgs evArgs)
{
string strFileNameOnServer = txtServername.Value;
string strBaseLocation = "d:\\downloads\\temp\\";

if ("" == strFileNameOnServer)
{
txtOutput.InnerHtml = "Error - a file name must be specified.";
return;
}

if (null != uplTheFile.PostedFile)
{
try
{
uplTheFile.PostedFile.SaveAs(strBaseLocation+strFi leNameOnServer);
txtOutput.InnerHtml = "File <b>" +
strBaseLocation+strFileNameOnServer+"</b> uploaded successfully";
}
catch (Exception e)
{
txtOutput.InnerHtml = "Error saving <b>" +
strBaseLocation+strFileNameOnServer+"</b><br>"+ e.ToString();
}
}
}
</script>
<form enctype="multipart/form-data" runat="server">
<table>
<tr>
<td>Upload Excel file:</td>
<td><input id="uplTheFile" type=file runat="server"></td>
</tr>
<tr>
<td>Name on server:</td>
<td><input id="txtServername" type="text" runat="server"></td>
</tr>
<tr>
<td colspan="2">
<input type=button id="btnUploadTheFile" value="Upload"
OnServerClick="btnUploadTheFile_Click"
runat="server">
</td>
</tr>
</table>
</form>

<span id=txtOutput style="font: 8pt verdana;" runat="server" />

</body>
</html>

May 14 '06 #7
Hi

This is my first asp.net web application. Not sure what is going on.
Here is what I found. When I use <asp:.....> tag its NOTworking. First
listing works but the second doesnt!!!! must be some basic
mistake....pl help me out.

working source.....no <asp:....> tags. when i click on Upload button I
see the text box getting filled with "asdfasdfa"
======================
<% @Page Language="C#" %>
<html>
<head>
<title>File upload in ASP.NET</title>
</head>
<body bgcolor="#ffffff" style="font:8pt verdana;">
<script language="C#" runat="server">

void uploadButton_Click(object sender, System.EventArgs e)
{
txtbox.Value = "asdfasdfa";
}
</script>
<form action="apacx.aspx" method="post" enctype="multipart/form-data"
runat="server">
<input type="text" runat="server" id="txtbox"><p>
<INPUT id="File1" type="file" name="uploadControl"
runat="server">
<INPUT id="uploadButton" type="button"
OnServerClick="uploadButton_Click" runat="server" Value="Upload">

</form>

<span id=txtOutput style="font: 8pt verdana;" runat="server" />

</body>
</html>
this doesn't work....page just returns.
==================
<% @Page Language="C#" %>
<html>
<head>
<title>File upload in ASP.NET</title>
</head>
<body bgcolor="#ffffff" style="font:8pt verdana;">
<script language="C#" runat="server">

void uploadButton_Click(object sender, System.EventArgs e)
{
txtbox.Value = "asdfasdfa";
}
</script>
<form action="apacx.aspx" method="post" enctype="multipart/form-data"
runat="server">
<input type="text" runat="server" id="txtbox"><p>
<INPUT id="File1" type="file" name="uploadControl"
runat="server">
<asp:button id="uploadButton" type="button"
OnServerClick="uploadButton_Click" runat="server"
Text="Upload"></asp:button>

</form>

<span id=txtOutput style="font: 8pt verdana;" runat="server" />

</body>
</html>

May 14 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bill Long | last post by:
I have a .NET 1.1 application (C#) that I converted to .NET 2.0... Conversion was pretty painless, code runs from the development environment no problem... but when I try and publish... It says...
10
by: WT | last post by:
Hello, I have been publishing my web site many times to the remote where resides my final web site. Everything was ok, but to-day, without any configuration change, vs doesn't copy final files...
3
by: Tom | last post by:
I did a Build --Publish web site last night on my web app, It publish correctly but it created 12 DLL's for it. Is there a way to only get 1 dll for the entire web project like in 03 or a is there...
3
by: mrajanikrishna | last post by:
Hi friends, I've designed an application in my local system using VS.NET 2003. (VB.NET and ASP.NET) Its working fine. Now, I want to publish to my ISPs server. I've FTP account. How can I...
0
by: Mulm3h | last post by:
Hi when I publish my application using the publish wizard in VB 2k5 Everything works fine, but after i run through the installation of the application setup.exe. There's a folder missing which...
3
by: Frank Rizzo | last post by:
I get a ton of warning that are similar to "Unable to apply publish properties for item "microsoft.visualstudio.shell.interop". The warning appears for pretty much every reference. The...
6
by: Aussie Rules | last post by:
Hi, I use the publish feature within Vs.net 2008, and have it set to increment on each build/publish I want to be able to display this as my application version number, but can not see how to...
2
by: parez | last post by:
Hi, I am developing a .net 3.0 win forms(C#) application using vs2008. I am also using 3rd party controls which are installed in the the GAC. After i publish the application on the different...
6
by: Anil Gupte/iCinema.com | last post by:
I seem to have read somewhere that one can do this by copying the code-behind page into the .aspx file. Is there an easier way? I tried to create a simple web page (I just need a quick...
0
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?= | last post by:
Hi misters USING VS 2005 in XP, VB.NET, CLICK ONCE I have a Publish of my application, AdministradorWin.exe, in a folder D:\ClickOnce\instalacionExpedienteElectronico (of a server in my...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.