.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

MVC3 Beta Interfering with Classic ASP Form Posts

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :ASP.Net

Unfortunately we have classic ASP that must co-exist with MVC in the same site. I'm doing some testing with MVC3 beta and ran into a strange issue with form posts in classic asp that does not appear in the the preview or in prior versions of MVC. To repro the issue simply create a stock MVC3 beta project and run it under IIS7.5 (Not the development server). Then add a couple of classic asp files; one that posts to another:


<form method="post" action="process.asp">
<input type="text" name="yada">

View Complete Post

More Related Resource Links

wcf 4 rest service accepts xml and json posts but get 400 bad request on form post


Using the rest 4 template.  I have a POST method defined, with an object as a parameter.  REST 4 does a great job of automatically mapping both xml and json posts to the method.  I tested this using an HttpClient test application to build and post xml content and then json content.  All data gets correctly mapped to the corresponding properties in my entity. 

I want to also support a standard form post to the method but am having problems! 

I'd like the same method already accepting and converting both xml and json to also work correctly for a form post.  I figured it would "just work" but no.

I am testing this by creating an HttpUrlEncoded form in the test client, adding form name/value pairs that match what the method is expecting, and trying to post it.

However I get a 400 Bad Request.  Here's some example code that is returning a 400 bad request:

Really straightforward but fails.  Ideas why? 


      var client = new HttpClient();

      HttpUrlEncodedForm form = new HttpUrlEncodedForm();
      form.Add("Id", "99"<

IE 9 Beta & InfoPath 2007 Form Radio Buttons Not Working



Has anyone else come across the IE9 bug that causes the radio buttons in the InfoPath 2007 forms to stop working (i.e. unselectable)?

Did you find a workaround (other than not to use IE9!)?



MVC3 Beta requires WebMatrix.Data?


Switching a project from MVC3 Preview 1 to MVC3 Beta 1 and getting the following error when running:

Compiler Error Message: CS0246: The type or namespace name 'WebMatrix' could not be found (are you missing a using directive or an assembly reference?)

This is on the home/index view which is generated from Razor. The generated class is:

Line 1:    #pragma checksum "C:\Dev\Furld\src\Web\Views\Home\Index.cshtml" "{406ea660-64cf-4c82-b6f0-42d48172a799}" "7DA68551EE4CE5365FE9A03790329360"
Line 2:    //------------------------------------------------------------------------------
Line 3:    // <auto-generated>
Line 4:    //     This code was generated by a tool.
Line 5:    //     Runtime Version:4.0.30319.1
Line 6:    //
Line 7:    //     Changes to this file may cause incorrect behavior and will be lost if
Line 8:    //     the code is regenerated.
Line 9:    // </auto-generated>
Line 10:   //------------------------------------------------------------------------------
Line 11:   
Line 12: 

MVC3 Beta Razor Views - not partial classes


Why are Razor views not generated as partial classes? Making them partial classes gives us the option to have a code behind where we can do some of the stuff we're forced to do in the template itself in the code behind file.

Yes, I know the standard "go-to" thing is Html helper but I don't want to use Html helpers for these things as they are too specific to the view in question and besides, having a clutter of extension methods is just not the way to go.

I'd like to see Razor views generated as partial classes.

MVC3 beta Razor View Base class/inheritance issues


There seem to be a few issues in the way Razor views are designed and the code generated

1. Descendants of WebViewPage are forced to override Execute() (since it is abstract) but that method is never called. Why?

2. The virtual method ConfigurePage is never called in descendants that override this method.

3. CreatePageFromVirtualPath is no longer virtual. This was the one method that gave us access to the Layout Page (Master Page) instance. Now we no longer have this access. Why was this done?

How can one get access to the instance of a Layout page?

MVC3 Beta Source Code


I cant seem to find the source code for the MVC3 beta release. The source code on the codeplex site hasent been updated in a few months. Is the MVC source repo somewhere else?



MVC3 Beta: Do deployment packages work?


Do deployment packages work in MVC3 Beta 1?
Mine seem to be created without any views.

MVC3 Beta @Html.AntiForgeryToken() problem



I am getting strange error when trying to use @Html.AntiForgeryToken() in my views.

The error is:

[ArgumentNullException: Buffer cannot be null.
Parameter name: buffer]
   System.IO.MemoryStream..ctor(Byte[] buffer, Boolean writable) +9638183
   System.IO.MemoryStream..ctor(Byte[] buffer) +6
   System.Web.Mvc.AntiForgeryDataSerializer.Deserialize(String serializedToken) +97

[HttpAntiForgeryException (0x80004005): A required anti-forgery token was not supplied or was invalid.]
   System.Web.Mvc.AntiForgeryDataSerializer.Deserialize(String serializedToken) +397
   System.Web.Mvc.HtmlHelper.GetAntiForgeryTokenAndSetCookie(String salt, String domain, String path) +160
   System.Web.Mvc.HtmlHelper.AntiForgeryToken(String salt, String domain, String path) +16
   System.Web.Mvc.HtmlHelper.AntiForgeryToken() +10

Am I doing something wrong. The request till this exception is raised is GET, not POST. I thought that on GET the token is generated and than is validated on post.

Please advice.<

PreApplicationStartCode in MVC 3 beta: Making MVC3 not very modular IMO



I am trying to upgrade from MVC 2 to Mvc 3. I am using 3rd party view engine, and 3rd party data access technology, and like to move code in from 'modules' at start up in my own bootstrapper.

But MVC 3 is playing tricks on me. It insists that I bring in System.Web.WebPages, System.Web.WebPages.Razor, WebMatrix.Data, because it uses the new asp.net 4 stuff to bootstrap the app domain with razor build providers, webmatrix database facades (and to be honest code I don't know about, and code I would like to know about at my own free will)

[assemblyPreApplicationStartMethod(typeof(System.Web.Mvc.PreApplicationStartCode), "Start")]

Is this design really optimal? It doesn't seem very modular that MVC 3 carries this much  
weight for users not using razor, webmatrix.data?


ASP.NET 4 and Visual Studio 2010 Web Development Beta 2 Overview

Many exciting changes for ASP.NET are coming in the .NET Framework version 4. This document gives an overview of many of the new features that are included in the Beta 2 release of the .NET Framework 4 and of Visual Studio 2010.

Visual Studio 2010 Beta 2

This is a big deal. This isn't ".NET 3.6" - there are a lot of improvements of .NET 4, and it's not just "pile on a bunch of features so you get overwhelmed." I've been working with and talking to many of the teams involved and even though it's a cheesy thing to say, this is a really customer-focused release.

ASP 4 - Whirlwind Tour around .NET 4 (and Visual Studio 2010) Beta 1

There's a lot of stuff that's new and added in .NET 4, but not in that "overwhelming-I-need-to-relearn-everything" way. More in that, "oh, this is way easier/simpler now" way. Like, moving data around with ADO.NET DataServices is easy, binding with client templates is easy, there's F# if you need it, the "dynamic" keyword if you need it, Silverlight's already installed, oh, and the parallel stuff will freak you out, but in a good way.

JQuery Validate plugin to validate a ASP.NET Form

The first time I used the JQuery Validate plugin, it did not work at all, see JQuery Validate odd behaviour with the ASP.NET Script Manager for reason, but perseverance and stubbornness prevailed and I finally created my first JQuery validated ASP.NET Forms contact form.

How to use getElementById to get the elements in a form

There are many ways of accessing form elements, of which the easiest is by using the cross-browser W3C DOM document.getElementById method. Before we learn more about this method, it would be useful to know something about the Document Object Model (DOM), the concept of HTML nodes or elements, and the concept of containers.

Each time you load an HTML page, the web browser generates an internal representation of the page in the form of an inverted tree structure. Let us look at a simple form. We will use this form later to demonstrate the use of the getElementById method.

Pocket TV Classic

PocketTV Classic is a Free software application that allows you to playback the common standard MPEG-1( .mpg) files on your Windows Mobile Pocket PC or other smartdevice. It is optimized to make use of the latest video acceleration hardware "2700G, ATI" and can playback videos in VGA resolution on VGA Pocket PC's I.E. Axim x51v/x50v, iPaq hx4700, Toshiba e800. A great tool to add to anyones collection.

Form view in ASP.NET


hi all...!
i have a database and i create a form with button edit,delete, New Registration..using Formview in asp.net..
everything was working good...

And i write SQL statement to get New ID number into dropdownlist/TextBox when i click button "New Registration".

i can get new(next) ID number after read database
it's also working good

Now i want change it to get ID which was deleted from table and replace the ID with new record...what i need is when i click "New Registration" i want get deleted "ID" first and then go to new record ID...

my code is here:-it working for get next ID after read database.

FROM Table1
AS boon WHERE PANG &gt;300000

Problem upgrading to MVC3 - System.Web.Routing



I'm trying to upgrade to .NET 4 and MVC 3.

When trying to compile my project, I get the error:

Error 1 The type or namespace name 'Routing' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) C:\Users\spencer\Desktop\weblauncher\Common\MVCConfig.cs 4 18 Common

The type or namespace name 'Routing' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

I do have the System.Web.Routing in my references for the project.

BUT - when I try to view System.Web.Routing in the OBJECT BROWSER, nothing is inside!  The System.Web.Routing namespace is not in there - the entire thing is empty!  Could it that the dll is corrupted?  I tried to reinstall the .NET 4 and MVC 3 stuff, but its still empty!

The dll is coming from here:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Web.Routing.dll

and the runti

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend