I'm building a regionalized site each region has it own sitemap and own content.
The regions can be added at runtime.
Is there any way to add a sitemap provider at runtime?
I need multiple site map providers at once so that I can leverage the mvcsitemap without to many changes.
...
I have a website that has PageContent, News, Events etc and I have a controller that will handle the search.
In that controller action method I guess I do a var results = SearchClass.Search(searchstring) to keep the logic out of the controller.
However because I am returning different results because I am searching News, Events etc how...
I'm validating the properties of a linq to sql entity using DataAnnotations, the properties are validating fine but the Required[ErrorMessage="error message"] ErrorMessage attribute is being ignored and instead I'm getting the default error message.
Here's the code I have so far:
[DisplayName("Nombre")]
[Required( ErrorMessage ...
Hi people.
I´m have a problem using EF for my data model.
I have this code in my method:
listaPaginada = sortOrder.Equals("asc") ?
_cadastroServ.SelecionaNotasFiscais(idParceiro).OrderBy(i => i.GetType().GetProperty(query)) :
_cadastroServ.SelecionaNotasFiscais(idParceiro).OrderByDescending(...
With ASP.NET MVC 1.0 I always have been able to generate strongly typed links in my Views using a lambda function:
Html.BuildUrlFromExpression<TController>(c => c.Action(arg));
I'm now upgrading to ASP.NET MVC 2.0 beta and I can't find any strongly typed extension for the HtmlHelper (nor the UrlHelper in fact). Have they been replaced...
I am actually successfully running a production website with ASP.NET MVC under Mono in a Ubuntu LTS Linux. This server is located somewhere in the cloud and it rocks!
Today, I have tried to make it all work with ASP.NET MVC 2 Preview 2, which can be found here: ASP.NET MVC 2 Preview 2
I have downloaded the source code because I wanted ...
I have a page which has a partial view included within a div called test. I may request more content to be placed within this div by receiving back a PartialViewResult.
I want to be able to obtain the url of the page (i.e. what is shown in the address bar) from within the PartialView code but when I use Request.Url, it gives me the URL...
ie
new{@class="Model.Class"}
?
...
Hi all ,
I have to create a custom control that just renders scripts like object tag and some javascript file path ...
and this control is going to use by both MVC and asp.net webform application
please advice if this is possible.
...
Since this stuff is fair new I couldn't figure out any good reference on it.
I want to use reflection to enumerate through all the controller in my application. This is not hard using reflection. But since area come into place. How do I know which area (if any) does a particular controller belong to?
Maybe I am doing it wrong, maybe I ...
I would appreciate some suggestions about useful sources for learning the new features of MVC v.2 Beta .
and the real question is how to learn the features of the MVC 2 before release ?
...
I am looking to read other peoples software to learn how to produce quality, speedy, reusable code. If the code has JQuery in it that would be great because I am learning JQuery as well. Thanks
...
I have a couple different userTypes (Admin, User) and a MasterPage for each. I am beginning to create some Views that will be used by both userTypes where i would like to assign the MasterPage programmaticly (based on _currentUser).
Possible?
thx
...
Should an ASP.NET MVC Developer start to learn Silverlight either?
...
I am working on a ASP .NET mVC project & i have to change HttpHeaders. see the foolowing code snippet:
WebRequest req= HttpWebRequest.Create("myURL");
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
req.Headers.Add("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.15) Gecko/2009101601 Firefox/3....
I've followed the steps from http://memoryleak.me.uk/2009/04/umbraco-and-aspnet-mvc.html and integrated MVC in Umbraco with success, but i still have a problem which is critical for me.
Is there any way to inherit the Umbraco defined templates in a MVC view?
As I understand the problem is that the Umbraco templates become html only at ru...
If I'm coding in a View in Asp.net MVC and I want to get the current user, is it better to use
Page.User
or
HttpContext.User
Is there a difference?
...
I recently asked a question about using the Page.User or HttpContext.Current.User in the View. It was recommended I pass the user info through the Controller instead? I've seen this in other posted answer as well.
Why is it recommended to pass the user info through the controller and not use Page.User or HttpContext.User?
...
I'm new to ASP.NET MVC. After working with traditional ASP.NET model for so long, it's taking some time for me to get to understand this model.
I am going through NerdDinner to understand how things work.
So, I have an object that needs to be passed through couple of views. Similar to the article NerdDinner Step 6: ViewData and ViewM...
If I implement my own CustomPrincipal in asp.net mvc, must I use a Custom ActionFilterAttribute to check for Roles that my users belong to (like this: http://www.codethinked.com/post/2008/04/01/Setting-up-authentication-in-aspnet-MVC.aspx)???.
When I use:
[Authorize]
It works fine. But when I use:
[Authorize(Roles=("Example"))]
It...