asp.net-mvc

Why do ActionLinks not show up in the design view?

Is there any reason why ActionLinks aren't rendered by the VWD 2008 design view? ...

Asp.Net MVC returning a Json from a string.

Funny as it can sound, I transformed my datatable data into a string which looks something like this: { blocks: [ {"fromAge" : "60","fromAmount" : "0","toAge" : "64","toAmount" : "65000","color" : "red","orderNo" : "2"}, {"fromAge" : "66","fromAmount" : "0","toAge" : "72","toAmount" : "12000","color" : "red","orderNo" : "4"}, {"fromA...

JQGrid Search form behind the transparent modal overlay window

This has got to be a stupid mistake but for the life of me I can't figure it out. I am trying to use the search feature from the navigator of jqgrid. When I click the search icon the form displays above the grid but then the entire area (grid and search form above it) are covered by a transparent search modal window. I am stuck at this p...

Is it Possible to Force a Login Depending on the IP Address?

I am trying to deter bots from surfing my pages. So I want to force a login from all Ip Address that are not the top 4 search engines. Is this possible? ...

Loading a Partial View in ASP.Net MVC using JQuery - which method is preferred?

In a very recent questions I was having problems with this. My code was: $("#SearchResults").load("/Invoice/InvoiceSearchResults/"); And I was advised to use this instead: $.ajax({ url: "/Invoice/InvoiceSearchResults/", type: 'GET', dataType: 'html', // <-- to expect an html response success: doSubmit...

What happens if you use a <script> tag with the same "src" attribute multiple times within a single HTML document?

Although I am almost certain the answer to this question will be browser specific, do any of the browsers define behavior for when multiple <script> tags are used and have the same src attribute? For instance... <script src="../js/foo.js"></script> ... <!-- what happens here? --> <script src="../js/foo.js"></script> The reason I ask...

ASP.NET MVC DropDownList UI Template

Hi, I have a ui template for the property ShopID in my Order class. Instead of displaying the ShopID as an integer in my dropdown I want to be able to display the ShopName from my Shop class but when I post back to the controller method I still want the Order class to have the selected ShopID. How would I do this? ...

Setting the masterpage in Page_PreInit for ASP.NET MVC?

In a regular ASP.NET application, I have an httpModule where I handle the PreRequestHandlerExecute event and hook into the page's PreInit event so I can programatically set the masterpage. However, when the application is ASP.NET MVC, my httpModule no longer does what it's suppose to do because the CurrentHandler inside PreRequestHandler...

Could not load type 'System.Web.UI.WebControls.DataBoundControlMode' from assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

I am working a little project for myself using ASP.Net MVC 2 Preview 2 and it works great locally but won't run on my dedicated server - I get the following error: Could not load type 'System.Web.UI.WebControls.DataBoundControlMode' from assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Looks li...

Custom Attributes on ActionResult

This is probably a rookie question but; Let's say I have an ActionResult that I only want to grant access to after hours. Let's also say that I want to decorate my ActionResult with a custom attribute. So the code might look something like; [AllowAccess(after="17:00:00", before="08:00:00")] public ActionResult AfterHoursPage() { ...

Google Chart HtmlHelper for Asp.net Mvc

Hi, Are there any HtmlHelper Extensions for Google Chart Api? (I like to use for some basic charts, e.g. Pie Chart, Bar Chart) Soe Moe ...

Integrate "Blog" module into asp.net mvc app?

Is there any open source blog engine code available on asp.net mvc written in c# language? I need to write a blog module for our application. I was wondering if any open source code available means i can use that. Thanks in advance. ...

How to get another user's profile in ASP.NET MVC?

I want to set a cookie with a user's timezone when they login. AccountController.LogOn() seems like the best place to do this. However, I can't yet read a user's profile there since I guess you only have access to profiles when the method completes. So, this code returns an empty string: Dim timeZone = HttpContext.Profile("TZ").ToStr...

Combine DataAnnotations Validation with complex business rules

I understand annotating class properties with the basic required and minimum length and getting all the benefits of the asp.net mvc server side and client side validation. However does anyone have a link that shows how you combine this 'base' validation with more complex business rules. How would I run business rule functions, such as ...

MVC2 .NET - Paging

Ok I know there is some code out there for pagination in MVC but it seems to be for version 1, Scott mentioned that he was goint to implement to code into the release of version 2. Was this code included? If so whats the best way to achieve pagination in MVC2? Thanks ...

DB connection failed while testing

Hi, I have an asp.net mvc application, which uses the default user database. It all works pretty well, but I would like to create some tests for it. I Have a test project, I immediately stumble upon an exception The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provide...

ASP.NET MVC 2 Preview 2 Route Request Not Working

Here's the error: The incoming request does not match any route. Basically I upgraded from Preview 1 to Preview 2 and got rid of a load of redundant stuff in relation to areas (as described by Phil Haack). It didn't work so I created a brand new project to check out how its dealt with in Preview 2. The file Default.aspx no longer ex...

How can I set up a Default Controller Route (When Controller name is not provided)?

I want to have URLs like below in my ASP.Net website: http://mysite/about http://mysite/faq http://mysite/bla I don't want to have a controller each for them. Is there any way I can set up a default controller scheme so that if a controller with a suitable name is not found, it will hit the default controller. Or is there an in-built ...

Asp.Net MVC View: Create and Relationship tables

I have a message board in ASP.Net MVC and when the user creates a new Post they must select a category, when I create a view (Create) the field (Categories) doesnt appear? The database has a middle table MessageToCatRel which contains a messageID and a CatId. I think this is what is confusing MVC. At the moment i am doing the following,...

Multiple Membershipprovider for one application

I have a site that uses the SqlMembershiprovider. Its is a webshop. The user logs on with his username and password there. Apart from that there is controller that is responsible for displaying delivery details for orders, that are imported from another system. These orders have no connection to users in the membershipsystem. To display...