A
AAaron123
In App_Code I'd like to develop a library of common usage procedures. The
following works but notice I had to bring in a Page object or both Session
and Response would be undeclared.
I believe this causes late binding. Correct?
Is there a way I can avoid bringing in the Page object?
Thanks
Imports Microsoft.VisualBasic
Public Class Utility
Public Shared Sub SaveCookie(ByVal P As Page, ByVal CookieName As String,
ByVal CookieValue As String)
Dim styleCookie As HttpCookie = New HttpCookie(CookieName)
styleCookie.Value = CookieValue
styleCookie.Expires = DateTime.Now.AddYears(1)
P.Response.Cookies.Add(styleCookie)
P.Session(CookieName) = styleCookie.Value
End Sub
End Class
following works but notice I had to bring in a Page object or both Session
and Response would be undeclared.
I believe this causes late binding. Correct?
Is there a way I can avoid bringing in the Page object?
Thanks
Imports Microsoft.VisualBasic
Public Class Utility
Public Shared Sub SaveCookie(ByVal P As Page, ByVal CookieName As String,
ByVal CookieValue As String)
Dim styleCookie As HttpCookie = New HttpCookie(CookieName)
styleCookie.Value = CookieValue
styleCookie.Expires = DateTime.Now.AddYears(1)
P.Response.Cookies.Add(styleCookie)
P.Session(CookieName) = styleCookie.Value
End Sub
End Class