views:

295

answers:

2

hi,

I just started working with ASP.Net MVC 2.

I created a new ASP.Net MVC application and created one vehicle controler with a database table connected with LINQ. Then created forms authentication mechanism for the application and tried to use the uri instead of cookies it was working smoothly but when i submit the form by creating a "Create" view from the controler using the utility it just dont work. The autherization got failed and asking to enter the user name and password again.I had created the authorization mechanism by adding Authorise attribute to the Controller so as to get authorized for all the actions.

namespace MVCNEW.Controllers
{    
    [Authorize]
    public class VehicleController : Controller
    {

But if i use the cookies instead of uri it works fine.

Thanks in advance...

A: 

Please see http://forums.asp.net/p/1517391/3634908.aspx for an official response.

Summary: Cookieless Session support is essentially obsolete, and the MVC framework isn't likely to include additional support for it.

Levi
A: 

I found the problem and a solution.

This was due to some error in the framework. They are not creating the Uri string for the Form action while calling

Html.BeginForm() 

But if we make it call overloading of this method like the providing the Controller name and Action name it is working fine.

view plaincopy to clipboardprint?

Html.BeginForm("Create","Vehicle") 
Rinto