p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   VS.NET 2002/2003 (http://p2p.wrox.com/forumdisplay.php?f=103)
-   -   Uploading and Running vs.net on remote server (http://p2p.wrox.com/showthread.php?t=13481)

X-Ken May 27th, 2004 01:16 AM

Uploading and Running vs.net on remote server
 
Hi,

I had problem in running vs.net on remote server.
it says the error was with the inheritance,
<%@ Page Language="vb"
AutoEventWireup="false" Codebehind="src=Webform1.aspx.vb"
Inherits="something.Webform1" %>
I added the file directly under c:/inetpub/wwwroot/something/ which is located on remote server.
It seems that the file is not loaded into something's remote directory(localhost/something/) - (however it will be stored into the remote directory's automatically if i use 'add existing feature')

Please help


planoie May 27th, 2004 07:32 AM

This question is a little confusing but I think I know what the problem is.

You are trying to upload an ASP.NET page: Webform1.aspx
This page needs to inherit from the class "something.Webform1".
This class will live in your compiled DLL. If c:/inetpub/wwwroot/something/ is NOT configured as an application, then the class "something.Webform1" is assumed to live in an assembly that is located in c:/inetpub/wwwroot/bin. You can put the assembly in c:/inetpub/wwwroot/something/bin but it will not be found by the ASP.NET runtime unless c:/inetpub/wwwroot/something is an application.

When you create the directory for "something", you need to go into IIS and make that directory an application. To do this:
- Start IIS manager
- Navigate to the subdirectory "something" under the default web site
- Right-click, and choose properties
- On the directory tab, look for "Application Settings"
- Under that, you should find a "Create" button.
- Click "Create" button. This creates an application on that subdirectory.

Now when the aspx page is run, the .NET runtime will look for assemblies under something/bin.

Peter
-------------------------
Work smarter, not harder

X-Ken May 27th, 2004 10:33 AM

Hi there,

Thank you for the reply. I am sorry if I didn't say it clearly, the problem is I tried to create a webform that inherits Assg2, however instead of add it using 'add existing item.. ' tool (inside vs.net solution explorer), I copied it directly into c:/inetpub/wwwroot/Assg2 then I tried to access the page from internet explorer. But when I tried to get the page from internet explorer, the below error message occured.


Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'Assg2.WebForm1'.

Source Error:


Line 1: <%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="Assg2.WebForm1"%>
Line 2: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
Line 3: <HTML>

Do you know why?

Thanks


planoie May 27th, 2004 10:40 AM

The server is telling you "Parser Error Message: Could not load type 'Assg2.WebForm1'."

This is because you are adding a page but that page's base class doesn't exist in the assembly of you application. You can't just add a page unless it's either completely self contained (relies on no assembly based classes) or it uses classes that already exist in assemblies that are in the application's /bin folder.

It sounds as though you are not entirely clear on how the asp.net runtime functions with compiled code-behind.

X-Ken May 27th, 2004 10:46 AM

Is there a way to overcome the problem? How to put the base class into the assembly?


planoie May 27th, 2004 10:49 AM

I don't see this as a "problem", it's the way things work. You need to compile the base class into an assembly. How you do that is up to you.

X-Ken May 27th, 2004 10:54 AM

Oh.. what if I don't have access to compile the base class?
For example I was given an ftp path by my web server to upload my class but he didn't say I have access to do compilation on his server, my class will just be simply uploaded to its server directory "c:/inetpub/www/Assg2".


planoie May 27th, 2004 11:21 AM

You shouldn't be compiling on the server. Compile locally, and upload the ASPX and the .DLL files.

X-Ken May 28th, 2004 02:47 AM

cool i copied all files which are in localhost to the server and finally the page can be displayed however the button is not working. for example i cannot do
buttonclick{byval sender as object, ....)
textbox1.text = "text"}

Why is that?


shahchi1 May 28th, 2004 08:46 AM

would you post your code


All times are GMT -4. The time now is 03:32 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.