I'm currenty manage to get some time to work on ASP.NET MVC. I'm doing the
tutorial Create a Movie Database in ASP.NET MVC, which still uses the ADO.NET Enity Model. I managed to create a List View from the LINQ Entity Model. So here is my problem.
The Bind Attribute doesn't work on my SQL Entity.
Original Code with Ado.NET
pub...
I have an HTML <TABLE> displaying a list of items in the rows of the table. To add a new item to the list of items I have a form which submits the data to my controller via AJAX using Ajax.BeginForm. Once the action on the controller has finished it returns a partial view containing the markup for a new row to append to my table (eg. <...
My view has errors. I see these errors only if I open the view in Visual Studio.
I would like to see the errors on compile time rather than on execute time.
Does exist a way to obtain this behavior?
...
I tried the following:
I have a shared library (.dll) that contains these files:
Views
Search
PowerSearch.aspx
PowerSearch.aspx.cs
PowerSearch.aspx.designer.cs
The PowerSearch.aspx file contains my html code.
The PowerSearch.aspx.cs file contains this:
using System.Web.Mvc;
using CommonProject.Web.Shared.Controllers;
namespace...
Is there a way to change the root folder for the views to the bin/views folder?
...
I have created a base controller which overrides Initialize and sets a cookie and saves some data in the DB. Here I also need to check if a cookie is set and if it is not redirect to an error page.
Users of this site are coming from a store locater on another site which passes the store ID to me and I set it in a cookie. I need to make...
I'm using NHibernate for the first time and struggling. On web page one, I start a form. I want to save and navigate to page two. How do I update my RequestForm object with the ID of the newly inserted row? It is still 0 when I call the redirect, though the data was persisted to the DB.
Here's my controller code:
[AcceptVerbs(HttpV...
This question is very similar to 674458 but I really want to use the AutoMockContainer in my unit tests. I cannot figure out how to setup up my context.
Has anyone been able to unit test a controller that calls Url.Action using the AutoMockContainer?
...
Hi,
How can I pass a HTML element to a controller action. Let's say I have the following element:
<table id="list"></table>
How do I pass this table into the controller action? Also will it be automatically converted to HtmlTable object?
...
I'm trying to add Roles authentication to an Action in a Controller in an ASP.NET MVC application. The code looks something like this:
[Authorize(Roles = "SomeRoleName")]
public ActionResult Index()
{
bool inRole = User.IsInRole("Admin");
If I remove the Authorize attribute and put a breakpoint on the last line in that code sample...
I've finally gotten this working after days of struggle.
I've got a simple database of People and Departments:
I can use strongly-typed ASP.NET MVC views for reference/navigation properties! See the list of departments...
Part of my Person/Edit view:
<% using (Html.BeginForm()) {%>
<%= Html.Hidden("Id", Model.Id) %>
<fie...
I'm working through a previous webforms application to convert it to MVC and have one big issue that I can't seem to find any good resources about. I want the ability to capture the identity of the user (windows auth set in the web.config) but in the global.asax I can't seem to get access to session (but I can get the identity informati...
I recently converted an ASP.NET Website to an ASP.NET MVC Application and no longer appear to have access to the WCF REST Starter Kit templates when attempting to Add > New Item... Is it possible to use the two together or is the starter kit only available within a website?
...
Asp.Net MVC 1.0 project templates include an AccountController class, which supports constructor injection:
public AccountController(IFormsAuthentication formsAuth,
IMembershipService service)
{
FormsAuth = formsAuth ?? new FormsAuthenticationService();
MembershipService = service ?? new AccountMembershipService();
}
An A...
I am loading up some content via jQuery.load('/Business/Tags'), which works well when using my local webserver. But when using iis this does not resolve correctly. I have seen a couple different ways to get around this such as ResolveUrl. What is the best way to handle resolving urls in your javascript?
...
I am just getting started with Microsoft's Entity Framework, using it for an MVC project since MS seems to be really pushing it, and I'm running into some issues. In my database there are multiple lookup tables tied to a single table via foreign keys. Within the entity framework I am trying to combine these into one so that I have a simp...
When using ASP.net webforms my usual solution would have following type of setup -
MyCompany.MyProject.Presentation.MyWebFormsApp (asp.net web forms )
MyCompany.MyProject.Service.MyServieLayer (WCF/Web Service)
MyCompany.MyProject.Business.MyBusinessLogicLayer (class project)
MyCompany.MyProject.DataAccess.MyDALayer (class project/Linq...
Do the MVC Action Filter Attributes run, before the controller is instantiated? I have a property of the controller, that I would like to check from the ActionFilter. Is this possible?
...
In Alex James' blog post How to fake Foreign Key Properties in .NET 3.5 SP1, he explains how to add a Foreign Key property to an Entity Object.
I've used that to get a reference/navigation property working with a DropDownList in a strongly-typed ASP.NET MVC application as explained here:
Strongly-Typed ASP.NET MVC with ADO.NET Entity F...
Hello guys, I've found awesome using thickbox with asp.net mvc ....but now i need to use it with ajax and then....it displays only a blank page.
It is not loading the page inside of it.
This happens only on the ajax call...that i'm doing like this
<%= Ajax.ActionLink("GetFuncao", "GetFuncao?height=155&width=300&inlineId=hiddenModalCon...