Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New to ASP.net - question about error msg and learning in general

Status
Not open for further replies.

neronikita

Technical User
Feb 20, 2002
159
0
0
US
Hi!

I have had experience with asp, but not much with asp.net. I have an iis 7 web site on a remote virtual server. When I develop a page on the remote virtual server (using remote desktop) and open it in the browser, it works. However, when I'm at any of our "regular" computers, when I open that page I get this message:


Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

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>



I'm not experienced enough to know what to do with this. I've played around with a few things in the past, but nothing has worked and I don't remember what I even tried (I haven't touched it in at least 6 months) The whole asp.net thing has been a struggle. So my questions are, what do I need to do based on the above message to see the web page on any computer, and what is the best way to learn asp.net from the ground up? I just can't seem to get it to do what I used to do in asp and I'm not sure why. It probably doesn't help that months go by between having time to work on this and I end up starting over every time I'm trying to learn. I'm willing to buy books if I need to, but I'd like recommendations before I spend the money.

Thanks in advance for any help!

Di
 
Like the error says, add this code to your web.config file:
Code:
<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>

Then when you run the website remotely, you will see the error being thrown.

As for books, there are many good ones out there. I've always liked Wrox myself.
 
Thanks for your response.

ok, i found several web.config files, and they are all different. I'm sorry, I'm not familiar with this file.

Here's the one I changed to add that part:

<configuration>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true"/>
</system.web>
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="default.aspx" />
<add value="Default.htm" />
<add value="Default.asp" />
<add value="index.htm" />
<add value="index.html" />
<add value="iisstart.htm" />
</files>
</defaultDocument>
</system.webServer>
</configuration>

the other one has this:

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

The first one is on my sql01 server and the second one is on my SBS2k8 server. iis 7 is hosted on sql01, so I don't understand why when I changed the one on SBS2k8 that my web page (when accessed remotely) changed (not for the better, however). Either way, I'm not getting any results.

Also, I'm reading that you need to know either vb or c# to use asp.net.... would you recommend learning one over the other? I used some vb with asp, but it's been so long, I'm at the beginning again.... I might as well start with whichever is easier/most popular/ etc.

Thanks!

Di
 
There is only one web.config file per site. Find the one that is in your web site folder under the directory.

As for which language, that is a matter of preference and comfort. There is no difference between the 2. In other words, what you can do in one, you can do in the other, it is just a matter of syntax. If you are truly starting at the beginning, then I would suggest using C#. It has gained much popularity and is probably more widely used than VB. Also, when you do have a question and do some research, you will most likely find examples in C#. Although you can convert the code easily, usually, I just suggest that you go the C# route.
 
Thanks.

I think I see my problem. In trying to learn this, and iis 7, I've repeatedly set up new servers somehow, each with a web configuration file. I have to figure out which ones work and which ones don't, I guess, and go from there. This is frustrating when you have to take months off and can't remember what you did before. It doesn't help that I am also trying to figure out iis 7, which someone else set up for us when we had the new server installed.

I will be looking for a book on C#. Should I teach myself that before I do any more with ASP.NET, in your opinion?

Thanks again for all of your help.

Di

 
It all goes hand in hand. Learning C# first will not help with the web portion of what you are learning. Remember that web development uses many technologies as opposed to a windows app. Web apps work differently in many ways, they are disconnect as opposed to windows apps that are connected.
For web apps it's not just learning a code-behind language, it's lots of technologies that work together. A web app needs a web server. You need a database server. You need to know a code-behind language. You need to know a client scripting language, most likely javascript. With javascript you can use a library like JQuery or JQuery mobile for mobile apps. There is XML and HTML and CSS. You can see that you are not just going to be learning one thing, then the next. They aall work together. I have been doing .NET (mostly web dev) since it's inception. And everyday I am learning something new. I say this, so that you will not get frustrated as you are learning. There is a lot to learn, and you will never be an expert per set. Technologies come and go, and there is always something new around the corner.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top