asp.net-mvc

Using a colon (:) in return URL with Forms Authentication ("The return URL specified for request redirection is invalid")

I am getting the error "The return URL specified for request redirection is invalid" when using forms authentication. I found this thread that says this is a known issue with return URLs that contain colons (mine indeed contains a few). The workaround in that thread is to catch the error and use a default return URL ... hardly an accept...

IAuthenticationRequest.RedirectToProvider is not supposed to return, yet it does

The method DotNetOpenAuth.OpenId.RelyingParty.IAuthenticationRequest.RedirectToProvider() is documented never to return: Redirects the user agent to the provider for authentication. Execution of the current page terminates after this call. However, it does return under the latest implementation (3.4.3). I'm using the followin...

How to keep views free of authorization logic in mvc?

I have a view to display a list of items. The user can edit, delete or create new items, but according to their authorizations they may or may not be allowed to do some of this actions. I have the requirement to display only the actions which the current user is allowed to do, but I don't want to clutter the views with authorization if...

ASP.NET Membership vs SQL Authentication

For ASP.NET MVC extranet applications, what are the pros and cons of using SQL Authentication instead of the ASP.NET Membership API to handle security? ...

Render string as a "label" instead of "input" in ASP.NET MVC 2 using UIHint?

I tried UIHint("Label") but it doesn't change the behavior. If someone also can point me to a list of possible values for UIHint, that would be awesome! ...

asp.net MVC binding specific model results in error for post request

Hi I'm having the following two actions defined in my controller [Authorize] [HttpGet] public ActionResult Edit() { ViewData.Model = HttpContext.User.Identity; return View(); } [Authorize] [HttpPost] public ActionResult Edit(User model) { return View(); } However if I ...

Can I connect to SQL from JavaScript MVC?

I am populating a list of names that will be added to my Sql Database. In this simple case, how do I send the information to SQL server without my page being refreshed? <script type="text/javascript"> function addNewRow() { $('#displayPropertyTable tr:last').after('<tr><td style="font-size:smaller;" class="name"></td><td style="fo...

mvc and entity framework, display results of linq query

I want to return the results of a query that is written in linq to my view page for a MVC application. I want to call my view, then pass the model, the model would have the results of my query. How can I do this? ...

Hiding and showing fields still validates hidden fields with ASP.NET MVC 2 Client Side Validation

I've got a form as part of an e-commerce checkout process which has a section for billing address which allows the user to use their delivery address or to fill in an address in the form. If the user selects to use their delivery address I don't show the address fields. I've added validation for all fields then on the server side I che...

Issue with Autofac 2 and MVC2 using HttpRequestScoped

I'm running into an issue with Autofac2 and MVC2. The problem is that I am trying to resolve a series of dependencies where the root dependency is HttpRequestScoped. When I try to resolve my UnitOfWork (which is Disposable), Autofac fails because the internal disposer is trying to add the UnitOfWork object to an internal disposal list ...

Beginner to asp.net.. What should i choose webforms or mvc?

Possible Duplicates: Advice on using ASP.net WebForms or MVC How to decide which is right, WebForms or MVC when doing ASP.NET I am new to web development and asp.net... I was going through asp.net website and 'n' number of question here in stackoverflow regarding Webforms or MVC.... But still as a beginner can't get an idea ...

The data types text and nvarchar are incompatible in the equal to operator

Hi there. this is my code ProductController.cs public ActionResult Details(string id) { product productx = productDB.products.Single(pr => pr.Product1 == id); return View(productx); } Details.aspx <td> <%-- : Html.ActionLink("Edit", "Edit", new { id=item.Id }) % --> <%: Html.ActionLink("Details", "Deta...

Duplicate method 'ProcessRequest' in ASPX

I'm trying to code ASP.NET MVC views (WebForms view engine) in F#. I can already write regular ASP.NET WebForms ASPX and it works ok, e.g. <%@ Page Language="F#" %> <% for i in 1..2 do %> <%=sprintf "%d" i %> so I assume I have everything in my web.config correctly set up. However, when I make the page inherit from ViewPage: <%@ Pag...

asp.net mvc encode on form post

Hello, I'm using a rich text editor in my asp.net mvc form (nicedit with a textarea) and when I submit the form on post, because it is not html encoded I get the following message: "A potentially dangerous Request.Form value was detected from the client" . How can I html encode the textarea on post ? I don't want to cancel the validation...

Rss: Bookmark is not working correctly.

I'm working on project RSS generation in MVC.Net. in taht i want to make bookmark. for that i have write the code on controller. first there is one aspx page from which subscription page gets open. public ActionResult ViewBlog() { if (Session[SessionVariables.username] == null) { return Re...

Using Microsoft Chart Control in ASP.NET MVC Returns a Blank Image

Using the answer Generating the Image from a Controller from this post, I created a controller action to return a chart image as seen below (the X and Y values are just there as test data): public FileContentResult HistoryChart() { Chart chart = new Chart(); string[] currencies = { "ZAR", "USD", "GBP", "JPY" }; ...

rss bookmark not working

I'm working on a project for RSS generation in ASP.NET MVC. In that I want to make a bookmark. For that I have written the code on the controller. First there is one aspx page from which the subscription page gets opened: public ActionResult ViewBlog() { if (Session[SessionVariables.username] == null) { return RedirectToAction("...

mvc views not found when using mvc combined with webforms CMS in asp.net

We have a website build in the umbraco 4.1 cms (webforms) default .net 3.5 And we have some MVC tools and controls build with MVC2.0 on .net 4.0 i've managed to let the umbraco cms run in .net 4.0 and i've been following parts of this guide (for mvc 1.0 and umbraco 4.0.3) but now i'm stuck, umbraco has alot of url management itself, s...

Dynamic view pages

i'm working on mvc.net..i want to create dyanmic view pages..it is possible?if yes then how?plz help ...

data model problem

public ActionResult Index() { testEntities6 devicesEntities = new testEntities6(); List<DevicesModel> devicesModel = new List<DevicesModel>(); var device_query = from d in devicesEntities.device join dt in devicesEntities.devicetype on d.DeviceTypeId equals dt.Id join l in devicesEnti...