locked
The name 'SiteContext' does not exist in the current context RRS feed

  • Question

  • Customer Portal Problem.

     

    Our project fails to build because of the error: The name 'SiteContext' does not exist in the current context.

     

    Same thing with CoreDataContext();

     

    Both are in Login.aspx.cs.

     

    if (LoginContact.Adx_changepasswordatnextlogon.Value)

                        {

     

                            var page = SiteContext.Current.Website.GetPageBySiteMarkerName("ChangePassword") as Xrm.Adx_webpage;

                            string redirectURL = Request.Url.AbsoluteUri + "?UserName=" + Server.UrlEncode(Login1.UserName) + "&Password=" + Server.UrlEncode(Login1.Password);

                            Response.Redirect(redirectURL);

                            //string redirectURL = page.GetURL() + "?UserName=" + Server.UrlEncode(Login1.UserName) + "&Password=" + Server.UrlEncode(Login1.Password);

                            //Response.Redirect(redirectURL);

                        }

                        else

                        {

                            LoginContact.Adx_LastSuccessfulLogon = DateTime.Now.Date;

                            var coreContext = new CoreDataContext();

     

                            coreContext.UpdateObject(LoginContact);

                            coreContext.SaveChanges();

     

                            e.Authenticated = true;

                            FormsAuthentication.RedirectFromLoginPage(Login1.UserName, true);

                        }

     

     

    Thursday, May 12, 2011 7:45 PM

Answers

  • The code sample is not in the CRM 2011 customer portal from Microsoft nor from Adxstudio.  I searched on some of that code and it looks like your developer used some code snippet from thexrmguru.com - you should probably go there for support.  I know that implementation and it is not a secure implementation of a membership provider.  If you want a secure implementation you should probably go to Adxstudio - that way it is supported for you.
    Shan McArthur www.shanmcarthur.net Check out the commercial edition of xRM portals @ www.adxstudio.com
    • Marked as answer by Jim Glass Jr Wednesday, August 17, 2011 4:40 PM
    Friday, May 27, 2011 2:17 AM
    Moderator

All replies

  • Are you using the portals from the Dynamics Marketplace?

    Monday, May 23, 2011 7:48 PM
  • The code sample is not in the CRM 2011 customer portal from Microsoft nor from Adxstudio.  I searched on some of that code and it looks like your developer used some code snippet from thexrmguru.com - you should probably go there for support.  I know that implementation and it is not a secure implementation of a membership provider.  If you want a secure implementation you should probably go to Adxstudio - that way it is supported for you.
    Shan McArthur www.shanmcarthur.net Check out the commercial edition of xRM portals @ www.adxstudio.com
    • Marked as answer by Jim Glass Jr Wednesday, August 17, 2011 4:40 PM
    Friday, May 27, 2011 2:17 AM
    Moderator