|
-
Sep 13th, 2002, 10:35 AM
#1
Thread Starter
Junior Member
How to add and include file or module to ASP.net page
Hi,
Does anyone no how to add include style file to an aspx page?? I want a function that I can share with all of my pages , I cannot use a module or class(.vb) file beause I need to use the response and request and session objects (they don't seem to be available in these file types ) I am using the code behind pages
mabye there is a namespace I can use??? in a class.vb ???
Any ideas???
-
Sep 13th, 2002, 11:55 PM
#2
Hyperactive Member
You can still use a vb.net class to be shared with all your other pages. You can still use your session or application variables with the HTTPApplication class imports within the vb.net class. From there, go to the context object and retrieve your session or application variables from there.
hth
William T
Software Architect / Chief Software Developer
Softwaremaker.Net Pte Ltd
http://www.Softwaremaker.net
*** Things are always the darkest before they go pitch black ***
-
Sep 15th, 2002, 12:49 PM
#3
Thread Starter
Junior Member
response and request?
how about response and request objects??
-
Sep 15th, 2002, 05:12 PM
#4
Hyperactive Member
Create a vb.net class in your web app project and then inherit your web form class. Everything that is available in your web form page will be available in your vb.net class
William T
Software Architect / Chief Software Developer
Softwaremaker.Net Pte Ltd
http://www.Softwaremaker.net
*** Things are always the darkest before they go pitch black ***
-
Aug 19th, 2003, 11:51 AM
#5
Addicted Member
Hey, I was trying to use the response.redirect from a class after inheriting the webform and got the following error:
"Response is not available in this context."
the class looks like this:
Public Class checkstatus
Inherits Userhome
Sub checklogin()
If Session("LoggedIn") <> "Y" Then
Response.Redirect("index.aspx")
End If
End Sub
End Class
-
Aug 19th, 2003, 12:12 PM
#6
PowerPoster
you can create a web user control that has the functionality you require in it's code behind file. As long as you don't include any html in the design of it, it will display when rendered as nothing. Then you can just drop it on each page.
-
Aug 19th, 2003, 06:56 PM
#7
Hyperactive Member
Hey, I was trying to use the response.redirect from a class after inheriting the webform and got the following error:
You have to use the WEB namespace and then after that use the context.current to use the current context web variables.
current.context.Session("CurrentVariable")
hth
William T
Software Architect / Chief Software Developer
Softwaremaker.Net Pte Ltd
http://www.Softwaremaker.net
*** Things are always the darkest before they go pitch black ***
-
Aug 20th, 2003, 08:27 AM
#8
Addicted Member
Hey, Thanks the context.current.session("Current Variable") did the trick!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|