asp.net-mvc

ASP.net MVC Paging

I have textboxes loaded with data on my ASP.NET MVC page. If the user clicks the Next button I need to load the textboxes with the relevant data. Similarly I have Next, Prev and Last buttons for record navigation. I have no idea on how to implement this. If it is JQuery how I can implement it? How do I implement it in ASP.NET MVC? ...

Asp.Net MVC: Forms being block elements

Basically, having multiple forms in a row isn't possible so far as I've seen. LastUpdate Given the situation with phones and the unpredictable nature of how most the browsers render the page, I think I have to go with multiple buttons per form. Not super happy with this since it feels like a WebForms hack for MVC ...

How to config Asp.net Mvc for redirecting every request to configuration page?

For Asp.net Mvc project, I need to redirect every request to configuration page when user(should be admin of this website) visit this website at the first time. This operation like default login page(every request will be redirect to default login page if access denied). After user config the configuration file, Route table will be map...

How to implement HandleError Filter on an Ajax Request?

When an exception occurs in an action called from an Ajax Request, the default HandleError filter can not work correctly. Can someone help me solve it? ...

Decimal values with thousand separator in Asp.Net MVC

Hi, I have a custom modal class which contains a decimal member and a view to accept entry for this class. Everything worked well till I added javascripts to format the number inside input control. The format code format the inputted number with thousand separator ',' when focus blur. The problem is that the decimal value inside my mod...

Is there an equivalent of JavaScript Generators in ASP.NET MVC?

I am migrating a MonoRail application to ASP.NET MVC and I was wondering if there's an equivalent to brailjs and njs. There's similar concept in Ruby on Rails. Currently I use ASPX view engine but maybe switching to Brail Views could bring a solution. Any suggestions? ...

Why are my pages still not gzipped?

With the help of YSlow I'm trying to tune my pages a bit. I thought it would be little effort for big gain to have my pages compressed. After trying everything from here, here, here and here YSlow is still showing my pages are nog compressed. I'm using asp.net mvc 1.0 on IIS6. With the following rules in my global.asax I make sure that...

Proper submission of forms with autogenerated controls

Based on: http://stackoverflow.com/questions/658458/mvc-html-checkbox-and-form-submit-issue Let's consider following example. View: <% using(Html.BeginForm("Retrieve", "Home")) %> <% { %> <%foreach (var app in newApps) { %> <tr> <td><%=Html.CheckBox(""+app.ApplicationId )%></td> </tr> ...

Binding a simple sort dropdown to a list in MVC.

Hi guys, Im trying to bind a dropdownlist in ASP.NET MVC to a class. Luckily for me this will be a number between 1 and 10, however I'm not getting the output in my HTML that I would expect. I've set both the value and text properties which are populated ok in the View, but the selected value refuses to render. This is within the initia...

Where is ASP.NET MVC documentation?

The main page (asp.net/mvc) only seems to have a getting started guide and tutorial, plus videos, but I'm not able to find a proper documentation (classes, methods etc). Any link that can help me? Thanks ...

How to remove 'Details' in MVC URL Routing, but leave other actions intact?

I would like to set up a route for a controller that has the normal CRUD operations, but would like the Details action not show 'Details' in the URL. Stackoverflow seems to have this type of routing configured: http://stackoverflow.com/questions/999999/ http://stackoverflow.com/questions/ask Using this analogy, my routes currently loo...

ASP.Net MVC Toggling IsAjaxRequest property based on file upload?

I have a form all setup to upload a file and that is working fine. However the way my form is submitted is through AJAX. The button that submits is still a type="submit" in case JS is off. When I save my form the controller determines whether the IsAjaxRequest is true and if so returns some JSON otherwise it does a RedirectToAction. ...

Sending Multiple Items to MVC Controller via jQuery.Ajax

If youa are serializing a form using something like jQuery, it will often map the JSON keys and values to the properties of a object on the Controller Action you are posting to. So: jQuery: function PostForm() { $.ajax({ url: "/Home/TestMVC", type: "POST", dataType: "application/JSON", data: $('#for...

ASP.Net MVC & jQuery Form Plugin Uploading a File

Can someone give me an example of how to do this with ASP.Net MVC? I have followed the example at their site on the file uploads tab but I cannot get a decent response back. My controller thinks that it is not a AJAXRequest and tries to do a RedirectToAction but that doesn't change the page after the post. ...

ASP.NET MVC, a plugin architecture and id collisions

So I have been waxing lyrical about a ASP.NET MVC to a friend who is about to start development of a new user interface.... He asked me if you could solve the following problem with ASP.NET MVC: Imagine a web app that supports plugins. In the current ASP.NET WebForms app the pluggin developer provides a usercontrol and some JQuery. The...

Trouble getting ASP.NET MVC app to redirect to error page for unauthorized users

I've got the following set up in the web.config of my ASP.NET MVC application: <authentication mode="Windows" /> <authorization> <allow roles="MySecurityGroup"/> <deny users="*"/> </authorization> <customErrors mode="On" defaultRedirect="Error.aspx"> <error statusCode="401" redirect="Help.aspx"/> </customErrors> Everything...

How do I get jQuery's Uploadify plugin to work with ASP.NET MVC?

I'm in the process of trying to get the jQuery plugin, Uploadify, to work with ASP.NET MVC. I've got the plugin showing up fine: With the following javascript snippet: <script type="text/javascript"> $(document).ready(function() { $('#fileUpload').fileUpload({ 'uploader': '/Content/Flash/uploader.swf', ...

Redunancy elimination in ASP.NET MVC Actions

Is this action too redundant - is there a better way to simplify it? [Authorize, AcceptVerbs(HttpVerbs.Post)] public ActionResult ChangePassword(string oldPassword, string newPassword, string confirmPassword) { var oldPasswordValidationResults = _validatorProvider.Validate<IStringLengthValidator>(oldPassword); oldPasswordValidat...

What happened to Html.ActionLink<TController> in ASP.NET MVC?

I'm reading all of these blogs about using the Html.ActionLink method with lambda expressions. I even saw a ScottGu presentation about it here: http://www.hanselman.com/silverlight/ScottGuAtAltNetConf/ Here's a blog: http://blog.wekeroad.com/blog/aspnet-mvc-preview-using-the-mvc-ui-helpers/ Here's a ScottGu blog about it: http://weblo...

How do I set set per-action parameter defaults in ASP.NET MVC?

I'm working on an application that was birthed during the Preview 2 days of ASP.NET MVC. It's pretty dirty in places, and I'm trying to clean it up. One problem I'm trying to overcome is overly verbose code. For example, I have a ton of methods that look exactly like this, but with different default sort parameters. Page and pagesize...