asp.net-mvc

ASP.NET MVC bugs

What bugs have you experience while using ASP.NET MVC? As a first, The Html.DropDownList does not respect Selected property of SelectListItem when explicitly bound to List of SelectListItem. ...

How do I route images using ASP.Net MVC routing?

I upgraded my site to use ASP.Net MVC from traditional ASP.Net webforms. I'm using the MVC routing to redirect requests for old .aspx pages to their new Controller/Action equivalent: routes.MapRoute( "OldPage", "oldpage.aspx", new { controller = "NewController", action = "NewAction", id = "" }...

Problem in accessing localized string in ASP.NET MVC application

I created an ASP.NET MVC application and added 2 resource file for about.aspx page in the project. It looks like this: Then I modified the About.aspx page as following: <asp:Content ID="aboutContent" ContentPlaceHolderID="MainContent" runat="server"> <h2><%= GetLocalResourceObject ("About")%></h2> <p> <%= GetLocalReso...

Calling MVC Method from JQuery UI Dialog without AJAX

I currently make use of JQuery UI dialogs across my site. However, I've recently started to make use of the MVC TempData collection for notifications of success/failure of various actions triggered by my dialogs. Nothing particularly fancy or new. However, it's brought up an issue that I can't find a simple, obviously solution to. On so...

AutoSave a form inputs using jQuery + ASP.NET MVC

We would like to implement a web form that automatically saves content at regular intervals.Something similar to gmail/google docs auto save funcationality. Can some one suggest how to implement this using ASP.NET MVC + jQuery? ...

Localizing strings in master pages of ASP.NET MVC application

I have managed to localize the view pages in my application but there are master pages which contain some strings. It appears that the string contained in master pages has to be added in resource file of each page. this seems horrible. How can I elegantly localize the strings in master pages? ...

How to provide Calendar and Mail Services to asp.net mvc web site users

In our asp.net mvc based web site, we want to allow users to manage their calendar and emails. We don't want to develop these services on our own as there are too complex and time consuming. Are there any open source projects that we can adopt? Any other suggestions? ...

How can I implement this on asp.net or asp.net mvc

Me and my team are creating a portal on asp.net mvc. We want to create such an url for the users page : http://user.portal.com/ . How can we implement this in mvc or just asp.net. ...

Fetch userdata on each request

Hi! Gotta tell you... I've searched the internet for weeks now, and still haven't found a reasonable answer. My problem is quite simple - I think. I'm doing an ASP.NET MVC project. It's a project that requires the user to be logged in at all time. I probably need the current users information in the MasterPage, like so; "Howdy, Mark - ...

Why doesn't HttpPostedFile perform as advertised and buffer downloads to disk rather than memory?

I am uploading large files to an ASP.NET server using a standard HTML <input> control posting multipart-form data. This is an ASP.NET MVC application. According to MSDN, the HttpPostedFile class buffers to disk out of the box: "Files are uploaded in MIME multipart/form-data format. By default, all requests, including form fiel...

Subdomains in asp.net mvc

How can I programatically create a subdomain in asp.net mvc, and what ways are there for creating a subdomain? ex: user.mysite.com or mysite.user.com ...

Two-step view with ASP.NET MVC

Hi, I was programming in Zend Framework and now I am also using ASP.NET MVC. What I liked in Zend Framework is that the layout (something like Master page in ASP.NET world) is rendered AFTER the main content, so you can use html helper to insert javascript or require some css/js files while generating the main content and than the htm...

How would nhibernate handle tables that aren't really entities per say?

Hi, I understand how nhibernate would map a table like Users, and Addresses. But what if I have a table like: Users_Addresses with columns UserID, AndressID. Would I have to create a mapping for this and make it like a normal entity? It is really a table that I would reference in a inner join. ...

asp.net mvc decorate [Authorize()] with multiple enums

I have a controller and I want two roles to be able to access it. 1-admin OR 2-moderator I know you can do [Authorize(Roles="admin, moderators")] but I have my roles in an enum. With the enum I can only authorize ONE role. I can't figure out how to authorize two. I have tried something like [Authorize(Roles=MyEnum.Admin, MyEnum.Moderat...

How to get user input for Ajax.ActionLink call for action method?

Suppose I want to use ajax action link to save one field with no change for view. Here is my view(it is a strongly-typed view bound to type Model): <%= Html.TextBox("myComment", Model.MyComment)%> <%= Ajax.ActionLink("SAVE", "SaveComment", "Home", Model, new AjaxOptions { HttpMethod = "POST"}) %> Here is my Action for...

View-Specific Formatting Code in ASP.net MVC

Just some architectural question: I use ASP.net MVC and exclusively rely on Strongly-Typed Views with View Model Classes. As presentation is the job of the View, these Classes do not only contain some fields, but also some formatting functions, e.g., // The ViewModel contains a List<Comment> which the view.aspx iterates // through, cal...

ASP.NET MVC, autocomplete textbox, caching?

Using ASP.NET MVC, I've implemented an autocomplete textbox using the approach very similar to the implementation by Ben Scheirman as shown here: http://flux88.com/blog/jquery-auto-complete-text-box-with-asp-net-mvc/ What I haven't been able to figure out is if it's a good idea to cache the data for the autocomplete textbox, so there wo...

Creating search engine friendly URL's in ASP.NET MVC

I would like to develop URL's which look like the following: http://mysite.com/products/1/best-product-in-the-world Where all i need to get to the proper record is the following route: http://mysite.com/products/1 When I add the product description piece to the URL ("best-product-in-the-world") I get URL encoding issues. I've tried...

Render view to string followed by redirect results in exception

So here's the issue: I'm building e-mails to be sent by my application by rendering full view pages to strings and sending them. This works without any problem so long as I'm not redirecting to another URL on the site afterwards. Whenever I try, I get "System.Web.HttpException: Cannot redirect after HTTP headers have been sent." I belie...

how to debug sql server queries

I am trying to test some query so i tried running it inside of SQL enterprise manager and i get the following error: EXECUTE permission denied on object 'sp_enable_sql_debug', database 'mssqlsystemresource', schema 'sys'. any suggestions? ...