asp.net-mvc

Best practices for Language/Culture management in ASP.NET MVC application

This is a question about setting our website's Language and Culture settings with regards to the settings we read from the user visiting the site. Let's assume our website supports 2 languages, English (en) and German (de). Let's also assume we want to disregard locale (region) (at least on the server side, so we only know that we suppo...

how do i load thousands of rows in my asp.net mvc project from database into slickgrid?

All the examples except for the Ajax example creates random values with javascript. What is the standard way to load from database? I don't necessarily need to load using Ajax but i don't think i want to generate each value and write it out in the html or is that how it has to be done? ...

Passing parameters to ASCX user control in MVC

I am trying to pass a string parameter to an ASCX. I want to set this to the text property of a label. In the code below it shows betwen the div tags (ignore the % signs in the html tags). <@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<string>" > <%asp:Label ID="Label2" runat="server" **Text="<%# Model %> Test"** Cs...

HTML.DropDownList values from multiple sources?

In ASP.NET MVC, is it possible to fill the list of values of a Html.DropDownList from multiple data sources along with multiple manually entered values? Basically, I envision it being formated like the below using something along the lines of OPTGROUP: **Group 1** Manual Item 1 Manual Item 2 **Group 2** DS1 Item 1 DS1 Item 2 **Group ...

Get the RadioButton Value on click using jquery and disabling, enabling text boxes accordingly, Asp.net mvc

I have two radio button input type = radio name = "Level" value = "P" input type = radio name = "Level" value = "S" I have two textboxes: input type = "text" name = "inpu11" disabled = "disabled" input type = "text" name = "inpu12" disabled = "disabled" My question is, How Can I identify to which button I've selected ? How can I...

ASP.NET MVC Routing for Master / Detail Views with "Detail Children"

I have the basic Master / Detail Views working great with the default ASP.NET MVC Route; however I would like to build some URLs like this: /Class/Details/5 -- General Detail view [Working] What I'm not sure about (and I'm not tied to this URL format, just something roughly equalivent.) /Class/5/Details/Logs -- Detail View with Logs ...

Authentication for IIS content in virtual directory under ASP.NET MVC website

Hello. I have an ASP.NET MVC application for which I store uploaded content files in a virtual directory. This virtual directory is directly underneath my MVC website in IIS. My problem is that the virtual directory allows anonymous access. Anyone, logged in or not, can type in a public URL to my virtual directory and read the files in ...

ASP.Net MVC Cookies Best Practices

I'm looking for some guidance with respect to cookies in ASP.Net MVC (or just cookie handling in general). I have been storing authentication information about users who authenticate via a form login in a cookie. This is working great, but I now need to store a little more information in the cookie. This additional information is not rea...

When to use Singleton vs Transient vs Request using Ninject and MongoDB

I'm not quite sure when I should use SingletonScope() vs TransientScope() vs RequestScope() when I do my binding in my global.cs file. I have for example my call to MongoSession (using NoRM and the mvcStarter project http://mvcstarter.codeplex.com/) which is set to SingletonScope but I created a repository that use this MongoSession obj...

How can I get the client side date and currency formats?

I want to display dates and currency amounts in my users chosen format. How can I retrive this from the client machine? Alternatively, is there some other way to format dates/currency correctly? Thanks ...

ASP.NET MVC loading multiple partial views into a single div using JQuery

I am working on a help page which is composed of a navigation tree, content box, and search box. The navigation tree has links to Frequently Asked Questions and Glossary, each of which are linked to an Action which return partial views. To the right of the navigation tree I have a single content div that I would like to contain whicheve...

Wildcards with ASP.NET MVC MapPageRoute to support organizing legacy code

I'm working on migrating an existing ASP.NET web site into an MVC project. There are several (60+) pages that I don't want to rewrite just yet, and so I'm wondering if there's a way that I can: Move the existing .aspx pages (both markup and code-behind files) into a 'Legacy' folder in my MVC structure Set up routing so a call to /foo....

Problem switching culture

i have 2 links for switching culture. if i click one link, the program call a method with this code: Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo(ln); Thread.CurrentThread.CurrentUICulture = CultureInfo.GetCultureInfo(ln); return RedirectToAction("index"); If i look with debug the culture i...

Outlook 2010 ignores VALARM of Web calendar (ICS) generated by my application

Hello, My web application (ASP.NET MVC) exports ICS calendar (webcal://host/calendar.ics), which I'm testing with Outlook 2010 and 2007 now. Apparently, no matter what, VALARM section of the calendar is being ignored by Outlook altogether and no reminder is being set at all: BEGIN:VALARM TRIGGER:-PT30M ACTION:DISPLAY DESCRIPTION:Remind...

MVC Model Binding Confusion

I have not been using "model binding" in my MVC application -- that is, I haven't tried the thing of "mapping" form inputs to one or more classes in the Action parameter list, in the manner that is described in many places. Instead, I just send over parameters for each individual form field, or use FormCollection. I was thinking I might...

I wish to have a route named 'properties', but receive 404 error (Detects folder exists on disk)

Hey guys, I will try and be brief, I am finding when trying to create a custom route with a name and url of properties that my ASP.NET MVC app is returning a 404 file not found when hitting the route. I have deduced this down to most likely be caused by the fact I have a folder on disk called Properties which is of course a common asp....

How do you serialize a JS array so Asp.net MVC can bind it to a c# list?

I am trying to send a jquery sortable list of items to my MVC method for data processing. Currently I am trying to send it via the following code: var data = {}; data.projectId = projectId; data.publishedSectionIds = $('#section_list').sortable('toArray'); // Perform the ajax $.ajax({ url: '/Project/Publish', type: 'POST', dat...

authentication cookie

Using Asp.Net MVC 1, I have my "log on" control/page...I check the "remember me" checkbox and hit submit.. in my controller I have: FormsAuth.SignIn(userName, password, rememberMe) This method creates the persisted cookie .ASPXAUTH and everything is good at this point.. I put a breakpoint in other controller, and I noticed that once I...

passing values between views in mvc?

Hi I new on MVC. I want to send values between view's and don't know how do this? also I want send selected-item in grid to another view. ...

ASP.NET MVC and Cloud Hosting

Hi, Has anyone had any experience running an ASP.NET MVC (2) app in one of the (decent) cloud hosting services? Which providers support this? Additionally - how does session state work in these services - all ok? Thanks ...