Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6881977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:11:49+00:00 2026-05-27T05:11:49+00:00

Vista, visual web developer express 2010, c#, asp.net, webforms. Running program with ctrl-F5. I’m

  • 0

Vista, visual web developer express 2010, c#, asp.net, webforms. Running program with ctrl-F5. I’m the only person who will ever run this program … and it will only ever run on my laptop using a local database.

Writing app to download web pages, view them, (do some analysis), log some results.
I found code to download pages – works well. I then set the text property of a textbox equal to the string contents of the page. That part also works. Then I went to run the code again, BUT the contents of the textbox gets validated and results in an error message.

A potentially dangerous Request.Form value was detected from the client (ctl00$MainContent$tbPageContents="
<!DOCTYPE HTML PUBLI..."). 

I can run the code over and over without problem – so long as I don’t display the results in a textbox. I tried a couple different solutions:

  1. I tried enabled=”false” attribute in the textbox … this allows me to view the first part of the code, but since the textbox is not enabled, I can’t scroll up and down and look at the file. So this doesn’t really solve the problem.

  2. I tried setting validateRequest=”false” in the page directive and in system.web (as per http://www.asp.net/learn/whitepapers/request-validation), but so far as I can tell it has no effect. That is, I still get the error.

  3. I tried using html encoding the string contents before I put them into the textbox. That works on the display … but it doesn’t fix the problem that it fails on the next iteration of the problem.

  4. I thought about catching the error and ignoring it, but the validation seems to happen before it executes my code-behind.

I don’t actually HAVE to print the page to a window to do the analysis, but it would be very helpful if I could look at this stuff all at once or in snippets. I could just do a page source from a browser. I’m not sure … maybe that’s the preferred solution.

I’m really surprised that option #2 did not work, as that seems to be the recommended solution.

Here’s the page directive I use:

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="wan._Default" validateRequest="false" %>

Is there something else one needs to do to stop the validateRequest?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:11:49+00:00Added an answer on May 27, 2026 at 5:11 am

    You should also use <httpRuntime requestValidationMode="2.0" /> in your web.config file. This instructs ASP.NET to change its validation mode to version 2.0.

    You may also like to see this question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Installed Visual Studio Web Developer 2010 Express from the ISO available from this page:
What OS would you choose for Visual Studio 2010? I have been running Vista
I just installed 'Visual C# 2008 Express Edition' and 'Visual Web Developer 2008 Express
I assume that the basic setup for ASP.net web development today is: Windows Vista
Having a strange issue with Visual Studio 2010 Professional (running Windows Vista Home Premium
Environment: Visual Studio Ultimate 2010 .NET 4.0 Windows XP, Vista and 7 We have
Vista SP1 Visual Studio 2008 SP1 .NET 3.5 SP1 C# I have a winforms
I'm using Visual Studio 2008 SP1 on .NET 3.5 SP1 on Vista Any time
On my machine (Quad core, 8gb ram), running Vista x64 Business, with Visual Studio
I'm basically wondering what the best way to deploy an Asp.Net Web Site is,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.