Server Error in '/' Application

Last post 05-07-2008 5:30 AM by mjzammit. 6 replies.

Sort Posts:

  • Server Error in '/' Application

    01-26-2008, 1:31 AM
    • Loading...
    • bataween
    • Joined on 01-26-2008, 6:22 AM
    • Posts 1

    This is what i am getting please help

    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>

    JJ
    Filed under:
  • Re: Server Error in '/' Application

    01-26-2008, 3:50 AM
    Answer
    • Loading...
    • XIII
    • Joined on 06-30-2002, 11:59 PM
    • Essen, Belgium
    • Posts 9,556
    • Moderator
      TrustedFriends-MVPs

    Hi,

    and welcome to the ASP.NET forums.

    Actually you should as the error suggests, change the web.config settings for the <customErrors> element. Be sure to to keep in mind that this is xml hence case sensitive. After changing it you can upload the web.config to your hosting provider and see what's wrong since you'll get a much more detailed error explanation. Most likely it'll be a connection string setting that needs to be changed. If you don't know what the connection string should be, ask your hosting provider for the needed details. 

    Grz, Kris.

    Read my blog | Members are volunteers so please keep out the (it's urgent | asap | reply me directly) stuff. Nobody's interested in that.
  • Server Error in '/' Application

    05-06-2008, 3:52 PM
    • Loading...
    • mjzammit
    • Joined on 05-06-2008, 3:47 PM
    • Posts 17

     

    Hi i need help i am getting this error when running my web applcation and have no idea how to fix it

     A potentially dangerous Request.Form value was detected from the client (TextBox1="<html><head><meta ht..."). body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }

    Server Error in '/' Application.

    A potentially dangerous Request.Form value was detected from the client (TextBox1="<html><head><meta ht...").

    Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. You can disable request validation by setting validateRequest=false in the Page directive or in the configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case.

    Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (TextBox1="<html><head><meta ht...").

    Source Error:

    [No relevant source lines]

    Source File: c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\f73942d8\3257ff47\App_Web_pd7bdv13.0.cs    Line: 0

    Stack Trace:

    [HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (TextBox1="<html><head><meta ht...").]
       System.Web.HttpRequest.ValidateString(String s, String valueName, String collectionName) +3307682
       System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, String collectionName) +108
       System.Web.HttpRequest.get_Form() +119
       System.Web.HttpRequest.get_HasForm() +3309630
       System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +45
       System.Web.UI.Page.DeterminePostBackMode() +65
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7350
       System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +213
       System.Web.UI.Page.ProcessRequest() +86
       System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18
       System.Web.UI.Page.ProcessRequest(HttpContext context) +49
       ASP.default_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\f73942d8\3257ff47\App_Web_pd7bdv13.0.cs:0
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
    


    Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
  • Re: Server Error in '/' Application

    05-06-2008, 4:06 PM
    • Loading...
    • XIII
    • Joined on 06-30-2002, 11:59 PM
    • Essen, Belgium
    • Posts 9,556
    • Moderator
      TrustedFriends-MVPs

    Hi,

    you're probably trying to input html or javascript in that particular textbox? ASP.NET has, by default, security settings for request validation. You can turn it off, though this certainly not recommended.

    Grz, Kris.

    Read my blog | Members are volunteers so please keep out the (it's urgent | asap | reply me directly) stuff. Nobody's interested in that.
  • Re: Server Error in '/' Application

    05-06-2008, 4:31 PM
    • Loading...
    • mjzammit
    • Joined on 05-06-2008, 3:47 PM
    • Posts 17

    Hi

    that is what i am doing exactly

    basically my aim is to find the line number of a particular tag name. How i am solving it is by placing the value of a tag in a textbox which then searches the html page and finds the line number, and i am getting an error as soon as i place the html in textbox.

    So how can i turn off the security settings for request validation? Is there another way, as you said it is not recommended?

    Please not that this web application is for my own personal use, to help me in my work. 

  • Re: Server Error in '/' Application

    05-06-2008, 4:38 PM
    Answer
    • Loading...
    • XIII
    • Joined on 06-30-2002, 11:59 PM
    • Essen, Belgium
    • Posts 9,556
    • Moderator
      TrustedFriends-MVPs

    Hi,

    You can disable request validation in your Web.config application configuration file by adding a <pages> element with validateRequest="false" or on an individual page by setting ValidateRequest="false" on the @ Pages element.

    This was taken from http://msdn.microsoft.com/en-us/library/bb355989.aspx.

    Grz, Kris.

    Read my blog | Members are volunteers so please keep out the (it's urgent | asap | reply me directly) stuff. Nobody's interested in that.
  • Re: Server Error in '/' Application

    05-07-2008, 5:30 AM
    • Loading...
    • mjzammit
    • Joined on 05-06-2008, 3:47 PM
    • Posts 17

    The problem was like you said, i had to place a validateRequest in the page directive.

    Thank you for your help :) 

Page 1 of 1 (7 items)