asp.net-mvc

Need a working example of a cascading drop down list written in vb.net

I Need a working example of a cascading drop down list box written in vb.net for my ASP.Net MVC application. I tried converting three examples written in C# but can't seem to figure it out and I have given up. The examples I have tried to convert are found here and here. This is my first .net application so I'm a newbie. The biggest ...

Binder for long{} in MVC

[AcceptVerbs( HttpVerbs.Post )] public JsonActionResult<BaseAsyncResponse> Add( long[] IdList ) { for (int i = 0; i < IdList.Length; i++) { // do something } } var o = { url: addButton.action.url , method: addButton.a...

Handle View permissions in BaseController

I have a Pages table that stores all my view urls and this table has permissions linked to the user's role. My controllers inherit of a BaseController so I was wondering where I intercept the request and then return a InvalidPermissions view. ...

Stored procedures not called in Entity framework using asp.net MVC

I am trying to use the stored procedure mapping feature in Entity Framework to perform the insert update and delete functions. For whatever reason the procedures are not being called. They are correctly mapped, and supposedly all I have to do is call SaveChanges(); in my controller for them to execute. Using this tutorial as a referenc...

How to build ASP.NET MVC user controls into class libraries

I'm trying to build some .ascx controls into a class library for plugins for a CMS I'm building. My project type is a typical C# class libary with references added for system.web.mvc & friends. My problem arises in trying to create a strongly-typed user control. My control looks like this: <%@ Control Language="C#" Inherits="System.W...

any clear guidelines and best practices on using JQuery and ASP.NET MVC together?

Are there any clear guidelines and best practices on using JQuery and ASP.NET MVC together? articles, blog posts, books? not just MVC, but on the connection between them and known good ways and patterns of making them work together. ...

What's the standard for safeley and legitimacy for bringing in contacts from other websites? (ie. Facebook, Twitter, Gmail, etc...)

check it out: http://www.chillitickets.com/CustomerOffer.aspx Using Facebook as an example: Is the Facebook logo enough for it to be considered legit/safe login or is a full redirect to Facebook required? I know Facebook is trying to push Facebook Connect, but I'm not sure if they still allow this kind of thing or if it's something th...

Posting HTML within an ASP.NET form

I am using Master Pages in an ASP.NET MVC app that lets you submit HTML data as part of a form. Even when I set <%@ Page ValidateRequest="false" %> Or set <pages validateRequest="false"> ... </pages> in my web.config file i still get the same error: A potentially dangerous Request.Form value was detected from the client... De...

Implementing document management with an ASP.NET MVC front-end

I've implemented a website for a client that holds editable articles. I used ASP.NET MVC and made the content manageable by storing it in a 'Content' table in the database and creating a simple Admin section of the site, where the user can add/edit/remove content and choose where on the site it will appear. Now the client has come bac...

ASP.NET MVC how to implement link which returns to previous page?

Title said it all. Some context: I got a search mechanism - search view, search results view and a details view (which represents one item of results, like a formview in webforms). I want a link in details view, which would return user to search results view. Ideas: Just read about TempData, but i guess that wouldn't help, cause user...

How do I setup this(Moq Setup)

Hi I want to test my part of code that returns the users password question. So I have made a mockup of the Membership provider using MOQ. I don't think I need to show you the actual code just the test part of it. // Arrange var membershipMock = new Mock<MembershipProvider>(); membershipMock.Setup(m => m.GetUser(...

How to show different view sections in an object oriented way

I'm developing a website in ASP.NET MVC where I would like to show different sections of a view for users with different security levels. In essence, the views are the same, but users with higher levels of security must be able to see sections that shouldn't be seen by users with security levels above of, for example, administrators. I ...

How can I generate ASP.NET MVC URLs inside a unit test project?

How can I generate the URLs corresponding to the controller, action, and parameters (for a given ASP.NET MVC project) in another project (a class library used for testing)? All I have found so far is HtmlHelper.GenerateRouteLink, but didn't find yet how to pass the correct request context and route collection. ...

ASP.NET MVC on Windows 7 RC and paramterized routes not working

Take a new MVC App, then code: routes.MapRoute("a", "a/{id}", new {controller = "Home", action = "A"}); public ActionResult A(string id) { return Content(id); } Going to http://localhost/a/sdfdgh results in: HTTP Error 500.19 - Internal Server Error The requested page cannot be accessed because the related configuration data for ...

How to know if asp.net 3.5 sp1 and asp.net mvc are installed in the server?

When I use: System.Environment.Version The result is "2.0.50727.3053" I know that 3.5 is compatible and in IIS is identified as 2.0, blah blah... I would like to know the exact .net version installed and if another resources are installed, like ASP.NET MVC, etc. The problem is that the website is installed in a shared hosting, so I...

jQuery not working with Html.ActionLink?

Hi guys, I know this is wierd, but I am using ASP.NET MVC, I have real simple jQuery on 2 views. One view is the Home page and the other is an item details page. This page is opened using an Action Link on Home Page. The jquery on item details page does not fire at all. $(function() { alert('Fired!'); $('#contact').hover...

Does duplicate id's screw up jquery selectors?

If I had two divs, both with id="myDiv" Would $("#myDiv").fadeOut(); fade both divs out? Or would it fade only the first/second? Or none at all? How do I change which one it fades out? Note: I know duplicate id's is against standards but I'm using the fancybox modal popup and it duplicates specified content on your page for the conte...

Html.ActionLink problems

I am trying to provide a link to filter search results. <%= Html.ActionLink("Filter Results", "Index", new { page = Model.RestaurantList.PageIndex(), searchText = Model.SearchText, useFilter = true, filterOption = Model.FilterOption, filterText = Model.FilterText }, null)%> The controller definition is as such public ActionResul...

trying to create a asp.net mvc viewpage w/o codebehind page

Hi, Trying to create a view page in my asp.net-mvc app. I have a strongly typed view, and I have also ovverriden the MVCPage class also. For some reason when I load the page it says it can't load the type: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Line 2: Inherits="Blah.MyViewPage<Blah.ViewDataForB...

programatically generating a link in asp.net-mvc

Hi, How can I just get the URL link to a specific route programatically? I want to do a response.redirect (URL TO ROUTE); ...