"need" override Global.asax

Last post 06-15-2006, 5:23 AM by Plasteam. 4 replies.
Sort Posts: Previous Next
  •  06-12-2006, 10:01 PM 20047

    "need" override Global.asax

     
    I use .Net 2.0 and integration package. I have Global.asax in my web application. Do I need override this file. When I login in my web application with my existing membership database. It complain. "Global.asax not implemnet IHttpApplicationDataProvider". Anybody help me. Thanks.

     

     

  •  06-12-2006, 11:04 PM 20049 in reply to 20047

    Re: "need" override Global.asax

    Please download this package.
     
    The above package shows you how to override your Global.asax while keeping your Global.asax.cs or Global.asax.vb.
     
     
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  06-13-2006, 4:46 AM 20059 in reply to 20049

    Re: "need" override Global.asax

    Hello:
     
    I have downloaded this file and extracted it, and it says that I can use the file which is linked here to integrate with IBuySpy Protal (C#), however whithin this file, it didn't say anything about how to overide and change the global.asax. Could you give me a little bit idea about that? Cheers! 
  •  06-14-2006, 10:57 PM 20170 in reply to 20059

    Re: "need" override Global.asax

    Plasteam,
     
    I checked your error.htm file. It looks like you are using a different version of IbuySpy.
     
    Please open the signin.ascx.cs.
     
    And find the following function:
     
     private void LoginBtn_Click(Object sender, ImageClickEventArgs e) {
                // Attempt to Validate User Credentials using UsersDB
                UsersDB accountSystem = new UsersDB();
                String userId = accountSystem.Login(email.Text, PortalSecurity.Encrypt(password.Text));
                if ((userId != null) && (userId != "")) {
                    // Use security system to set the UserID within a client-side Cookie
                    FormsAuthentication.SetAuthCookie(email.Text, RememberCheckbox.Checked);
                    // Redirect browser back to originating page
                    Response.Redirect(Request.ApplicationPath);
                }
                else {
                    Message.Text = "<" + "br" + ">Login Failed!" + "<" + "br" + ">";
                }
            }
     
    And modify the global.asax file based on LoginBtn_Click function of your own portal.
     
     
     
     
     
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  06-15-2006, 5:23 AM 20178 in reply to 20170

    Re: "need" override Global.asax

    Hi Adam:
     
    Thank you for your help!
     
    This is my signin.ascx.cs file:
     
    using System;
    using System.Collections;
    using System.Configuration;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using System.Web.Security;
    using ASPNetPortal;
    using System.Web.Mail;
     
    namespace Syntegra.Manufacturing.WMCCM.Web.UI.DesktopModules {
        public abstract class Signin : ASPNetPortal.PortalModuleControl {
            protected System.Web.UI.WebControls.TextBox email;
            protected System.Web.UI.WebControls.TextBox password;

            protected System.Web.UI.WebControls.ImageButton SigninBtn;
            protected System.Web.UI.WebControls.ImageButton RegisterBtn;
            protected System.Web.UI.WebControls.Literal responseLiteral;
            protected System.Web.UI.WebControls.LinkButton EmailPassword;
            protected System.Web.UI.WebControls.CheckBox RememberCheckbox;
            protected Syntegra.Manufacturing.Wmccm.Web.UI.CustomControls.Label EmailLabel;
            protected Syntegra.Manufacturing.Wmccm.Web.UI.CustomControls.Label PasswordLabel;
            protected System.Web.UI.WebControls.Label Message;
     
     private void LoginBtn_Click(Object sender, ImageClickEventArgs e)  
      {
       // extract the details

       string strEmail = email.Text.Trim().ToLower();
       string strPassword = password.Text.Trim();

       // Attempt to Validate User Credentials using UsersDB
       UsersDB accountSystem = new UsersDB();
       String userId = accountSystem.Login(strEmail, strPassword);
       if ((userId != null) && (userId != ""))
       {
        // initialize the authentication
        FormsAuthentication.Initialize();
        // Log User Off from Cookie Authentication System
        FormsAuthentication.SignOut();
         
        // Invalidate roles token
        Response.Cookies["portalroles"].Value = null;
        Response.Cookies["portalroles"].Expires = new System.DateTime(1999, 10, 12);
        Response.Cookies["portalroles"].Path = "/";
        // destroy the session thing!!
        Session["UserAccessControl"] = null;
        // Use security system to set the UserID within a client-side Cookie
        FormsAuthentication.SetAuthCookie(strEmail, false);
        // Redirect browser back to originating page
        string url = Request.ApplicationPath;
        if (Session["LogonReturnToPage"] != null)
        {
         url = (string) Session["LogonReturnToPage"];
         Session["LogonReturnToPage"] = null;
        }
        Response.Redirect(url);
       }
       else
       {
        Message.Text = "<" + "br" + ">Login Failed!" + "<" + "br" + ">";
        responseLiteral.Text = "<script language=javascript>alert('Login Failed!');</script>";
       }
      }
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
    So to process two lines highlighted in yellow, I have to use the three lines highlighted by blue, and how should I do with these?
     
    I have uploaded the signin.ascx.cs file here, could you give me some ideas? cheers!
     
View as RSS news feed in XML