asp.net-mvc

Passing ViewModel (containing request parameters) across Controllers

I have few questions based on following scenario: I have a LoginController with following methods: public ActionResult Login() { return View(); } [HttpPost] public ActionResult Login(UserObject user) { Calling Besiness Service to Validate User againts DB (Using Repository)... if (success) { return RedirectT...

Chrome developer tool warning on images

Possible Duplicate: Asp.net MVC page is giving Mime type warnings for image files I am working in my ASP.NET MVC app within VS 2010 and so I use the development server for this purpose. When I enable resource traking on Chrome Developer tool I am seeing a plethora of warnings regarding the images of my app. The warning says: ...

Radio button using Html.RadioButtonFor runs server code when clicked

How can I use Html.RadioButtonFor to create radio button which when clicked runs code on the server and controls visibility of certain text box. earlier I used to create <asp:control with autopostback="true" Thanks ...

Why i cant use Asp.Net DataAnnotation Validation with VS 2008

Hi Guys. I have a problem. I am developing Asp.Net MVC2 Application with VS2008 very well, but now I want to use the amazing DataAnnotion Validation shipping with Microsoft.MVC.DataAnnotation.dll. I cant find the dll so I found them on the project Site @ http://aspnet.codeplex.com/releases/view/24471#DownloadId=61772 I cant compile th...

I am getting This Error in Entib Library 5.0 using asp.net mvc

Hello Friends, I am getting this Error.. Here is my Web Config file looks like.. <?xml version="1.0" encoding="utf-8"?> <!-- For more information on how to configure your ASP.NET application, please visit http://go.microsoft.com/fwlink/?LinkId=152368 --> <configuration> <configSections> <!--<section name="spark" type="Spark...

ASP.NET MVC 2 Custom Model Binding Question

Background I have a payment page where the user can select from a list of existing payment methods, or specify a new one. The dropdown presents options such as: Visa - ******1234 (Saved) Mastercard - ******9876 (Saved) [New Credit Card ...] [New Electronic Check ...] Using jQuery, I toggle hidden DIVs that contain either an informa...

How can i highlight the current page on menu when using OutputCache with ASP.Net MVC 2 ?

Hi, I have a menu which is created from the database. When the users navigate through pages the current page is highlighted with the css class. Menu is rendered with the Html.RenderAction("Menu","Home"); Because of being datadriven menu i use the new ChildActionCache attribute which is in the ASP.NET MVC 2 Futures project to cache t...

DropDownListFor population problem

I have the following 2 classes: public class SomeClass { public int SomeClassID { get; set; } ... } public class AnotherClass { public int AnotherClassID { get; set; } public int AnotherClassText { get; set; } } I have a ViewModel that contains the following: public class MyViewModel { public SomeClass { get; set; } publ...

Is there any way to combine the output of two IHtmlStrings into a single IHtmlString instance?

I'm writing an ASP.NET MVC Html Helper which basically takes 2 HTML Helpers that return IHtmlStrings and combines them together and also returns them as an IHtmlString like so: //this doesn't work public static IHtmlString CompositeHelper(this HtmlHelper helper, string data) { //GetOutput returns an IHtmlString var output1 = new...

Asp.Net MVC: Can't delete Cookies that I get after Facebook Connect

I implemented Facebook-Connect successfully and Im able to retrieve User-Information using the Facebook Toolkit. But I cant sucessfully logout. When I press the facebook-Logout button (which automatically appears when Im logged in, because im using the autologoutlink-property) <fb:login-button autologoutlink="true"></fb:login-button> ...

Custom Data Validation Annotations - ASP.NET MVC2 C#

I have a viewmodel that partially looks like this... [Required] public int Year { get; set; } [Required] [Range(1, 5000000)] public int ModelID { get; set; } [Required] public int ZipCode{ get; set;} I want to add a custom validator attribute that checks a database to make sure...

How do I upload an image file using MVC2

Im trying to us a controller in MVC2 to upload a file but i get an object reference not set to an instance of an object error [HttpPost] public ActionResult AddPhoto(int id, FormCollection formValues, HttpPostedFile image, AlbumPhotos photo ) { AlbumPhoto photos = new AlbumPhoto(); UserPhotoAlbum ...

asp.net mvc: create a link to a web forms page and send some variables to it

I have a web-forms aspx page (reportviewer) inside a mvc application and I need to create a link to it (ActionLink asks for controller,action pair) and send to it a string and an int, anybody knows how ? ...

Multiproject areas in ASP.Net MVC 3

Does any one have any idea about multiproject area support in asp.net mvc 3? As it was degraded to future status in mvc 2. If it is still not included then should we look forward for ASP.Net MVC Portable Areas via MvcContrib. Can you share your expreriences? What are the recommended way for managing a large application? I read about MEF...

Folder/File browser with MVC 2 ?

How can you create a route that accept an undefined number of strings? The folder browser should be able to browse the specified folder and all the sub folders. Using JQuery to get the folders back from the server. The problem is how to build the JQuery? $.ajax({ type: "POST", url: "http://localhost:30218/Data/Fol...

asp.net mvc input / model validation multi language

I'm quite new to asp.net mvc, and right know I'm trying to find out a good practise to do input validation. In the project we're going to use entity framework, where you can add data annotations to properties in the following way: [Required(ErrorMessage = "Please enter a product name")] [Column] public string Name { get; set; } This...

R# "cannot resolve view" when changing the default location for views + custom ViewEngine for ASP.net MVC2

We have a project in ASP.net MVC2 were we have our own ViewEngine that overrides were views locations are. Problem is that Resharper 5.1 is not picking up this, of course. Is there anyone who knows of a way to extend R# to pick this up? I don't want to disable R# to not try to resolve view globally or local with the R# comment. I want ...

.Net integrating outlook in Web application

How can I integrating an outlook calendar in my web application for managing employees so that I can assign tasks to only those employees not on leave? ...

Can someone explain the purpose and use of the HttpContextWrapper/HttpContextBase classes?

Can someone also give an example of their use. Perhaps a link explaining them in greater detail? I understand it's for creating your own context objects and for unit testing, but would like more info on their uses. Thanks. ...

Action Class not getting called when doing Search through JQ Grid

hi I am using MVC 2.0 web application where there few buttons whose onclick i call a action method, but when i press search button for the first time , the action method is called but after that if i try to click the search button the action method is not getting called. Also let me tell you that i am using the JQ Grid to display the d...