Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Include?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Include?

 Post Reply Post Reply Page  123 4>
Author
Boecky View Drop Down
Groupie
Groupie
Avatar

Joined: 23 December 2002
Location: Belgium
Status: Offline
Points: 110
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boecky Quote  Post ReplyReply Direct Link To This Post Topic: Include?
    Posted: 25 October 2003 at 8:31am

Hey!
Since a few weeks I'm studying asp.net and I can't find this answer in any book...I hope you guys can

In classic asp you can include pages with only some code (functions and subs) into an other page. Can I do this too in vs with asp.net? What I really want is to use the same functions and subs in some different code behind pages. Do I have to make a module or a class (with this common subs and functions in) or is it something else?

Boecky

Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 25 October 2003 at 8:43am

You'll have to make a class or module, I had the same problem a while ago.

Something like this will work:

Public Class Test
'This is the class file

Public Function ABC()

   Return True

End Function
End Class

This is how you call the function in a page:

Dim Test As New Test

Return Test.ABC()

Gone..
Back to Top
Boecky View Drop Down
Groupie
Groupie
Avatar

Joined: 23 December 2002
Location: Belgium
Status: Offline
Points: 110
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boecky Quote  Post ReplyReply Direct Link To This Post Posted: 25 October 2003 at 9:07am
Ah ok, I'll try that, thanks
Back to Top
Boecky View Drop Down
Groupie
Groupie
Avatar

Joined: 23 December 2002
Location: Belgium
Status: Offline
Points: 110
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boecky Quote  Post ReplyReply Direct Link To This Post Posted: 25 October 2003 at 9:14am
And what is the module then? Coz in many .net sites they talk about some modules. Oh it seems that I got the same question as diepvriezer now, what's the difference between classes and modules
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 25 October 2003 at 11:35am
Indeed.
Gone..
Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post Posted: 25 October 2003 at 11:37am

Oh, one more thing:

Neither a module nor a class can peform any Request or Response actions. That bothers me the most, and I'm looking for a solution on that.

Gone..
Back to Top
The WizeGuy View Drop Down
Newbie
Newbie


Joined: 02 October 2003
Location: Sweden
Status: Offline
Points: 34
Post Options Post Options   Thanks (0) Thanks(0)   Quote The WizeGuy Quote  Post ReplyReply Direct Link To This Post Posted: 25 October 2003 at 4:01pm

For "includes" you donīt build classes or modules You use UserControls.

 

Check this link out: http://www.dotnetjunkies.com/quickstart/aspplus/doc/webpagel ets.aspx

You have to skip the Classic ASP thinking. "Nothing" is the same in NET

 

cya,

/PatrikB

Back to Top
The WizeGuy View Drop Down
Newbie
Newbie


Joined: 02 October 2003
Location: Sweden
Status: Offline
Points: 34
Post Options Post Options   Thanks (0) Thanks(0)   Quote The WizeGuy Quote  Post ReplyReply Direct Link To This Post Posted: 25 October 2003 at 4:09pm
Originally posted by Diep-Vriezer Diep-Vriezer wrote:

Oh, one more thing:

Neither a module nor a class can peform any Request or Response actions. That bothers me the most, and I'm looking for a solution on that.

OH, yes they can!

Sorry, to much code to write .....

 

Check out the HttpContext namespac:

Response.Write(HttpContext.Current.Request.ServerVariables(" SERVER_NAME")

for example ;o)

Why canīt I just cut and paste code? nothing shows up?

Do I need to use this RTF-box?

cya,
/PatrikB



Edited by The WizeGuy
Back to Top
 Post Reply Post Reply Page  123 4>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.