I'm setting up T4MVC for MVC 2 on my website. I get 2 build errors:
No overload for method 'RenderAction' takes 3 arguments in T4MVC.cs
and
No overload for method 'Action' takes 3 arguments in T4MVC.cs
These are the ones in the T4MVC.cs file:
public static void RenderAction(this HtmlHelper htmlHelper, ActionResult result) {
...
Im using the following code:
public string RenderPartialToString(ControllerContext context, string partialViewName, ViewDataDictionary viewData, TempDataDictionary tempData)
{
ViewEngineResult result = ViewEngines.Engines.FindPartialView(context, partialViewName);
if (result.View != null)
{
Strin...
Hi,
I am trying set up a simple dropdown list but I dont seem to be able to get it to bind to the Model.
I am using Asp.Net MVC and nhibernate.
My dropdown list is declared like so:
<%= Html.DropDownListFor(model => model.Project, (IEnumerable<SelectListItem>)ViewData["Projects"], " -- Select -- ", new { name = "Project" })%>
I set ...
Is there a sample application for using WIF with a ASP.NET MVC application? Can someone help me get started trying to integrate both of these technologies?
...
Hello, I have a TextArea html helper method I'm calling in a foreach loop. Basically, when I initially load the View it works fine, but when i reload the View and load postback data, the same TextArea throws a NullReferencException and yet the variable I'm using in the TextArea as the name of the TextArea is not null. I've attached a p...
Is there an easier way to update an object with L2S other then doing it property by property?
This is what I am doing now:
Public ActionResult Edit(Object obj)
{
var objToUpdate = _repository.Single<Object>(o => o.id = obj.id);
objToUpdate.Prop1 = obj.Prob1;
objToUpdate.Prop2 = obj.Prop2;
...
_repository.SubmitCh...
how to set autopostback for dropdownlist in mvc.net?
...
We're about to begin development on a mid-size ASP.Net MVC 2 web site. For a typical page, we grab data and throw it up on the web page, i.e. there is not much pre-processing of the data before it is sent to the UI.
We're now making the decision whether or not to use an ORM and if yes, which one. We had been looking at EF2 AKA EF4 (...
Is there a way to prevent the user from selecting a file that is not a specified file type when they browser for the file on their computer? For example, when a user browseses to upload an image file I would for them to only see images (jpg, png, ect.) that are less than 20mb. Is this something that can be accomplished with asp.net mvc...
MvcSiteMap - http://mvcsitemap.codeplex.com/
Is it possible to create such links in a sitemap with MvcSitemap?
I can create a simple sitemap but not one with the link below..
www. ... .com / Eventname / groupID /Tasks/ Details/ taskID
Eventname, groupID, TaskID are dynamic.
If not is there another solution for my problem?
TY in adv...
Hi Experts,
I am working on a website in asp.net mvc. I have a route
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional }
// Parameter defaults
);
which is the default route. Now I have method
public...
Hello,
I've installed full version (not RC nor Beta) of Visual Studio 2010, a then setup within Web Platform Installer 2.0 announce me that I need to install MVC 2.0, so i did it.
When I want to create project "MvcWebApplicationProjectTemplate" in VS I have following message:
error: this template attempted to load component assembly '...
Hi guys,
I have a very simple data entry form to implement. It looks like this:
Obviously I have mocked out the actual requirements but the essence is similar.
Entering a name and clicking history should bring up a pop up pointing to the url '/student/viewhistory/{name}'
Name and age are required fields
The sub form (in the mockup...
Hi there,
I am writing some learning tests (i.e. what's the answer for...; choose correct options...). Now my question is, how should I store them. SQL db seems quite an overkill, but I really don't know what would be the best choice if I wanted to select random subset of questions etc. Perhaps some simple xml files?
Thanks for advice.
...
I have the following code:
<%int count = 0; %>
<input type="checkbox" name="Name["'<%count++;%>'"]" />
The name isnt being rendered as expected, its being rendered as name="IssueCreate["''"]" />
How can I correct that?
...
I need to add a span tag to the title of an actionlink to output the following html
<li><a href="#" id="topmenu1" accesskey="1" title=""><span>Homepage</span></a></li>
I currently have
<li><%= Html.ActionLink("Homepage", "Index", "Home", null, new { @id= "topmenu1" , @accesskey = "1", @title = "" } ) %></li>
which gives me
<li><...
I'm trying to produce a dropdownlist for GetAllRoles using the role provider.
I can produce the drop down in a controller using ViewData but I would like to use a View Model to produce the dropdown, but I'm unsure of the best way to create the list using a View Model?
public ActionResult GetAllRoles()
{
ViewData["Roles"] = new Selec...
Okay I'm kindoff new to the .NET platform. And currently i'm learning ASP MVC.
I want to send an e-mail from my program and i have the following code:
public void sendVerrificationEmail()
{
//create the mail message
MailMessage mail = new MailMessage();
//set the addresses
mail.From = new MailAddres...
this is my function (with other lines ive tried/abandoned)...
function DoClicked(eNumber) {
//obj.style = 'bgcolor: maroon';
var eid = 'cat' + eNumber;
//$get(obj).style.backgroundColor = 'maroon';
//var nObj = $get(obj);
var nObj = document.getElementById(eid)
//alert(nObj.getAttribute("style"));
nObj.style...
I returned json result from a controller but how can i add a view that uses this json result..
public class MaterialsController : Controller
{
ConstructionRepository consRepository = new ConstructionRepository();
public JsonResult Index()
{
var materials = consRepository.FindAllMaterials().AsQueryable();
r...