Search Results

Search found 4 results on 1 pages for 'camainc'.

Page 1/1 | 1 

  • Why do I get "Invalid Column Name" errors in EF4?

    - by camainc
    I am trying to learn Entity Framework 4.0. Disclaimer 1: I am brand new to Entity Framework. I have successfully used LinqToSQL. Disclaimer 2: I am really a VB.Net programmer, so the problem could be in the C# code. Given this code snippet: public int Login(string UserName, string Password) { return _dbContext.Memberships .Where(membership => membership.UserName.ToLower() == UserName.ToLower() && membership.Password == Password) .SingleOrDefault().PrimaryKey; } Why do you suppose I get "Invalid column name" errors? {"Invalid column name 'UserName'.\r\nInvalid column name 'Password'.\r\nInvalid column name 'UserName'.\r\nInvalid column name 'Password'."} Those column names are spelled and cased correctly. I also checked the generated code for the entity in question, and those columns are properties in the entity. The intellisense and code completion also puts the column names into the expression just as they are here. I am stumped by this. Any help would be much appreciated. https://docs.google.com/leaf?id=0B-xLbzoqGvXvNjBmZmNjNDAtY2RhNC00NDA2LWIxNzMtYjhjNTYxMDIyZmZl&hl=en

    Read the article

  • How to fix security exception when using recaptcha on MVC site

    - by camainc
    I followed this excellent blog post to implement recaptcha on my MVC site: http://devlicio.us/blogs/derik_whittaker/archive/2008/12/02/using-recaptcha-with-asp-net-mvc.aspx I converted the code to VB, and everything seems to compile ok. However, when the code gets to the place where the recapture is about to be generated, I get a security exception. Here is the function where the exception occurs (on the last line in the function): <Extension()> _ Public Function GenerateCaptcha(ByVal htmlHelper As HtmlHelper) As MvcHtmlString Dim captchaControl As New Recaptcha.RecaptchaControl With captchaControl .ID = "recaptcha" .Theme = "blackglass" .PublicKey = "6Lcv9AsAAAAAALCSZNRfWFmrKjw2AR-yuZAL84Bd" .PrivateKey = "6Lcv9AsAAAAAAHCbRujWcZzrY0z6G_HIMvFyYEPR" End With Dim htmlWriter As New HtmlTextWriter(New IO.StringWriter) captchaControl.RenderControl(htmlWriter) Return MvcHtmlString.Create(htmlWriter.InnerWriter.ToString()) End Function The exception is this: Security Exception Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file. Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. Has anyone else seen this exception, and if so, how did you fix it? Thanks

    Read the article

  • How do I add dynamic htmlAttributes to htmlhelper ActionLinks?

    - by camainc
    In my master page I have a top-level menu that is created using ActionLinks: <ul id="topNav"> <li><%=Html.ActionLink("Home", "Index", "Home")%></li> <li><%=Html.ActionLink("News", "Index", "News")%></li> <li><%=Html.ActionLink("Projects", "Index", "Projects")%></li> <li><%=Html.ActionLink("About", "About", "Home")%></li> <li><%=Html.ActionLink("Contact", "Contact", "Home")%></li> <li><%=Html.ActionLink("Photos", "Photos", "Photos")%></li> </ul> I want to dynamically add a class named "current" to the link that the site is currently pointing to. So, for example, when the site is sitting at the home page, the menu link would render like this: <li><a class="current" href="/">Home</a></li> Do I have to overload the ActionLink method to do this, or create an entirely new HtmlHelper, or is there a better way? I'm fairly new to MVC, so I'm not sure what is the correct way to go about this. Thanks in advance.

    Read the article

1