I have created Viewpage outside the view folder and for that viewpage calling Model located inside the Model folder. but it is giving the error , I have also imported the namespace of Model .
...
Hi there,
I am just figuring out best practice with MVC now I have a project where we have chosen to use it in anger.
My question is.
If creating a list view which is bound to an IEnumerable is this bad practise?
Would it be better to seperate the code generated by the WCF Service reference into a datastructure which essentially hold...
Hi,
I just need to have the a small CMS-like controller. The easiest way would be something like this:
public class HomeController : Controller {
public ActionResult View(string name) {
if (!ViewExists(name))
return new HttpNotFoundResult();
return View(name);
}
private bool ViewExists(string na...
Hi,
I am really missing heavily the ability to test Views independently of controllers. The way RSpec does it.
What I want to do is to perform assertions on the rendered view (where no controller is involved!). In order to do so I should provide required Model, ViewData and maybe some details from HttpContextBase (when will we get rid ...
Using MVC 2, if I setup my root web.config with forms authentication (there is no locations section), and I go to a page outside an area (off of the root), I get redirected to the login page as one would expect. However, if I go to a page in an area, I don't get redirected as expected. Do I need an additional web.config somewhere in th...
Hi guys and girls,
I am just starting out with the Entity Framework 4.0 and ASP.NET MVC 2 and have a few questions regarding the use of stored procedures and paging.
You can map the Insert, Update, and Delete actions to stored procedures and I have already done this. However for my paging to work I need to map the Select action.
Now ...
I'm working with some third-party software that creates querystring parameters with hyphens in their names. I was taking a look at this SO question and it seems like their solution is very close to what I need but I'm too ignorant to the underlying MVC stuff to figure out how to adapt this to do what I need. Ideally, I'd like to simply r...
Ok the thing is that I am using asp.net mvc with linq to sql. I have a scenario where there are two tables group and features with many to many relationship with the third table groupfeatures. I have drag and drop all three table in the dbml file.
The thing is that it runs fine with group but when I call the Feature things the above err...
I am running into an issue when using my Castle Windsor Controller Factory with the new RenderAction method. I get the following error message:
A single instance of controller 'MyController' cannot be used to handle multiple requests. If a custom controller factory is in use, make sure that it creates a new instance of the controller f...
I'm occasionally getting this error during normal use, and I've not found a way to stop it without removing the attribute that requires the token, which I'd rather not do.
I've gotten this bug during my own testing (but seemingly randomly) and I know from my logging that actual logged-in users are getting it as well.
Does anyone know...
I am learning about best practices in MVC2 and I am knocking off a copy of the "Who Can Help Me" project (http://whocanhelpme.codeplex.com/) off Codeplex. In it, they use Castle Windsor for their DI container. One "learning" task I am trying to do is convert this subsystem in this project to use StructureMap.
Basically, at Application_...
Hi,
I am using MVC 2.0 to create my application,my problem i s related to the routing.
Actually in my application each user have required seperate subdomain,like www.example.com/user1/ ,www.example.com/user2/ ...etc.the default domain is www.example.com.So how can i make it possible with routing in mvc.
i have tried like thi...
I've got problem with binding data type boolean to checkbox in MVC 2 data annotations
Here's my code sample:
label>
Is Hot
</label>
<%=Html.CheckBoxFor(model => model.isHot, new {@class="input" })%>
It always raise this error message below at (model=>model.isHot).
Cannot convert lambda expression to delegate type 'System.Func<Framew...
I want to create a checkboxes hierarchy like this in mvc2.How would I be able to achieve this in the most simplest manner.I have done this with tree in traditional forms .Beside Each field there is a checkbox. If I want to Assign Manage User and Manage Feature to the Administrator I will checked the checkboxes press submit and then the f...
I use jqueryui-tabs to display a tabbed UI.
here is how my markup looks in a MasterPage:
<div id="channel-tabs" class="ui-tabs">
<ul class="ui-tabs-nav">
<li><%=Html.ActionLink("Blogs", "Index", "Blog", new { query = Model.Query, lang = Model.SelectedLanguage, fromTo = Model.FromTo, filters = Model.FilterId }, new{ title="Bl...
Hey everyone,
I'm developing a new ASP.NET MVC 2.0 application and wanting to use the new ASP.NET 4 encoding blocks.
My View code contains <%: Model.ActivityName %> however Visual Studio is reporting:
Unexpected token
at the position of the : (colon). When I run the application I get the following compilation error:
Compile...
Hey Guys,
I have a contoller that renders 3 different views. But I also have a common part (div) for every view. I thought that I can create an UserControl with own controller and include that control on my views (New controller and view as controll).
How should I use that UserControl? Should it be a partial view?
Or different approach...
Hi, I just upgraded to VS 2010 and MVC 2.0 and I noticed the web.config has two additional files attached to it? Are thee files used to specify debug and release specific settings, so you don't clutter up the main web.config?
Does it even make sense to place a connection string in the root web.config file if I have have a local and remo...
Hey
I was using this custom html helper in asp.net mvc 1.0 but now I am trying to use it in a 2.0 project and it crashes
http://blog.pagedesigners.co.nz/archive/2009/07/15/asp.net-mvc-ndash-validation-summary-with-2-forms-amp-1.aspx
This is the error I get.
System.MissingMethodException was unhandled by user code
Message=Method not...
This is customErrors section from my web.config file
<customErrors mode="On">
<error statusCode="500" redirect="HTTP500.aspx" />
</customErrors>
HTTP500.aspx is the same as standard /Views/Shared/Error.aspx page.
When I get HTTP 500 error I see this page:
Server Error in '/' Application.
Runtime Error
Description: An application...