asp.net-mvc

To Spark or not to Spark?

Been on a huge learning binge with ASP.MVC 2 lately, and recently uncovered there are different rendering engines out there... Spark especially caught my attention, couple of things though. I have vast knowledge with ASP.NET so is it worth the ramp up, in addition to ASP.NET MVC Is it worth it in general? Does it really matter? It ...

How do I allow reflection on a shared IIS host?

In this question a user replied that he was able to override the security settings on a shared host. I'm using the same host, but haven't been able to figure out how to change web.config to allow reflection. Is it a one-liner? I'm using MVC + Nhibernate in my project, but I can't even get an Mvc "new project" template site to work, I su...

ASP.NET MVC Object locking mechanism

Hi, I'm working on a ASP.NET MVC 2 web application that lets users edit parameters on a simulation and launch it. Once a user starts editing a specific simulation, it must be inaccessible to other users. Is there an easy way to achieve that goal in ASP.NET MVC? My first idea was to put the logged on user's identity in the Application ...

Can the MVC's parameter list be dynamic?

If: http://mySite/Users/9055 returns a db record where UserID=9055 (via the userController.getUserID method) And: http://mySite/Users/Smith returns the same record via the userController.getUserName method Isn't it reasonable to code a controller method that parses the either input? Seems like a great option to users - the u...

asp.net MVC database driven navigation menu

Hello all, can anybody point me in the right direction as to how I would go about implementing a hierarchical navigation menu which is driven by database? I don't want to re-invent the wheel here, so I was wondering if there is something that's already been done. I'm aware of the Menu control in asp.net, but from what I figure it won'...

How do I restrict access to pdf files on my server?

I am using ASP.Net MVC. I have restricted access to the web site using ASP Forms authentication. However, the web pages contain links to pdf files on the server which I also want protected. For example, the user can browse to foo.com and foo.com/account/logon. Once they logon they can access foo.com/category/bar which presents the view...

Dot Net Capable Build Servers

I want to set up a continuous integration / build server for a C# ASP.net MVC project. I'm aware of cruise control.net, what other build servers are out there and what are the advantages or disadvantages of each? Is there any particular one that is generally considered the one to have? ...

ASP.NET MVC Model , how to persist lable value

Hi all, Head scratching :( I am trying to bind one value to label and back to model from label , but not working I can see the value in View but after post action controller method Model is not having that value. Please suggest ! Can't Label values posted to the server like classic asp.net ? public class MyModel { pub...

ASP.NET MVC and LINQ to SQL: linking table, checkboxes

I am very new to MVC and from what I learned, I can have a form (a View) linked to a Model. Now I have a View for adding a new Client, so the View inherits from Client. I have something like this for each field <%= Html.LabelFor(model => model.FirstName) %> <%= Html.TextBoxFor(model => model.FirstName)%> <%= Html.ValidationMessag...

formElement is null with Mvc Client Validation

I'm getting a "formElement is null" when trying to use MVC Client Validation. Does anyone have any thoughts as to what could be the issue? Sys.Mvc.NumberValidator.create=function(rule){return Function.createDelegate(new Sys.Mvc.NumberValidator(),new Sys.Mvc.NumberValidator().validate);} Here is my model: public class EmailViewModel ...

How do you elegantly program ASP.NET MVC when the View needs more than one Model?

A View accepts one Model. But I need to draw HTML input controls for two models. An example will illustrate: I have a screen where I add Employees. After adding their first name, last name and so on, I need the user to choose a number of Companies the Employees could be in. The Companies are in one table. The Employees are in another. ...

ASP.Net: Generating a file to download

I have a file that I need to copy, run a command against the copy that specializes it for the person downloading it, and then provide that copy to a user to download. I'm using ASP.Net MVC2, and I've never done anything like this. I've searched around for the simplest way to do it, but I haven't found much, so I've come up with a plan. ...

How to return JSON in specific format in ASP.NET MVC using Json() with no property names

Hi, I am using a charting javascript library that expects its data in a specific JSON format - without property names. I have an object in my Model that I am using to return the data to the charts. This looks as follows: public class ChartData { public string Key { get; set; } public int Value { get; set; } } An action looks a...

Show breadcrumbs when Passing GUID

Hi, I'm working with ASP MVC 2 RC2 and using the standard sitemap provider. I'd like to show breadcrumbs on a page which passes a guid in the url e.g. /validate/GUID but i'd like the system to ignore the GUID and just show the (Home > Validated) for the page, as I don't want to dynamically re-create the sitemap each time I create a n...

Change culture in MVC

Hi, I'm using URL based localization logic in my MVC app. so, default route would be mysite/someControler, and localized route would be mysite/en-US/someControler. "en-US" is value for "culture" parameter which has default value. I'm wondering what is there any generic way to switch between cultures, and keep all the url route values...

Expose WCF in mef plugin with Asp.net MVC

Hi, I would like to implement the next scenarion: ASP.Net MVC working with MEF in a similar manner as described by hammet. One of the things i need to allow, is the MEF Plugin contains a WCF service (or asmx service - backwords comptability). What approach can i use - if any - to make the MVC website grab the webservice and expose i...

How do I prevent an ASP.NET MVC deployment on IIS 6.0, using wildcard mapping, from attempting to handle hidden share connections?

...

How is it possible that Request.IsAjaxRequest() is true from firefox but false from IE when using jquery post

i am trying to test jquery post. I am posting a form and want to update in ajax and replace with a success form over a div (seems like a common use case). The following code works fine in firefox but not in IE. One issue is that from Firefox Request.IsAjaxRequest() is true but coming from IE, Request.IsAjaxRequest() is returning fal...

Validating integer field with custom model binder in ASP.NET MVC

I ran into an issue that I thought was interesting. Take an input form that has an input field for an integer value (cost, in my case). I do not want "$100" or "Twenty Dollars" to be sent to the database as it will likely complain. I want to add an error to the model and send it back to the user. Seemed simple ;). I am using a cus...

I would like to convert Joomla CMS to ASP.net as there is no CMS like Joomla in .net. Would that be a good idea?

Hello friends I have this idea boggling my head since a long time. As a developer, I get a lot from the community and feel like giving back something to the community. And after knowing and working on Joomla i found Joomla CMS as the most flexible, easy and user friendly cms. As a developer, I like most of the features of it. ...