How do I get VS 2008 Professional Edition's Add New Project dialog box to show me the ASP.NET MVC 2 project type? It currently shows me only the MVC 1 project template (ASP.NET MVC Web Application).
I have both versions of MVC installed.
...
I have this code here where I retrieve an attachment from an Email Message that is on the Exchange Server using EWS
Attachment attachment = message.Attachments.Single(att => att.ContentId == Request.QueryString["cid"]);
attachment.Load();
FileAttachment fileAttachment = attachment as FileAttachment;
...
In the controller:
public ActionResult Index()
{
ViewData["page"] = 0;
return View(data);
}
public ActionResult More(long page = 0)
{
ViewData["page"] = page;
return View(data);
}
So, I have two views: Index.aspx and More.aspx. I created a partial view (PartialView.ascx) that is used in both of the views. Inside the p...
I'm new to Silverlight and I've used it to create a simple datagrid that I'd like to include as part of a view within an ASP.NET MVC View (while using the existing master page layout).
What's the best way to do this? I haven't been able to find any examples...
...
Hi,
I'm creating a site with 2 different sections (main site and admin) and both of them need authentication.
I have the main section already created and it works fine using FormsAuthentication.
now, how do I go about creating the admin section? Can I use FormsAuthentication again?
thanks
...
From my jQuery file, I call a function from my controller which returns a Json object, as below:
[AcceptVerbs(HttpVerbs.Get)]
public ActionResult MatrixTypes()
{
var matrix = Enum.PricingMatrixType();
return Json(matrix);
}
The call is made by the following function, I'm posting only ...
hello all, can anyone help me?
senario is..
I have UserController(UC) and Browse View in MVC, In browse page I have three buttons and thats why i have written javascript to call perticular method in UC, now within UC I am sending data to Model (which is comming from View) and I am able to search from m...
I'm keen to teach myself ASP.NET MVC 2 (coming from a heavy embedded or rich GUI background). If have found the nerddiner walk-through but it is still for ASP.NET MVC 1. The codeplex downloads have been updated to MVC 2 but the link for the PDF goes back to the MVC 1 book.
Is it even possible to follow the walk-through in MVC 2?
If s...
Assuming you wanted to develop your Controllers so that you use a ViewModel to contain data for the Views you render, should all data be contained within the ViewModel? What conditions would it be ok to bypass the ViewModel?
The reason I ask is I'm in a position where some of the code is using ViewData and some is using the ViewModel. I...
if so, how should i pass the parameter? would a string matching the enum name be ok? This would be handy if I was passing a dropdown box that matched enumerated items.
It would be useful to use a solution presented in this answer if I could just as easily bind to the enum when I submit the data back.
...
Hello,
Anyone out there using the new CSHTML pages feature and is finding that they prefer this new view engine syntax over the existing ASP.NET MVC default view engine or over web forms, and if so, why? What about CSHTML gives you an advantage over MVC or web forms, or vice versa?
Just curious to hear people's take on it.
Thanks.
...
In my little app I've a strongly typed partial view (the Login Form) this is rendered within the Masterpage, this looks as follows:
<!-- Login Box -->
<div class="login">
<div class="login-bg clearingfix">
<% Html.RenderPartial("LoginViewControl", Model); %>
</div>
</di...
When moving to MVC, and now IIS7, we started having issues in that our HTTP Module that opens and closes the ISession was called on every request (static files, etc.). I wanted to avoid doing a full rewrite of NH session management, so I implemented this code in my module, to filter out everything but requests going to the mvchandler:
v...
I want to allow two types of authorization in my .NET MVC 2.0 app. One would be good old-fashion id/password (forms authentication) but I also want to be able to look at the header of the request page for an id/password as well. If that's provided, I want to authorize based upon that, by pass the form authentication and allow the user i...
what are the best online tutorials available for ASP.NET MVC.
...
i have read a few different things, it sounds like output cache will not cache a different copy of results for each user. so if user A has 3 menus and user B only has access to 1 of them, then caching the view result would show all 3?
how can i cache things for each user so that it's not shared?
thanks!
...
I came across an issue when I was testing my HTML Helper. Basically I'm creating a grid with loads of rows, columns and different types of data in it. In the header there is also a image to notify the user what column the data is sorted by. However, when I'm writing my test now (way too late, but better late than never right?!), I get th...
I'm working on an MVC.NET 2.0 project where I'm trying to put in some special error handling logic in the OnException method of the controller. Basically I want to be able to determine the result type of the controller method in which the unhandled exception was raised, so that I can return error data in a certain format dependent upon ...
I have action method like that:
public ActionResult Index(HttpPostedFileBase image, int variable)
and form element like that:
variable 1:<input type="text" name="variable" value="1234" />
when I start debugging I am getting following exception:
The parameters dictionary contains a null entry for parameter 'variable' of non-nul...
I'm starting a new web application that will be made of multiple parts or modules.
My client want to be able to redistribute the application with a subset of modules to some other clients. I read about Areas in mvc2 which seems to be what i'm looking at.
I would also like to develop those modules in side projects and have the right one b...