Hi,
I have a simple form which inserts a new Category with the given parentID (ServiceID).
and my parent child relationship is this;
Service > Category
my url for creating a Category based on the ServiceId is this
/Admin/Categories/Create/3 => "3 is the serviceID"
and my Action method is this
[AcceptVerbs(HttpVerbs.Post)]
pub...
My example:
I have a View that presents a set of div tags that has content populated from the datamodel.
[Multiple of these, with different location_id, naturally]
<div>
<a name="location_id"></a>
Content
</div>
Now, I have a form [in its own view] that submits content that adds another record to the datamodel. Once the reco...
When doing
return PartialViewResult(string viewName, object model)
where does the constructor for PartialViewResult look for a View? For instance, if we have two views with the same name in our Views folder (at different locations, of course). Which one he picks up?
What if we have two views named Create.aspx and Create.ascx? Does ...
I got Application.spark and home.spark views.
If layout has:
<span><use content="view" /></span>
And home has:
#RenderPartial("partial")
And partial has:
<div>test</div>
Then rendered output will be:
<div>test</div><span></span>
Any ideas what's wrong?
Using this spark version with updated System.Web.Mvc assembly.
...
I'm putting the unity container creation/setup in the global.asax. and making the container a static property on that class since i'm not sure how unity works or if the container needs to be kept alive and references elsewhere. What's the recommended location of unity initialization/configuration for mvc 2?
...
My checkout process has the following workflow:
checkout page
shipping address
edit shipping address(add/edit)
delivery method
payment
place order
Each of the above steps has its own action in the same controller.
Now the issue is, if the person gets to #5, and wants to edit the address, they go back to #3.
But when they hit submit,...
We have a ASP.Net MVC project that runs fine on our developer machines.
When we try and run it on a Windows 2008 machine we get the following error:
Error This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set e...
Hi,
i'm trying to create an attribute that i can set on my controllers action in which i can check if a user in some kind of role.
I know with standard asp.net authentication this is already possible, but i'm not using that.
So what i want to accomplish is this:
[Role("Admin", "SuperUser")]
public ActionResult SafeCourse()
I've cons...
I have a Page class and a PageCollection class in a 3d party ORM framework. I can fill the PageCollection based on parameters (pageid, parentid, url etc..) (SQL query). But I need the data multiple times around the ASP.NET MVC website (Sitemap, Authentication), so I chose to load all pages 1 time and reference that (global) collection.
...
I have just installed a ASP.Net Mvc application on a windows server 2008.
When I try to use the application I see that IIS 7 tries to use the static file handler, I therefore get a 403 or 404 error.
How do I get it to use the MVC handler?
EDIT
Have also tried asking this question on serverfault. It has a bounty here
...
I recently worked through Steve Sanderson's Pro ASP.NET MVC Framework and ran into an issue with the sample "SportsStore" application. SportsStore is a simple CRUD app that provides an editor to insert and update products in the store. Each product can have an image (which is stored in a SQL Server database, I know, maybe not the best id...
I have a roleprovider set up as follows using a DataContext. On my View, I have the following user Control...
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%
if (Request.IsAuthenticated) {
%>
Welcome <b><%= Html.Encode(Page.User.Identity.Name) %></b>!
<%= Html.ActionLink("Logout", "Logout", ...
Have an application were 99% of the actions will require user to be logged in.
The options I've come across are -
1-)Create a base controller inheritance chain and apply authorize attribute at that level. Something like: BaseController > AuthorizeController, BaseController > PublicController. (don't like this because of the inheritance...
I want most of my site to be Forms Auth, so IIS must allow for anoymous users. However I alsowant windows on the domain to be able to skip logging in.
So I'd like one route "/Login/WinAuth" to be set as requiring Windows auth. if this was a .aspx file I'd just change the security of the file in IIS and be set. But when using MVC I don'...
So for example in the code behind of a web form aspx page I would like to be able to do things like
string textBoxHtml = Html.TextBox("MyTextBox");
Is this possible?
Is the source code available to fork for webforms?
...
Hello,
I open a jQuery dialog, in this box I do a save/cancel. To Save, I call my controller, make some validation, save or throw Exception (MyPersonalException). If there is exception, I return an another View (the "MessageError" view) to display in the popup. I just want to see in the modal box the message available in "MyPersonalExce...
public ActionResult Index()
{
var tickets =
DependencyContainer.DomainController.ShowTickets();
if(tickets==null)
{
ViewData.Add("Error","Associate not found");
return RedirectToAction("Index", "Home");//Doesn't fire the index?
}
return View();
Home contro...
I know C# really well, just started playing with ASP.Net MVC a few weeks ago, and almost zero javascript. I saw some people here recomending jQuery, so I'll try that out.
What resources/tutorial should I start with?
...
I have an application that will support multiple sites. The site will be determined based on the url.
For example
http://myapp/site/abc123/...
and
http://myapp/site/xyz123/...
The site code will drive a lot of the functionality for example themes, available modules, etc...
Questions:
1-)I need to validate the site code is valid and...
Hi
I have two strongly Typed partial views (Developers list and Testers list) and the respective views are Developers.ascx and Testers.ascx
Now I want to load one partial view based on the radiobutton selected.
The below code is not working on radio button change.
Code Snippet:
$('input:radio[name=Type]').change(function() {
var u...