Last post Dec 01, 2008 11:03 AM by rodrijp
Dec 10, 2007 10:37 PM|NigelLinnett|LINK
First of all congrats on getting this released. Must have been a lot of work, and panicked work over the weekend I guess.
Now for the problem. I have the VS2008 Pro RTM trial installed on Vista Ultimate. The only add-on installed is Resharper.
I created a new MVC Web Application (also tried it with an MVC Web Application and Test) and added a reference to the MVCToolkit dll. I opened the Index.aspx file, and typed <%= Html. and the dropdown only had ActionLink, Encode, and ViewContext options.
I tried adding a reference to the MVCToolkit project, and rebuilding the solution, but it didn't make a difference.
I have also tried using HtmlHelper instead of Html, and still didn't make a difference.
I'm assuming it's something I've done wrong, but can't figure out what it is. Anyone have any ideas?
Dec 11, 2007 12:32 AM|CVertex|LINK
ctrl + shift + b (rebuild) will give you some intellisense :)
Dec 11, 2007 12:49 AM|NigelLinnett|LINK
Thanks for the suggestion, but rebuilding doesn't help.
Dec 11, 2007 05:23 AM|CVertex|LINK
I had the same problem as you till I rebuilt.
can you see the toolkit HtmlHelper in the code behind after "using System.Web.Mvc"?
tried restarting VS?
Dec 11, 2007 11:31 AM|NigelLinnett|LINK
In the code behind I do see the HtmlHelper class. I tried creating a new method, and manually creating an instance of HtmlHelper
HtmlHelper hh = new HtmlHelper(ViewContext);
But the hh object, still isn't picking up any of the extensions (and a restart didn't help, will try a full system restart tonight).
Dec 11, 2007 05:47 PM|robconery|LINK
Can you check your web.config and make sure that the namespace "System.Web.Mvc" is added under system.web/namespaces?
Dec 11, 2007 09:51 PM|NigelLinnett|LINK
Interesting... my web.config file doesn't have a system.web/namespaces node. I do have system.web/pages/namespaces and it has add entries for System.Web.Mvc and System.Linq
Should I move namespaces up a level?
Dec 11, 2007 10:24 PM|robconery|LINK
Oops - that's what i meant :). So you have this in your App and when even after you build it doesn't show?
Dec 11, 2007 10:46 PM|NigelLinnett|LINK
That's correct Rob. It looks as if VS isn't seeing the extension methods for some reason. When I look in the Object Browser, I see them all there (for instance, in the TextBoxExtensions class, I'm seeing all 21 methods there).
I just remembered today that I do have something else installed, the Entity Framework Beta 3, and the Entity Framework Tools (downloaded and installed Dec 6th), might that be connected?
Dec 12, 2007 12:30 AM|NigelLinnett|LINK
Problem solved, I restarted the system with no result.
Uninstalled all VS addins (turns out I also had Resharper 3.0.3 installed, and think that is likely the culprit since I was using it's intellisense, and it doesn't support the new features yet)
Re-installed the ASP.Net futures, and now I'm good to go.
So thanks guys for your help, but this one was my fault (haven't had a chance to do development in 2K8 since I installed the RTM)
Jan 16, 2008 04:59 PM|dnoxs|LINK
I have a similar problem. I have just installed VS2008 Team System Development Edition. I then installed ASPNETExt.exe.
After starting VS2008 I attempt to do the following:
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="Costar.Focus.Web.Portal.Views.Security.Login" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
<% if (ViewData["ErrorMessage"] != null)
<%= ViewData["ErrorMessage"] %>
<% } %>
<% using (Html.Form("Authenticate", "Security"))
Username: <%= Html.TextBox("username") %><br />
Password: <%= Html.Password("password") %><br />
Remember Me: <input type="checkbox" id="rememberMe" name="rememberMe" checked="checked" value="checked" /><br />
<%= Html.SubmitButton() %>
<%= Html.Hidden("returnUrl", "/") %>
<% } %>
When I run it however I get this result: CS1061: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'Form' and no extension method 'Form' accepting a first argument of type 'System.Web.Mvc.HtmlHelper' could be found (are you missing a using directive
or an assembly reference?)
In the object browser I can see the HtmlHelper object but it does not contain any functions for Form, TextBox, or Password. Here is the url I used to download ASPNETExt.exe from:
Any help would be appreciated.
Jan 21, 2008 09:34 PM|MaskPZ|LINK
I have the same problem of dnoxs.
How can we fix it?Any ideas?
Dec 01, 2008 11:03 AM|rodrijp|LINK
I have the same problem. When i revise de web.config file, you must have added the System.Web.Mvc.Html namespace.