asp.net-mvc

Spring.NET Validation Framework setup with ASP.NET MVC

I'm starting a new project for work, and I decided I want to give MVC a shot. It's a small internal site for a commute challenge. I want to use Spring.NET for Validation. I have used Spring.NET before in Web Forms, but with no code behind as in traditional ASP.NET, how do I use the Page Validation framework Spring.NET provides? Edi...

Sorting jqGrid in ASP.NET MVC client view with jQuery and LINQ-to-Entities

I'm a jQuery noob, so I'm sure I'm missing something simple here. I've got the jqGrid working with an action that creates JSON data from a LINQ-to-Entities operation. But when I click on the column headers in the browser, the rows don't sort. The ascending/descending indicator shows up, but nothing else happens. The necessary JavaScrip...

MVC Authorization - multiple login pages

I have a the following methods in an MVC Controller which redirect to the login page when a user is not logged in. [Authorize] public ActionResult Search() { return View(); } [Authorize] public ActionResult Edit() { return View(); } Is there a quick/easy/standard way to redirect the second action to a different login page other t...

Is there a performance hit for using MDF SQL Server files instead of "database"?

Currently my website is written in ASP.NET Webforms using a SQL Server database. I am planning to build a ASP.NET MVC application not because it's better but because I want to learn the technology. My question is more specific to the database. I can create the database and import my SQL table via the import feature of the web interface t...

How to make ActionFilter on action method take precedence over same ActionFilter on controller

Since asp.net mvc has changed a lot since November, does anyone have a solution to this question: http://stackoverflow.com/questions/274039/resolve-filterattributes-on-controller-and-action Phil said an ActionFilter on a controller is just shorthand for applying the attribute to all action methods of the controller, and it is true, if ...

Determining which fields have changed on binding

How can I determine which fields have changed after model has been edited ...

Formatting data for jQuery Autocomplete results

I have some data which I am formatting like this: // ... imagine populating a SqlDataReader with some results ... var results = new StringBuilder(); while (reader.Read()) { results.AppendFormat("{0}, {1}\n", reader["name"], reader["emailAddress"]); } return results.ToString(); My controller action is pretty simple: public...

Is there a URL validator on .Net?

Is there a method to validate URLs in .Net (or ASP.Net, or ASP.Net MVC)? ...

ASP.NET MVC switch language, how to implement?

I have started converting my simple website to ASP.NET MVC, just to mess around with it. I have a switch language feature on there that basically sets the Session["language"] to another language and refreshes the page. Please correct me if this could be done better, but I have made two controllers for this and setting the session in ther...

How to handle different route value types between Actionlink and Controller Action

My Controller Action accepts int id. What to do when calling from View ActionLink with string id? ...

Role-Based Content asp.net mvc

Hi, I wish to display content depending on the given role(s) of the active user , in the ASP.NET MVC. Compare the old fashion way, using WebForms: protected void Page_Load(Object sender, EventArgs e) { if(User.IsInRole("Administrator")) { adminLink.Visible = true; } } Now how would I go on writing that when using the ASP...

Strongly typed master pages polymorphism - nested masterpages ignore inherit attribute

I'm currently creating a CMS system and found that the following doesn't work. I do have a work around that isn't exactly ideal and feels dirty. I'm cool with it for now and not really that interested in a different approach (but don't let that stop you answering). What I am after is some kind of explaination on why it doesn't work - is...

How do I create 3D pie chart? -Asp.net MVC.

I have seen Microsoft charting control @ here and here. It has good demonstration for displaying bar chart in MVC. On scottgu's blog There are plenty of examples but they are using server controls (i.e <asp:CHRT runat"server">. This is also supported in MVC by Modifying web.config. but as we should avoid using server control as postba...

ASP.NET MVC ModelBinder not working with GET requests and/or jQuery AJAX?

I seem to have a problem with getting MVC to fill in my custom model parameter when called through GET instead of POST. I have a JavaScript snippet that calls into an action like so: $.getJSON('<%= Url.Action("DoSearch") %>' + location.search, function(data) { if (data.Result == "OK") { location.href = location....

How to create Alphabetical list with letters?

Hi all I trying to implement alpha ordered list by columns as shown on picture But my algorithm is not clear and maybe someone could help me within string[] letters = new string[] { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "Å", "Ä", "Ö", "0-9...

Create ASP.Net membership database structure in existing database

How do I create all the ASP.Net tables, sprocs etc in a database that already has data (non conflicting) in it. ...

ASP .Net MVC - Images not being shown in published build

Hi there, I am developing an ASP .Net MVC application and on my dev machine, the application runs as expected and, more importantly, the images mentioned in the CSS file are displaying correctly too. However, when I publish this application to a testing server, the web app runs fine, but the images are not shown. If I modify the URL i...

How to create list splitted by columns?

How to implement splitting by columns alpha ordered list as shown on the picture? ...

MS MVC form AJAXifying techniques

I'm looking for most elegant way to ajaxify my forms (with jQuery). How do you do this? ...

What is the cheapest way to deploy an ASP.Net MVC application?

What is the cheapest way to deploy or host an ASP.Net MVC application? Any shared hostings? This is for a little toy application which I'll pay from my own pocket. Nothing entreprisy, the cheaper the better. ...