Jump to content

ASP Help Needed


Luke4123

Recommended Posts

Well I thought I would get an ASP Book out of my Local Library and give it a try, coz I heard you can do some pretty cool things with it. I admit I copied one of the codes out of the book to see if it would work. But it didnt. Any ideas why?http://www.theolsens.com.au/luke/default.aspx

Link to comment
Share on other sites

I moved your topic to the proper forum. You are working with ASP.Net not ASP. It is impossible to know what your problem is because you have not provided any code and you have remote error messages turned off. When I view your page it just says

Server Error in '/' Application.Runtime ErrorDescription: 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>
Link to comment
Share on other sites

This is the code:

<%@Page Explicit="True" Language="VB" Debug="True" %><%@ Import Namespace="System.IO" %><html><script runat="server">	Sub AddMe_Click(ByVal Sender As Object, ByVal E As EventArgs)		Dim GBPeople As String		GBPeople = _		   "c:\inetpub\wwwroot\guestbook\gbpeople.txt"		My.Computer.FileSystem.WriteAllText(GBPeople, _		   FirstName.Text & "<br>", True)		My.Computer.FileSystem.WriteAllText(GBPeople, _		   LastName.Text & "<br>", True)		My.Computer.FileSystem.WriteAllText(GBPeople, _		   Gender.SelectedItem.Text & "<br>", True)		My.Computer.FileSystem.WriteAllText(GBPeople, _		   Email.Text & "<br><br>", True)		Response.Redirect("Default.htm")	End Sub</script> <body><h1>Sign Our Guestbook</h1><form runat="server">First Name:<br><asp:textbox id="FirstName" runat="server"/><br>Last Name:<br><asp:textbox id="LastName" runat="server"/><br>Gender:<br><asp:radiobuttonlist id="Gender" runat="server">   <asp:listitem selected="true">Male</asp:listitem>   <asp:listitem>Female</asp:listitem></asp:radiobuttonlist><br>Age:<br><asp:textbox id="Age" runat="server"/><br>Email Address:<br><asp:textbox id="Email" runat="server"/><br><asp:button id="AddMe" text="Add Me!" runat="server" onclick="AddMe_Click"/><br></form></body></html>

And this is what my Web.Config code looks like:

<?xml version="1.0"?><!-- 	Note: As an alternative to hand editing this file you can use the 	web admin tool to configure settings for your application. Use	the Website->Asp.Net Configuration option in Visual Studio.	A full list of settings and comments can be found in 	machine.config.comments usually located in 	\Windows\Microsoft.Net\Framework\v2.x\Config --><configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">	<appSettings/>	<connectionStrings/>	<system.web>		<!-- 			Set compilation debug="true" to insert debugging 			symbols into the compiled page. Because this 			affects performance, set this value to true only 			during development.		-->		<compilation debug="true"/>		<!--			The <authentication> section enables configuration 			of the security authentication mode used by 			ASP.NET to identify an incoming user. 		-->		<authentication mode="Windows"/>		<!--			The <customErrors> section enables configuration 			of what to do if/when an unhandled error occurs 			during the execution of a request. Specifically, 			it enables developers to configure html error pages 			to be displayed in place of a error stack trace.		<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">			<error statusCode="403" redirect="NoAccess.htm"/>			<error statusCode="404" redirect="FileNotFound.htm"/>		</customErrors>		-->	</system.web></configuration>

Link to comment
Share on other sites

your error message section of web.config is commented out so it defaults to RemoteOnly which shows you useful messages from localhost but if you try and view it over the web you get a generic message equivalent to "Something went wrong but I can't tell you about it".

<!--			The <customErrors> section enables configuration			of what to do if/when an unhandled error occurs			during the execution of a request. Specifically,			it enables developers to configure html error pages			to be displayed in place of a error stack trace.		<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">			<error statusCode="403" redirect="NoAccess.htm"/>			<error statusCode="404" redirect="FileNotFound.htm"/>		</customErrors>		-->

Below the above code chunk insert this

<customErrors mode="Off"/>

After you do this I will be able to see the error message and understand what is going wrong.

Link to comment
Share on other sites

I inserted the code chunk but it still doesnt to work. Now it looks like this:

