Click here to Skip to main content
15,887,214 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Help in Converting Desktop App to Web App. Pin
QuickBooksDev27-Nov-14 9:16
QuickBooksDev27-Nov-14 9:16 
GeneralRe: Help in Converting Desktop App to Web App. Pin
Richard Deeming27-Nov-14 9:19
mveRichard Deeming27-Nov-14 9:19 
GeneralRe: Help in Converting Desktop App to Web App. Pin
QuickBooksDev30-Nov-14 2:53
QuickBooksDev30-Nov-14 2:53 
GeneralRe: Help in Converting Desktop App to Web App. Pin
Richard Deeming1-Dec-14 1:36
mveRichard Deeming1-Dec-14 1:36 
GeneralRe: Help in Converting Desktop App to Web App. Pin
QuickBooksDev2-Dec-14 23:32
QuickBooksDev2-Dec-14 23:32 
GeneralRe: Help in Converting Desktop App to Web App. Pin
Richard Deeming3-Dec-14 1:28
mveRichard Deeming3-Dec-14 1:28 
GeneralRe: Help in Converting Desktop App to Web App. Pin
QuickBooksDev3-Dec-14 1:33
QuickBooksDev3-Dec-14 1:33 
GeneralRe: Help in Converting Desktop App to Web App. Pin
Richard Deeming3-Dec-14 1:49
mveRichard Deeming3-Dec-14 1:49 
Yes, in a web application it will last until the AppPool recycles.

There's no way to make a module non-shared. However, you might be able to get away with changing the field to a property, and adding code to retrieve the value from the current session if the code is running in an ASP.NET application. Something like this should work:
VB.NET
Imports System.Web
Imports System.Web.Hosting

Module Common
    ' The key for the field in the session - this must be unique:
    Private Const SessionKey As String = "Common::aCL"
    
    ' Backing field used for non-web applications:
    Private aCLNonWeb As vbMain.QBAPIV3Cl
    
    Public ReadOnly Property aCL() As vbMain.QBAPIV3Cl
        Get
            If Not HostingEnvironment.IsHosted Then
                ' Not running in ASP.NET:
                If aCLNonWeb Is Nothing Then
                    Set aCLNonWeb = New vbMain.QBAPIV3Cl()
                End If
                
                Return aCLNonWeb
            End If
            
            Dim context As HttpContext = HttpContext.Current
            If context Is Nothing Then
                Throw New InvalidOperationException("No current request.")
            End If
            
            Dim value As vbMain.QBAPIV3Cl = DirectCast(context.Session(SessionKey), vbMain.QBAPIV3Cl)
            If value Is Nothing Then
                value = New vbMain.QBAPIV3Cl()
                context.Session.Add(SessionKey, value)
            End If
            
            Return value
        End Get
    End Property
End Module




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Help in Converting Desktop App to Web App. Pin
QuickBooksDev3-Dec-14 1:52
QuickBooksDev3-Dec-14 1:52 
QuestionAuto Filter in gridview Pin
umair275624-Nov-14 4:11
professionalumair275624-Nov-14 4:11 
QuestionIf trip type is one thing, show one query; if another, show a different query. This is not working! Pin
samflex24-Nov-14 2:54
samflex24-Nov-14 2:54 
Questionserver did not recognize the value of http header soapaction c# .net Pin
Member 1032578924-Nov-14 2:30
Member 1032578924-Nov-14 2:30 
QuestionASP.NET C# Dynamically add my selected item from dropdown to below with div tags Pin
Member 1034105324-Nov-14 0:02
Member 1034105324-Nov-14 0:02 
AnswerRe: ASP.NET C# Dynamically add my selected item from dropdown to below with div tags Pin
2374126-Nov-14 18:39
2374126-Nov-14 18:39 
QuestionExcel like filter Grid using ASP.Net MVC Pin
indian14323-Nov-14 10:27
indian14323-Nov-14 10:27 
AnswerRe: Excel like filter Grid using ASP.Net MVC Pin
Anurag Gandhi30-Nov-14 22:47
professionalAnurag Gandhi30-Nov-14 22:47 
GeneralRe: Excel like filter Grid using ASP.Net MVC Pin
indian1434-Dec-14 11:17
indian1434-Dec-14 11:17 
GeneralRe: Excel like filter Grid using ASP.Net MVC Pin
Anurag Gandhi4-Dec-14 18:04
professionalAnurag Gandhi4-Dec-14 18:04 
QuestionMaintain scroll position Pin
BobbyStrain21-Nov-14 14:07
BobbyStrain21-Nov-14 14:07 
AnswerRe: Maintain scroll position Pin
jkirkerx25-Nov-14 12:52
professionaljkirkerx25-Nov-14 12:52 
GeneralRe: Maintain scroll position Pin
BobbyStrain26-Nov-14 17:03
BobbyStrain26-Nov-14 17:03 
GeneralRe: Maintain scroll position Pin
jkirkerx27-Nov-14 11:39
professionaljkirkerx27-Nov-14 11:39 
GeneralRe: Maintain scroll position Pin
BobbyStrain29-Nov-14 11:44
BobbyStrain29-Nov-14 11:44 
GeneralRe: Maintain scroll position Pin
jkirkerx29-Nov-14 12:13
professionaljkirkerx29-Nov-14 12:13 
GeneralRe: Maintain scroll position Pin
BobbyStrain30-Nov-14 14:38
BobbyStrain30-Nov-14 14:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.