asp.net-mvc

ASP.Net MVC XDocument Html.Decode/Encode Help

Can someone explain the best way to handle this approach. I am using TinyMCE editor. The information typed into this is loaded into a XDocument and then written to the database as a string by doing XDocument.ToString() When I output the content to a webpage I load the string from the database into a XDocument, find the element and do a...

Execute .NET application (no-install) from webpage (intranet) and pass argument(s)?

Hi, i built an intranet on .NET MVC. I'm also building a separate planning tool in Winforms (performance choice). I would now like to 'open' the planning tool from the intranet (IE7) and pass an argument (e.g. Workorder number) so I can display the planning for that specific item. Is this possible? I have a .application file for the W...

Order of AuthorizationFilter applied to a controller/method

Hi, if I have two custom implementation of IAuthorizationFilter, and both of them applied to a method in a controller, how do we determine which filter is executed first? e.g. Declaration: public class MyAuthenticationFilter : FilterAttribute, IAuthorizationFilter public class MyAuthorisationFilter : FilterAttribute, IAuthorizationFil...

asp.net MVC Handle Partial Postback Response

I have multiple pages containing the same partial view. The partial contains a form that posts to an action. After a post I want to return to the page I was on before the post. What's the best way to do this? Example: Partial View: form post action = note/create/ Pages page1: products/index/ page2: customer/details/ page3: order/d...

How do I use Optional Parameters in an ASP.NET MVC Controller

I have a set of drop down controls on a view that are linked to two lists. //control ViewData["Countries"] = new SelectList(x.getCountries().ToList(), "key","value",country); ViewData["Regions"] = new SelectList(x.getRegions(country).ToList(), "id", "name", regions); /* on the view */ <% using (Html.BeginForm("","", FormMethod.Get)) ...

If I need to retrieve an object from a custom model binder should the binder interact with the service layer, the repository layer, or ...? Asp.Net MVC

If I have a class similar to this: public class Person { public string firstName { get; set; } public string lastName { get; set; } public Pet myPet { get; set; } } When I create a custom model binder, the Post from my form will not be sending in a Pet, it would send in data like this: firstName: "myFirstName" lastName: "m...

Passing ViewData versus making a new class.

I've seen several posts on StackOverflow and elsewhere discussing the various ways to bring together data from multiple entities into a strongly typed view, these being using the ViewData object or constructing a new custom class that utilizes both entities. To me it seems that if you are representing some sort of new hybrid entity you ...

Could not load type MvcApplication

I am only posting this because I couldn't find the answer anywhere and figured others might run into the same issue. If you are getting this error: "Could not load type MvcApplication", look at the Output path of your project and make sure it is set to 'bin\'. The problem is that the AspNetCompiler cannot find the files if they are not ...

Re-use business logic from MVC Application (DLL) in Reporting Services

I have a business object that compiles into a DLL that handles all calculations for my system for concepts such as eligibility, etc. The object also handles the connectivity to the DB via some wrappers around it. Is there anyway to take this .NET DLL and use it as a datasource for a reporting services report (SSRS)? We don't want to...

"Resource not found" error while accessing elmah.axd in ASP.NET MVC project

My ASP.NET MVC application is within a folder called Stuff within IIS 6.0 webroot folder. So I access my pages as http://localhost/Stuff/Posts. I had EMLAH working while I was using the in-built webserver of Visual Studio. Now when I access http://localhost/Stuff/elmah.axd, I get resource not found error. Can anyone point my mistake here...

Show "Loading..." in dropdown box

I'm running a database query to load a dropdownbox using jquery. Is there a way to display the words "Loading..." in the dropdownbox while the query is running? Thanks. ...

What's the way to know if the view is for GET or POST in javascript?

MVC use action attributes to map the same view for http get or post: public ActionResult Index() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public ActionResult Index(int id) { MyViewModel vm = new MyViewModel(id); return View(); } Question is: in javascript, how can I know if the view is for http get command or http post...

ASP.NET MVC in "web site project"

Hi all: I know that can co-exists with web form no problem as Hanselman mention here. However, we current have a "Web Site" project. I am just wondering if MVC would work in this kind of project instead of web application. ...

Search Form in asp.net MVC

I have an admin site in ASP.NET 2.0 which I want to convert to ASP.NET MVC. I created a DB assembly in C#/LINQ which will get me all the DB information. Now getting to the UI, my current site allows users to specify multiple criteria, like city, order date, ship date, product name, product id, sku, upc, etc. As ASP.NET MVC is a differe...

Creating strongly typed view with class in other project?

This is my project setup: In visual studio I have a solution with a class library project for my linq2sql and an MVC web project. I want to keep my models in the class library as I may build a windows app later. I am trying to create a strongly typed view and have Visual Studio create the edit and details page dynamically but I can't ...

User right for application data special folder in ASP.NET

I have a ASP.NET MVC application that runs in both IIS 6 and 7. The application requires special right and needs to run in a application pool with a special users that are part of of some specific groups. The application also stores a a lot of settings in a couple of XML files. These files are stored under "Application Data" special fold...

ASP.NET MVC FileStreamResult not working as intended

I have the following code which I stripped out of any non-essential lines to leave the minimun reproducable case. What I expect is for it to return the image, but it doesn't. As far as I can see it returns an empty file: public ActionResult Thumbnail(int id) { var question = GetQuestion(db, id); var image = new Bitmap(question.I...

How do I setup a Membership Provider in my existing database using ASP.NET MVC?

For some reason, the idea of setting up Membership in ASP.NET MVC seems really confusing. Can anyone provide some clear steps to setup the requisite tables, controllers, classes, etc needed to have a working Membership provider? I know that the Demo that MVC ships with has an Accounts controller. However, should I be using this in my ...

How to do Model Binding with Jquery Ajax

Hi, I'd like to use model binding to keep my controllers looking cleaner, you can see how much nicer it is using model binding: public ActionResult Create(Person personToCreate) { //Create person here } vs public ActionResult Create(string firstName, string lastName, string address, string phoneNum, string email, string postalCo...

What is the breakdown of all of the layers required/recommended for an Asp.Net Mvc Application following best programming practices?

The more I read into Asp.Net MVC the more layers and components I find out are required in order to make my application follow all of the standards and best programming practices. It's starting to get a bit confusing because some of the new layers don't seem to fit in as easily as the others I learnt. So I just wanted someone to go over...