website work on localhost but not on the server


L

LaiLakY

Hi Everybody,

I have a project and I upload it to the server but it dosn't work.
On my local host it is work fine.
I try to write simple page just hello world and upload to the server
it same thing , and I cannot know the error from the client side it is
give me this error.
--------------------
Details: To enable the details of this specific error message to be
viewable on remote machines, please create a <customErrors> tag within
a "web.config" configuration file located in the root directory of the
current web application. This <customErrors> tag should then have its
"mode" attribute set to "Off".


<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
</configuration>


Notes: The current error page you are seeing can be replaced by a
custom error page by modifying the "defaultRedirect" attribute of the
application's <customErrors> configuration tag to point to a custom
error page URL.


<!-- Web.Config Configuration File -->

<configuration>
<system.web>
<customErrors mode="RemoteOnly"
defaultRedirect="mycustompage.htm"/>
</system.web>
</configuration>
---------------------------------------
Please any Idea, I'm using vs 2005 asp.net vb

Thanx
 
Ad

Advertisements

T

ThatsIT.net.au

Is the server yours?

or is this a ISP's server?

You need to enable ASP.NET on the server
 
M

Mark Fitzpatrick

Change the web.config so the customErrors element looks like the one you
were shown in the error. That will make the error visible to you.
 
L

LaiLakY

Hi all, thanks for your replay
I went to the server and run application from browser, it is give
error about the connection string which is not recognized, I delete
the line becouse my application is simple helo world app. and ren it
again and give error about
----------------------------
it is an error to use a section registered as allowDefinition='machine
ToApplication' beyond application level. this error can be caused by a
virtual directory not being configerd as an application in IIS.

line 57 : <authentication mode="windows" /> s

I copy the pages in wwwroot folder which all old files on it.
any idea please. thanks
 
M

Mark Fitzpatrick

What this means is the directory you are publishing to is not marked as an
application. If you're publishing to a directory such as
www.mysite.com/myapp then the myapp is not marked as an application for the
web server. You are receiving this message because the authentication
element can only be used in the web.config that's at the root directory of
an application. In this case, it would be at www.mysite.com. Putting it into
the myapp directory is thus placing it into a sub-directory of the app. That
also means that your bin directory with your dll files would also be inthe
wrong directory. What you'll need to do is to find a way to mark the
directory you are publishing to as it's own application. your we host may
have this feature available as part of your web site's control panel.
 
J

Juan T. Llibre

LaiLakY,

What that error means is that you must configure the physical directory
where your "hello world" file is located as a virtual directory in IIS.

Open IIS Manager by going to Control Panel -> Administrative Tools -> Internet Information Services.

In the IIS Manager, select the "Default Web Site" folder and right-click it.
Select "New" from the context menu, and then click Virtual Directory .

The Virtual Directory Creation Wizard appears.

B. Click Next.
C. In the Alias box, type a name for the virtual directory. (choose a short name that is easy to type)
D. Click Next.

E. In the Path box, type or browse to the physical directory where your application resides,
( drive:\inetpub\wwwroot\yourDir\ is the default, but it could be anywhere on your hard drive,
and then click Next.

F. Choose the defaults on the next two pages.
G. Click Finish.

After you're done, you should be able to access the files in the physical directory
by typing : http://localhost/TheVirtualDirectoryNameYouUsedForAnAlias/some.aspx

Btw, if all you're doing is a simple "Hello world" app, I'd also delete the contents of your web.config.

You don't need it to experiment with a simple "Hello world" application.
After you get more familiar with what web.config files do, you can start adding things to it.

Good luck...and let us know if you have any problems after doing that.
 
Ad

Advertisements

L

LaiLakY

I relay appreciate your replay thanks again
I found the problem is in my application that if I run the application
from the vs 205 software it is run fine. but from the browser it is
give this error if the page had some Db
-------------------
Exception Details: System.Data.SqlClient.SqlException: Login failed
for user 'C0011791\ASPNET'.
Source Error:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace
below.
 
Ad

Advertisements

L

LaiLakY

Hi all,
I add a user to be login not as windows,rather it will sql
authentication
and give me the error in both from the browser or from the visual
studio debug command
error is
--------------------------
Exception Details: System.Data.SqlClient.SqlException: Login failed
for user 'fahad'. Reason: Not associated with a trusted SQL Server
connection.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace
below.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top