asp.net-mvc

Hint to MVC view generator for primary key on POCOs

When generating a strongly-typed Index view for my model I always get the following: <%= Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) %> I am using a POCO class for use with our ORM. As I understand it when using LINQ to SQL the view code will know which field is the primary key. Is there a way that I can an attr...

Telerik MVC Grid AJAX insert doesn't work within a TabStrip

I've the following case. I have a grid which is "ajaxified", selectable, sortable, filterable, editable, etc and works perfectly. On every grid selection a tabstrip is supposed to open presenting a few possible actions related to the specific selected row. The first strip element presents a new grid related to the first one (Let's assu...

How to check at runtime if a class implements certain interface?

Let's say I have some content classes like Page, TabGroup, Tab, etc. Certain of those will be implementing my IWidgetContainer interface - it means they will geet an additional field named ContainedItems from the interface and some methods for manipulating this field. Now I need to reflect the fact that some class implements this interf...

How I can build a ASP.NET MVC application than generate others ASP.NET MVC application?

How I can build a ASP.NET MVC application than generate others ASP.NET MVC application?. The part of write a new code es very easie but I'm really lost in a part to compile a new generate code. ...

How to dynamically set validation messages on properties with a class validation attribute

I'm writing Validation attribute that sits on the class but inspects the properties of the class. I want it to set a validation message on each of the properties it finds to be invalid. How do I do this? This is what I have got so far: [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] public class Li...

DataAnnotationsModelBinder with MVC2 RTM

Trying to validate models with DataAnnotations but DefaulModelBinder overrides my Required property error messages and never uses my error messages for invalid data entry. Always show 'value' is invalid for 'property name'. In another question I saw that MVC 2 uses DataAnnotationsModelBinder but I couldn't find any class in MVC 2 binari...

Silverlight, Grids, MVC, HTTP Post

I'm trying to create an editable grid using Asp.Net MVC 2 and Silverlight (specifically a grid that displays info from a db and allows users to update that info). So far I've managed to put a silverlight grid on an a view, using this technique However I have no way of getting the updated data from the silver light grid. Is there anyway...

asp net mvc client validation with partial views and AJAX

Hello, I'm using client validation function of the MVC 2.0 framework (with Html.ValidationMessageFor() and Html.EnableClientValidation()) Everything is nice, when I use the validation in a simple form. But when I get this form via jQuery AJAX $.get('PathToMyForm', function(htmlResult) { $('selector').html(htmlResult); }); clien...

JQuery UI (Dialog with Javascript)

Hi everybody, how's it going ? I'm trying to open an dialog component of jquery ui and load the content of the dialog with Ajax (partial view of asp.net mvc) and it's working good. But, the content of Dialog has some javascripts and when the scripts inside the dialog are executed, the behine page lost the style and content disapier sho...

ASP.NET MVC and NHibernate coupling

I have just started learning NHibernate. Over the past few months I have been using IoC / DI (structuremap) and the repository pattern and it has made my applications much more loosely coupled and easier to test. When switching my persistence layer to NHibernate I decided to stick with my repositories. Currently I am creating a new ses...

Malicious crawler blocker for ASP.NET

I have just stumbled upon Bad Behavior - a plugin for PHP that promises to detect spam and malicious crawlers by preventing them from accessing the site at all. Does something similar exist for ASP.NET and ASP.NET MVC? I am interested in blocking access to the site altogether, not in detecting spam after it was posted. EDIT: I am int...

How do link the first level like localhost/About and localhost/Faq.

I make Views/About/Index.aspx and Views/Faq/Index.aspx + Controllers/AboutController.cs and Controllers/FaqController.cs controllers for these purposes. I want to have one controller Controllers/DefaultController.cs + Views/About.aspx and Views/Faq.aspx in the root, for example. How to set it up? ...

Can I have two separate projects, 1 WebForms and 1 ASP.NET MVC, to both point to the same domain?

Is it possible to setup two separate projects, 1 WebForms and 1 ASP.NET MVC, to both point to the same domain? i.e. both point to different pages within www.somesite.com. Here's some background on the application and why I'm asking. This is a brownfield application that is currently 2.0 WebForms and is full of WebFormy 'goodness' (i.e....

Implementing a multi-state planner

I've been asked to develop a system wherein employees can mark on a form their availability on a given day of the week - for instance an employee could mark themselves as available on a given time on a given week, and unavailable on some other time. It looks a little like this: Currently this works by rendering checkboxes within the t...

Entirely custom authentification/authorization in ASP.NET MVC app.. good or bad idea ?

Hi gyus, I know what are you saying already (baad idea), but please read first :) I am developing ASP.NET MVC based app, which will require some specific features: combination of "local" users and facebook connect login, but FB users will be "mirrored" to some kind of local representation, because there will be some statistics and oth...

Trouble with ActionLink

Hello there, I wanna know if there's a way to do something like webforms .. Or a nice way to do this .. I have an ActionLink("foo", "fooAction") on my "Index" view. In this fooAction, I call a method that returns "True" or "False" and depending on the return, I have to give to the user, some feedback and return the "Index" with the same...

Selected value from drop-down list doesn't post from jquery dialog

I have a jQuery dialog. All of the fields are posting correctly except for the drop-downs, the value is getting passed as null rather than the selected value. <div id="popupCreateCompany" title="Create a new company"> <form> <fieldset> <p> <label for="company_name">Company Name:</label> <%= Html.TextB...

Asyncronously receiving data in an ASP.NET MVC application

I'm looking for the best way to constantly check if data has been sent to our ASP.NET MVC application from a server. I would like to asynchronously check for data and update the view when data has been read. I'm currently using a TcpClient to make a connection, and making the connection in the inherited custom base controller. Current...

MVC on Server 2008 R2 - How?

I have a new WIndows Server 2008 R2 x64 DataCentre with Framework 3.5 SP1 and Framework 4 installed. When I install my MVC application (VS 2008 MVC 2.0 using a Web Setup project installer) and browse to the application I get an error that System.Web.Mvc cannot be found. If I copy the relevant DLLs (System.Web.Mvc etc)into the bin directo...

Can't get new controllers or views to work in ASP.Net MVC

Basically what the title says. I created a new MVC application. I'm trying to add new pages to the site, but anytime I do I get the following error: Server Error in '/' Application. The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name c...