Results 1 to 3 of 3

Thread: How to configure the global.asax.vb file?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2004
    Location
    Barcelona
    Posts
    70

    How to configure the global.asax.vb file?

    Hi,

    I want to create a class to store data in it along the user session variable. To do so I was advised to create the class in the global.asax.vb file, but I don’ t know how to do it. I don’ t have that file, and I don’ t use any development tool such as VS.NET, Web Matrix, etc.. I program all my site typing the code in Dreamweaver MX.

    I tried to create the global.asax.vb file simply opening a new Dreamweaver blank document, and saving it as ‘global.asax.vb’. Then I typed into that file:
    Code:
    ' VB Document
    
    <script language="VB" runat="server">
      
          Public Class User_info
             Public email As string
             Public offer_id As Int64	 
          End Class
    
    </script>


    Then, in the page that starts the session I typed:
    Code:
    <%@ Page Language="VB" Debug="true" %>
    
    <script language="VB" runat="server">
    
    Sub check_User(Sender As Object, E As ImageClickEventArgs)
     
      ‘ Code to check into the DB for correct e-mail and password 
    
      strConnection.open()
      CmdDataBaseResponse.ExecuteNonQuery
      strConnection.close()
    
    
       Dim User_num As Int64 = CmdDataBaseResponse.Parameters("@Id").Value
    
       Dim UserSessionInfo As New User_info()
       UserSessionInfo.email = CmdDataBaseResponse.Parameters("@e_mail").Value
       Session("Private_Session") = UserSessionInfo
    
       Response.Redirect(“private_area.aspx ?" + "UserId = " + Server.UrlEncode(User_num))
    
    End Sub
    </script>
    
    <html>
    <head>Authentication Page</head>
    <body>
    </body>
    </html>
    But when I load that Authentication Page I receive this error:

    Type 'User_info' is not defined.
    Line 732: Dim UserSessionInfo As New User_info()


    What is wrong? Is it well defined my global.asax.vb file? Or is it better to use VS.NET or a similar tool to configure that file?

    Thank you,
    Cesar

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Just use VS.NET
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3
    Hyperactive Member greg_quinn's Avatar
    Join Date
    Nov 2002
    Location
    South Africa
    Posts
    366
    global.asax.vb??

    I've always used global.asax

    I didn't know global.asax.vb exists as a special file, does it?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width