asp.net-mvc

Is there anyway to in jeditable to removing submit button when using select

Can you have a jeditable select that submits on selecting the dropdown (instead of needing the extra 'submit' ok button. ...

ASP.NET MVC ActionFilter parameter binding

If you have a model-bound parameter in an action method, how can you get to that parameter in an action filter? [MyActionFilter] public ActionResult Edit(Car myCar) { ... } public class MyActionFilterAttribute : ActionFilterAttribute { public void OnActionExecuted(ActionExecutedContext filterContext) { //I want to a...

How can I return a 404 response from an ASP.NET MVC application?

I have a Controller that pulls images from a database, re-sizes them, caches the result on disk, and spits the image out as a Content() result. Recent I have added support for a "Scrape-buster" code on my site. That is, I take a hash of a unique code attached to each image plus some salt, and pass the first few characters of that hash ...

Asp.Net MVC MasterPage UserControl UpdateModel

This is driving me crazy. I'm not including any code because I want to know the best approach to do this conceptually without influencing the answer. In Asp.Net MVC 2 (beta 2010 incidently) I have a MasterPage Site.Master with a UserControl "SignIn". This user control has 3 fields that I want to get data from. The TextBox value "Email",...

what should a controller action look like if it just redirects?

I have a action that just does some db work based on the parameter passed into it, then it redirects to another page. What should the return type be then? ...

How to stop browser(espcially Internet Explorer) from doing super caching of javascript?

Hi I don't know what is going on but this is really evident in IE 8. It loads up my page and my javascript files. I then have debug lines in my server side code that should get activated when an ajax request from my jquery comes through. Or some other contact with the server such a refreshing the page. So I have this var timeout; va...

ASP.NET MVC 2 RC Validation problem

I am trying to use the validation capability of ASP.NET MVC 2 (RC) I have a viewmodel public class CategoryPageViewModel { public int Id { get; set; } [Required(ErrorMessage="Category name required")] public string CategoryName { get; set; } } action [HttpPost()] public Action...

ASP.NET MVC: Set parent foreign key while creating a child entity

Hi, I have: "Task" Entity that holds a foreignkey to a "Project" Entity. In the MVC model I have a ProjectDetails view where i have a ActionLink for creating a new Task I need to set the ProjectReference for the new Task object. The projectReference is passed by a url parameter (CreateTask?projectId=4) In the projectDetails view I ha...

Model for ASP.NET MVC

Hi I just started with ASP.NET MVC 1.0. I've read through some tutorials but I don't have any good ideas on how to build my model. I've been experimenting with LINQ to SQL. Can't say I like it that much, but I'll give it a try. I prefer using SQL Stored Procedures, but it doesn't seem to work very good together with the optional parame...

integrating chat application with asp.net mvc application

I need to integrate a chat application with my asp.net mvc (C#) application. The users of my application should be able to chat among them after accepting the invitations as like google talk Any best source for the integration of chat application? ...

How to get the selected value of a dropdown in the MVC View itself

Hi all, I have a drop down in a MVC View, which is some thing like this: Html.DropDownList(id, Range(0,10) .Select(x => new SelectListItem {Text = x, Value = x})) In the view itself, I need the selected value of this drop down. I know that I can access that in a JavaScript, but I am looking for a way to get it...

Another "is ASP.NET MVC right for me?" question

Here's my particular situation... I have a decent amount of experience with webforms, and I must say, a lot of it has been pretty frustrating. I like that there are lots of built-in controls, but then I discover that they don't quite do what I want, out of the box. I end up rolling my own controls (that inherit from the built-in control...

ASP.NET MVC and multiple environments

How does ASP.NET MVC, if at all, deal with or provide ways to create your application using multiple environments? For example: Development environment (local machine, probably run via the built-in web server and talking to a local database) Testing (runs against a preloaded databse with example data, although this part could be skipp...

Html.BeginForm() with an absolute URL?

I need to have the POST action be to an absolute URL (e.g., http://www.cnn.com). Is there a way to use Html.BeginForm() helper and pass it the url? ...

MVC routing for parent child relationships

I'm building an APS.net MVC 2 app, where I have a parent table and a child table. I've got the controller, view and model built for the parent table, so I can Add, Edit, View Details and dete records from the parent table. I using the following routing to do this: routes.MapRoute( "Default", ...

Using jquery in an asp.net mvc 2 editor template

I've created an editor templace in an mvc app, and I want to restrict the input of each text box in the template to only numbers. At render time, the template my be rendered multiple times on the page because the view could have multiple properties that are of type phone number, so the actual IDs of the text boxes will get unique names....

How to use resources with ActionLink?

How to integrate resources in an ActionLink? I want the title to to display a translation when I navigate to a route where I inject the culture-language. But I do not know how to get the translation into the ActionLink. ...

Does the JavaScript manager implementation exist for ASP.NET MVC?

I'm going to implement the load on demand technics for JavaScript code in ASP.NET MVC. Could you advice me the existing solutions and schemes for the platform? I've found the post about this subject in KAZI MANZUR RASHID'S blog What are the best practices for this task? ...

Passing object instance data to Attribute

Hi, I would like to pass certain data from an instance of an object to its attribute, and I have troubles inderstanding how to implement it. Here's a sample: [AuthenticateAttribute] public class MyController: Controller { UserInfo info; } The idea is that AuthenticateAttribute instance would populate the UserInfo instance. I want...

where can i download mvccontrib for asp.net mvc v1

i see that the codeplex site has moved to asp.net mvc version 2 already. http://mvccontrib.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=37422 will this work with version 1 also? if not, where can you download a build against version 1? ...