I have just upgraded my webserver to asp.net version 2 and I am trying to learn the new coding structure. I have tried the following script:
"<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<h2>Engineering system test insert page</h2>
<form id="form1" runat="server">
<div>
<asp:SqlDataSource ID="SqlDatasource1" runat="server"
ConnectionString="DataSource=.\SQLEXPRESS;
AttachDbFilename=|DataDirectory|\Engineering_sys.mdf;
Integrated Security=True;
User Instance="True"
ProviderName="system.Data.SqlClient"
SelectCommmand="SELECT [area_ID], [area_name] From [Area]">
</asp:SqldataSource>
<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False"
DatakeyNames="area_ID"
DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="area_ID" HeaderText"area_ID"
InsertVisible="False"
ReadOnly="True"
SortExpression="area_ID" />
<asp:BoundField DataField="area_name"
HeaderText"area_name"
SortExpression="area_name" />
</Columns>
</asp:GridView>
</div>
</form>
</body>
</html>
We are getting the following error screen which does not make any sense
Server Error in '/' Application.
--------------------------------------------------------------------------------
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 have tried to make the above mentioned changes to our web.config file but it makes no difference apart from stopping the existing pages fail to work with the same error message.
Does anyone know what could be making this happen?
"<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<h2>Engineering system test insert page</h2>
<form id="form1" runat="server">
<div>
<asp:SqlDataSource ID="SqlDatasource1" runat="server"
ConnectionString="DataSource=.\SQLEXPRESS;
AttachDbFilename=|DataDirectory|\Engineering_sys.mdf;
Integrated Security=True;
User Instance="True"
ProviderName="system.Data.SqlClient"
SelectCommmand="SELECT [area_ID], [area_name] From [Area]">
</asp:SqldataSource>
<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False"
DatakeyNames="area_ID"
DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="area_ID" HeaderText"area_ID"
InsertVisible="False"
ReadOnly="True"
SortExpression="area_ID" />
<asp:BoundField DataField="area_name"
HeaderText"area_name"
SortExpression="area_name" />
</Columns>
</asp:GridView>
</div>
</form>
</body>
</html>
We are getting the following error screen which does not make any sense
Server Error in '/' Application.
--------------------------------------------------------------------------------
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 have tried to make the above mentioned changes to our web.config file but it makes no difference apart from stopping the existing pages fail to work with the same error message.
Does anyone know what could be making this happen?