asp.net-mvc

How can I send a json string to view as a json object?

I have a json string in an action of MVC controller. I want to send it to view as a JSON object. How can I solve this? public JsonResult Json() { ... some code here ... string jsonString = "{\"Success\":true, \"Msg\":null}"; // what should I do instead of assigning jsonString to Data. return new JsonResult() { Data = js...

Validation without UpdateModel

I have a an ASP.NET MVC2 application, with Linq2SQL, that updates a database without using the UpdateModel. Is it still possible to trigger validation without using UpdateModel? ...

Is it possible to Html Encode content that may or may not alreayd be encoded cleanly?

Hi all, I'm using ASP.Net 4.0 with MVC 2. I'm recieving user content that may or may not be Html Encoded already. I've read http://weblogs.asp.net/scottgu/archive/2010/04/06/new-lt-gt-syntax-for-html-encoding-output-in-asp-net-4-and-asp-net-mvc-2.aspx which was interesting but what I need is a way to ensure the content is encoded withou...

asp.net mvc viewmodels. How much logic (if any) should they contain

Hi, I've been looking into view models for mvc and I'm looking for the best way to do them. I've read loads of different articles but none seem to be clear as the "best way." So far example I might have a Customer model with the following properties: First Name Last Name Title Location Where location is a foreign key to a location t...

asp.net mvc validation message occured

Hello to everyone Please help I have below classes [Bind(Exclude = "Id")] public class Account { public Account() { User = new User {Account = this}; UserDetails = new UserDetails {Account = this}; } public virtual int Id { get; private set; } public virtual User User { get; set; } public virtual...

Retrive all data from mysql table using fluent nhibernate step by step process..

As i am a newbie to fluent nhibernate i would like to get step by step tutorial that explains configuring mysql with fluent nhibernate and retriving a table data from it... Any suggestion.... ...

good/simple asp.net mvc application with fluent nhibernate..

Where can i find a good/simple asp.net mvc application with fluent nhibernate? Any suggestion.. ...

How to convert model into url properly in asp.net MVC?

From the SEO standpoint it is nice to see urls in format which explains what is located on a page Let's have a look on such situation (it is just example) We need to display page about some product and decided to have such url template for that page: /product/{ProductId}/{ProductCategory}/{ProductUrlName}. And create for this purpose su...

asp.net mvc dataanoation validating url

can some one tell me how can i validate a url like http://www.abc.com ...

asp.net mvc keep alive page with a flash on it / ping controller

I have page in my asp.net mvc website with a flash app on it, and the user can stay on that page for hours, but his auth cookie/session is going to expire, so I'm thinking to create a PingController and to call it using jquery $.post each 20 minutes. is this a good idea ? or there is something better ? ...

How to call a Web Service from the Controller?

I have an asp.net MVC2 application that needs to call a web service from the controller. How do I do this? It is a RESTful service that returns Json data. I cant seem to find a good example. Thanks ...

pass ActionLink parameters to perform GET

Hi All, Is there a way to perform a GET and pass parameters using Ajax.ActionLink <%= Ajax.ActionLink("12", "ActionMethod", new { id = 1} ... Currently, the line above performs a POST. Thanks, rod. ...

How can I use partial views in ASP.NET?

I have done partial views in ASP.NET MVC but now I want to convert it to ASP.NET. I have used AJAX and JavaScript. How can I convert the following: <a href="#" onclick="LoadPartialView('#MainContentDiv', '<%=Url.Action("AdminHome", "Admin")%>')">Home</a> , <input type="button" value="Submit" onclick="LoadPartialViewPost('#Ma...

Does ASP.NET MVC require you to use master pages?

My group is working on a new web application and is considering using MVC. However, there are members who would rather include pages than use master pages. Is this possible to do in ASP.NET MVC? In the small amount of time that I've poked around with MVC I have not yet been able to figure out how one might accomplish that. ...

Converting asp.net timer triggered update panel to MVC

I'm in the process of converting my asp.net app to asp.net mvc. I'm using a master page which contains a div that currently renders a partial view. This partial view displays the model data that I want displayed. I saved the "best" for last and that is to convert an asp.net timer triggered update panel to MVC. I'm an asp.net MVC new...

ASP.NET MVC: null reference exception using HtmlHelper.TextBox and custom model binder

I have written a class which implements IModelBinder (see below). This class handles a form which has 3 inputs each representing parts of a date value (day, month, year). I have also written a corresponding HtmlHelper extension method to print out three fields on the form. When the day, month, year inputs are given values which can be p...

Opinions on commercial MVC controls

We are interested in the communities opinions on commercial MVC controls ie Telerik, Syncfusion. Which is fast, easy to use, stability, documentation, support and all that good stuff. We are about to start our second MVC project and are currently doing research into improving functionality and speed of development to 'standard' MVC. A...

How do I add a confirmation popup on a button (GET POST action in MVC)?

I have a get/post/JSON function on an aspx page. This page adds data entered in a textbox to a table populated by javascript. When the user select the submit button. If the textbox is not empty, have a popup button telling the user the data in the textbox is not saved in the table. How do I have a confirm "ok/cancel" popup display on ...

Localization with separate Language folders within Views

I'm trying to have specific folders for each language in Views. (I know this isn't the best way of doing it but it has to be this way for now) e.g. /Views/EN/User/Edit.aspx /Views/US/User/Edit.aspx These would both use the same controller and model but have different Views for each language. In my Global.asax.cs I have routes.Map...

ASP.NET MVC 2 - Html.DropDownList not working in an AJAX form

I am trying to create an MVC 2 solution and I have run into the following problem: Index.aspx: <% using(Ajax.BeginForm("Forms", new AjaxOptions{UpdateTargetId="form", HttpMethod="POST"})) { %> <h3>Input: </h3> <p><%= Html.DropDownList("dropDown")%> <input type="submit" value="Select Mission" /></p> <% } %> HomeCon...