<?xml version="1.0"?><!-- 	Note: As an alternative to hand editing this file you can use the 	web admin tool to configure settings for your application. Use	the Website->Asp.Net Configuration option in Visual Studio.	A full list of settings and comments can be found in 	machine.config.comments usually located in 	\Windows\Microsoft.Net\Framework\v2.x\Config --><configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">	<appSettings/>	<connectionStrings/>	<system.web>		<!-- 			Set compilation debug="true" to insert debugging 			symbols into the compiled page. Because this 			affects performance, set this value to true only 			during development.		-->		<compilation debug="true"/>		<!--			The <authentication> section enables configuration 			of the security authentication mode used by 			ASP.NET to identify an incoming user. 		-->		<authentication mode="Windows"/>		<!--			The <customErrors> section enables configuration 			of what to do if/when an unhandled error occurs 			during the execution of a request. Specifically, 			it enables developers to configure html error pages 			to be displayed in place of a error stack trace.		<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">			<error statusCode="403" redirect="NoAccess.htm"/>			<error statusCode="404" redirect="FileNotFound.htm"/>		</customErrors>		--><customErrors mode="Off"/>	</system.web></configuration>

Is that all right?

Link to comment
Share on other sites

lol I have actually changed the URL. Here is the real one:http://www.theolsens.com.au/luke/default2.aspxWhen you click login or register... It comes up with a runtimes error. :)

Link to comment
Share on other sites

That one works for me too...

ASP.NET TipVaultWelcome to the ASP.NET TipVault. Here you'll find lots of cool tips and tricks you can use in your ASP.NET projects. But before you check out the goodies, I need for you to register. I won't sell your name to anyone else and I won't send you spam. I'll only send you occasional emails to inform you of events and site updates.Register now!I'm registered. I want to Log in!
Link to comment
Share on other sites

Yeah that page works but when you click Log-In or Register, it has the error. :)

Link to comment
Share on other sites

I am still seeing the generic error. I cannot see the real error messages. Post your web.config file again. Is the directory /luke configured as an application in IIS or did you just create a new folder and upload some pages? if not it will use the web.config file from the root folder http://www.theolsens.com.au/

Link to comment
Share on other sites

Here it is again. :)

<?xml version="1.0"?><!-- 	Note: As an alternative to hand editing this file you can use the 	web admin tool to configure settings for your application. Use	the Website->Asp.Net Configuration option in Visual Studio.	A full list of settings and comments can be found in 	machine.config.comments usually located in 	\Windows\Microsoft.Net\Framework\v2.x\Config --><configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">	<appSettings/>	<connectionStrings/>	<system.web>		<!-- 			Set compilation debug="true" to insert debugging 			symbols into the compiled page. Because this 			affects performance, set this value to true only 			during development.		-->		<compilation debug="true"/>		<!--			The <authentication> section enables configuration 			of the security authentication mode used by 			ASP.NET to identify an incoming user. 		-->		<authentication mode="Windows"/>		<!--			The <customErrors> section enables configuration 			of what to do if/when an unhandled error occurs 			during the execution of a request. Specifically, 			it enables developers to configure html error pages 			to be displayed in place of a error stack trace.		<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">			<error statusCode="403" redirect="NoAccess.htm"/>			<error statusCode="404" redirect="FileNotFound.htm"/>		</customErrors>		--><customErrors mode="Off"/>	</system.web></configuration>

Link to comment
Share on other sites

Sorry to sound like a complete noob, but what is IIS?

Link to comment
Share on other sites

Sorry to sound like a complete noob, but what is IIS?
IIS = Internet Information Services. It's a Web server - Microsoft's version of Apache.In my version of XP, you can manage IIS from the start menu:Start -> Administrative Tools -> Internet Information Services.Or, here:C:\WINDOWS\system32\inetsrv\inetmgr.exe
Link to comment
Share on other sites

lol Thanks for that but can anyone give me the Vista Version? :)

Link to comment
Share on other sites

lol There is only a iSCSI Initiator.

Link to comment
Share on other sites

what version of Vista do you have? IIS only comes on Business or Ultimate. Besides we are talking about IIS on the server where your pages are hosted, not on your home PC. Who does your hosting?

Link to comment
Share on other sites

I have Vista Home Premium. Ummm lol My dad set everything up, I use Helm Control Panel?

Link to comment
Share on other sites

I have Vista Home Premium. Ummm lol My dad set everything up, I use Helm Control Panel?
Ask him to check for you if your folder (/luke/) is setup as an application or not. If it is not your page is trying to use the web.config file from the root of the application (in your case theolsens.com not theolsens.com/luke).
Link to comment
Share on other sites

Ok I will ask him :) Also, if I made a file in the /luke folder called web.config with all the code in it, will that do anything to help? :)

Link to comment
Share on other sites

Ok I will ask him :) Also, if I made a file in the /luke folder called web.config with all the code in it, will that do anything to help? :)
No. ASP.Net uses the web.config, bin, and App_Code from directories setup as Applications in IIS. If the the folder the page is being called from is not an application it will move to the parent folder, and so on and so on until it finds an application then is will use that web.config.
Link to comment
Share on other sites

Oh ok. Also, I have a blank folder called aspnet_client in the /luke folder. Do I need to do anything with this?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...