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

  • SEARCH
  • Home
  • 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 8889483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:16:25+00:00 2026-06-14T22:16:25+00:00

Using: Visual Studio 2010 with ASP.net 4.0 I have a website which uses URL

  • 0

Using: Visual Studio 2010 with ASP.net 4.0

I have a website which uses URL rewriting and I want to keep the rewritten URL on Postback. I’ve read a lot of the topics on this subject and I still haven’t been able to figure out if this is possible.

For example:

http://localhost/ActualPage.aspx?PageID=4

Is rewritten as:

http://localhost/member/forum.aspx

The page contains a number of controls which use a Postback (for example a Telerik RadGrid with sorting and paging). Normally when the postback takes place the browser is redirected to the unrewritten url – the address bar shows /ActualPage.aspx?PageID=4 etc. In this scenario everything works correctly.

However I want to retain the rewritten URL after the postback, so I have coded to change the Form.Action property to be the rewritten URL like so:

Page.Form.Action = "/member/forum.aspx"

Now the page correctly retains the URL in the address bar but throws a "Validation of viewstate MAC failed" error when the postback occurs – which I would expect it too as the viewstate originated from a different URL.

Strangely this problem occurs even when enableViewStateMac is set to false (either in the page or in the web.config) – but I don’t want to disable this anyway.

Effectively I think what I need to do is tell the page / viewstate mac authorisation that is it ok to accept input from this alternative URL but I can’t find anyway of doing this. I’ve tried different URL rewrite system to see if that makes a difference, and i’ve tried added a generated machineKey – neither of which has made any difference. Is there any way of doing this?

In short I want:

  • Rewritten page with postback going to the rewritten URL
  • ViewStateMac enabled
  • No viewstate validation errors

I remember in earlier versions of .NET using a .browser file with FormRewriterControlAdapter but this doesn’t seem to make any difference in .NET 4 (I don’t remember if it successfully retained the URL anyway).

  • 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-06-14T22:16:27+00:00Added an answer on June 14, 2026 at 10:16 pm

    I have found a solution – it turns out the problem was actually unrelated and masking itself as a ViewStateMac issue.

    Previously I had been redirecting all the URLs to one page, doing a database lookup and then using Server.Transfer() to deliver the correct page to the browser. The real problem was being caused by using Server.Transfer() – which it seems is recognised by Microsoft to be an issue when working with the viewstate.

    I have made adjustments so IIS performs the database lookup, the entire rewrite and therefore Server.Transfer() is not used – and the original problem I had has been resolved.

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

Sidebar

Related Questions

I have a asp.net website with c# code behind and using visual studio 2010.
I am using visual studio 2010 Express. I have created a website in asp.net.It
I have a ASP.net MVC2 website that was working great when using Visual Studio
I have converted text to Image(.png) using ASP.NET C# in Visual Studio 2010. But
I have a web page in ASP.net and C# (I'm using visual studio 2010
Visual Studio 2010 MSSQL 2005 Windows Vista I am creating an ASP.NET website using
Using ASP.net and c# using visual studio 2010 Hi all, I hope some one
We are developing a REST based application using Visual Studio 2010, using asp.net web
First of all, I'm using Visual Studio 2010 (Visual C#) and ASP.NET. I'm working
I'm going to be building some ASP.Net MVC 2 software using Visual Studio 2010

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.