asp.net-mvc

How can I find all items beginning with a or â?

I have a list of items that are grouped by their first letter. By clicking a letter the user gets alle entries that begin with that letter. This does not work for french. If I choose the letter a, items with â are not returned. What is a good way to return items no matter if they have an accent or not? <% char alphaS...

AsyncController in MVC2 and T4MVC: can they work together?

Async actions in AsyncControllers (in MVC2) have two action methods (ActionNameAsync and ActionNameCompleted) which seem to confuse T4MVC. If it can't be done with T4MVC, is there a way to disable it from trying to include these methods? ...

Getting 404 on a simple controller

I'm creating a simple form to upload a file (which can be given a friendly name). I've gone over this code time and time again, but always get a 404 when the form posts to /MyEntities/Add (this is a post-only URL on purpose). Any thoughts would be much appreciated - I simply can't see what I've done wrong. The controller: public clas...

ASP.NET MVC - hiding id in URL?

I'm building a basic blog application just now, for viewing data I'm just using the default route, i.e. - routes.MapRoute ( "Default", // Route name "{controller}/{action}/{id}", new { controller = "Blog", action = "Index", id = UrlParameter.Optional } ); So that when you go to mysite.com/View/12 it displays the blog ...

ASP.NET MVC - Binding a Child Entity to the Model

This one seems painfully obvious to me, but for some reason I can't get it working the way I want it to. Perhaps it isn't possible the way I am doing it, but that seems unlikely. This question may be somewhat related: http://stackoverflow.com/questions/1274855/asp-net-mvc-model-binding-related-entities-on-same-page. I have an EditorTemp...

Convert my List<Roomtype> to SelectList for ASP. NET MVC DropDownFor<>, and get the correct values per option item

I have my class RoomType: Int32 Id String Name String ColorCode My viewmodel gets a List<Roomtype> RoomTypes which should be displayed in a dropdown. Each dropdown option item should have: 1) as title the Name, 2) as value the Id, and 3) the style background-color #ColorCode. My problems are how to convert this list correctly into ...

ASP.net MVC Linq-To-SQL Many-To-Many Field Binding

Possible Duplicate: Modeling a many-to-many relationship in ASP.NET MVC using LINQ to SQL Hi there, The short version of this question is "Is there a way to gracefully handle database insertion for an object that has a many-to-many field that has been set up in a partial class?" Apologies if it's been asked before. Example S...

SqlException: User does not have permission to perform this action.

I have been using my website (ASP.NET MVC) in visual studio but now I want to host it on my server. I published from visual studio onto the network share to be used. The server is running Windows Home Server, IIS 6 and SQL Server 2008 R2 (express). In Microsoft SQL Server Management Studio, I've attached the database and made sure that ...

Checking for nulls in ASP.NET MVC Controllers

Another opinion question: What is the proper (in your opinion) to check for nulls in an MVC controller. For instance, if you have an edit controller that fetches a record from the db based on an id, what do you do if that record is not found? I found this article, but I'm not sure I like that method. Do you just check for it with an ...

Writing a custom aspnet mvc action without an action

I'm looking to write a custom route that would allow the following http://localhost/blog/tags/foo Currently this is what actually works http://localhost/tags/Index/nhibernate I've tried the following with no success - any help would be appreciated routes.MapRoute( "Tags", "{controller}/{id}", ...

is there a performance different between passing something into viewdata compared to a view model

in asp.net mvc , if i shove a dictionary or an array of objects in ViewData and read that in my view compared to creating a view model class that has that same data structure, is there a performance difference or other consideration or should i expect the same response time? ...

ASP.NET MVC: Do I really have to create one view per action?

If I have a fairly crud-based area of my app, do I really have to create separate "Create" and "Edit" views? The HTML will be practically the same. I want an "Edit" and "Create" action to both render a "Show.aspx" view, but certainly Resharper 5 is complaining about there being no "Show" action. What's the best practice? ...

Store and retrieve html from sql server 2008 and display using ASP.NET MVC?

Hi all, I am trying to store HTML and hyperlinks in my SQL server 2008 database. I want to also be able to display the hyperlinks and render the HTML accordingly. I am trying to do this in ASP.NET MVC, so I tried using the HTTPUtility.HtmlEncode() method, but didn't really store it the way I wanted. So can anyone please guide me through...

Another question about ASP.NET MVC and a separate project for helper classes

I know this topic has been discussed to death, but there is one thing that I can't wrap my head around. I'm working on a Web Application using ASP.NET MVC and I come across a scenario where I need a helper class (this usually happens in the early stages of development. So I go ahead and create a helper project in my solution that I use...

Create serial number column in telerik mvc grid

I could create a grid with telerik mvc <% Html.Telerik().Grid(Model) .Name("ProductGrid") .Columns(columns => { columns.Bound(h => h.ProductName).Width("34%"); columns.Bound(h => h.Description).Width("60%"); columns.Bound(h => h.ProductID).Format(Html.Image...

Focus element inside iframe when iframe attached to Jquery Dialog

Hi, I have a iFrame which i load into jquery dialog. I want to focus an element inside the iFrame whenever the Jquery Dialog is being opened. Here is the code i am using to attach iframe to Dialog. $("<div id=\"srch" + options.winId + "\" title=\"" + options.windowTitle + "\" style=\"padding-left:0px;padding-right:0px;padding-top:0px...

Differences between Html.RenderAction and Html.Action

does anybody knows what's differences between Html.RenderAction and Html.Action? ...

How to Inserting message into View that depends on session value. ASP.NET MVC. Best practice

User have to populate multistep questionnaire web-forms and step messages depend on the option chosen by user at the very beginning. Messages are stored in web.config file. I use asp.net mvc project, strong typed views and keep business logic separated from controller in static class. I don't want to make business logic dependency on web...

I have made a Project Management Web Application in Asp.net MVC?But now I want to Make the Installer for this?

Hi Everyone, I have made a Project Management Web Application in Asp.net MVC?But now I want to Make the Installer for this? I have to Create one SuperUser While Installation? Any article how we can Made our Installers or add our steps to Ready Made Installers? ...

W3WP crashes when initializing a collection

I've created an ASP.NET MVC application that has an initializer attached to the PreApplicationStartMethodAttribute. When initializing, a collection is instantiated that implements an interface I've defined. When I instantiate this collection, w3wp.exe crashes with the following two incomprehensible entries in the event log: Faulting app...