Search Results

Search found 5 results on 1 pages for 'argons'.

Page 1/1 | 1 

  • Set HttpContext.Current.User from Thread.CurrentPrincipal

    - by Argons
    I have a security manager in my application that works for both windows and web, the process is simple, just takes the user and pwd and authenticates them against a database then sets the Thread.CurrentPrincipal with a custom principal. For windows applications this works fine, but I have problems with web applications. After the process of authentication, when I'm trying to set the Current.User to the custom principal from Thread.CurrentPrincipal this last one contains a GenericPrincipal. Am I doing something wrong? This is my code: Login.aspx protected void btnAuthenticate_Click(object sender, EventArgs e) { Authenticate("user","pwd"); FormsAuthenticationTicket authenticationTicket = new FormsAuthenticationTicket(1, "user", DateTime.Now, DateTime.Now.AddMinutes(30), false, ""); string ticket = FormsAuthentication.Encrypt(authenticationTicket); HttpCookie authenticationCookie = new HttpCookie(FormsAuthentication.FormsCookieName, ticket); Response.Cookies.Add(authenticationCookie); Response.Redirect(FormsAuthentication.GetRedirectUrl("user", false)); } Global.asax (This is where the problem appears) protected void Application_AuthenticateRequest(object sender, EventArgs e) { HttpCookie authCookie = Context.Request.Cookies[FormsAuthentication.FormsCookieName]; if (authCookie == null) return; if (HttpContext.Current.User != null && HttpContext.Current.User.Identity.IsAuthenticated && HttpContext.Current.User.Identity is FormsIdentity) { HttpContext.Current.User = System.Threading.Thread.CurrentPrincipal; //Here the value is GenericPrincipal } Thanks in advance for any help. }

    Read the article

  • Silverlight controls in aspx page

    - by Argons
    I'm developing a web site, and i'm using infragistics for web, but I want to use in some pages silverlight controls (Infragistics too). Is there a way to access a silverlight control's properties and methods from an aspx page? Thanks in advance for the help.

    Read the article

  • Popup control from dll in web page

    - by Argons
    I'm developing a kind of framework that will work in web and win, so I have this interface: public interface IViewsManager { ... void ShowMessage(); ... } And I have the implementation for win that call a popup control from another dll. My problem is when I try to implement it for web enviroment, I have to call a popup control from another dll, and I would like to show the popup and the web page disables with a gray layer, and I don't know how to do it. Please, any help will be appreciated. Thanks in advance.

    Read the article

  • Image GDI+ Error c#

    - by Argons
    First sorry for the english. I'm having an strange problem when I'm trying to save a bitmap ("Generic GDI+ error") from a picturebox in my win app, I know that this problem occurs when trying to save to a directory that has no permission, but in this case I'm trying to save it to a memoryStream. using (MemoryStream fotoStream = new MemoryStream()) { Bitmap imagen = picture1.Image as Bitmap; imagen.Save(fotoStream, imagen.RawFormat); //Error here byte[] array = fotoStream.ToArray(); fotoStream.Close(); } Any light on this?

    Read the article

1