Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Importa class, retrieve values in VB.NET

Posted on 2010-01-12
Medium Priority
Last Modified: 2013-11-25
Hello folks, I need your help!!

I've an live.aspx and live.aspx.vb, and I created another class called it: cookie.vb in my app_code folder.

I imported example.vb in my  live..aspx.vb. In that page I want to return the values from cookie.vb.

I need to return the LENGID values from my cookie.vb

I dont know how to do it.

Below is my cookie.vb class.

Public Class cookie
    Inherits System.Web.UI.Page

    Public Sub Area()
        Dim lengId As String
        Dim cookieCols As New HttpCookieCollection
        cookieCols = Request.Cookies
        lengId = Request.Cookies.Item("lengId").Value

    End Sub

End Class

Open in new window

Question by:nkoriginal
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 11

Accepted Solution

rajvja earned 2000 total points
ID: 26292346
Public Class cookie
    Inherits System.Web.UI.Page

    Public Function Area() as string
        Dim lengId As String
        Dim cookieCols As New HttpCookieCollection
        cookieCols = Request.Cookies
        lengId = Request.Cookies.Item("lengId").Value
return lengid
    End function
End Class

call in .aspx.vb using
dim clsObj as new Cookie()
dim retval as string = clsObj.Area()


Author Closing Comment

ID: 31676043
Thank you so much for you fast and great answer!

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

704 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question