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  <1234>
Author
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: 26 October 2003 at 3:32am

Yup, and tons of other stuff (AutoEventWireup etc.)

BTW you were right about the cut n paste stuff. You can't cut n paste from the regular ASPX file, but you can from the Code Behind file editor (VS.NET)... Wicked<%@ Page ="vb" AutoWireup="false" Codebehind="TestAuth.aspx.vb" Inherits="DenHeijer.TestAuth"%><%@ Page ="vb" AutoWireup="false" Codebehind="TestAuth.aspx.vb" Inherits="DenHeijer.TestAuth"%><%@ Page ="vb" AutoWireup="false" Codebehind="TestAuth.aspx.vb" Inherits="DenHeijer.TestAuth"%><%@ Page ="vb" AutoWireup="false" Codebehind="TestAuth.aspx.vb" Inherits="DenHeijer.TestAuth"%><%@ Page ="vb" AutoWireup="false" Codebehind="TestAuth.aspx.vb" Inherits="DenHeijer.TestAuth"%><%@ Page ="vb" AutoWireup="false" Codebehind="TestAuth.aspx.vb" Inherits="DenHeijer.TestAuth"%>



Edited by Diep-Vriezer
Gone..
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 26 October 2003 at 5:06am

Ive used response.write from a class etc.

If jus put

Protected response As New System.Web.httpResponse

similar for reqeust and server and all the others.

Mart.

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: 26 October 2003 at 9:32am

tkx for all the feedback

Both are working, but I used the user controls and that seems me the best solution. If I compare with classic asp, I'll include (for example) a variable with a connection string in every code behind page. (Can be other subs or functions too). Is it the best way to put it in an user control, or is it better to put it in a module or a class? Actually I'm searching for the most optimized way...

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: 26 October 2003 at 2:07pm
I'm using a public module for all my connections strings and keys. But I don't know if this is the most 'optimized' way. Anyway, everything is fast in asp.net, so it shouldn't matter much.
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: 26 October 2003 at 4:57pm

I never use modules.

For connectionString and other keys like default-lang, other configuration options, will be placed in web.config (webapp) or app.config (clientapp)

Then, you can reach them from EVERY method/property IN any class

If I could cut & paste I would give an example ... now, just look up web.config in NET Framework SDK ... or search the www.asp.net forum.

cya,
/PatrikB

Back to Top
Bunce View Drop Down
Senior Member
Senior Member
Avatar

Joined: 10 April 2002
Location: Australia
Status: Offline
Points: 846
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bunce Quote  Post ReplyReply Direct Link To This Post Posted: 26 October 2003 at 5:54pm

Even better is to create a class which reads the web-config variables into properties of that class. That way you only have to hit the web.config once, rather than every time you lookup the variable.

You will also have intellisense on the variables.

Same thing goes for wrapping up your session variables.. Very handy.

Cheers,
Andrew

There have been many, many posts made throughout the world...
This was one of them.
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: 27 October 2003 at 12:46am

Mmm, I stick with the class I think. It also has intellisense, like every class or module, and works just fine for me, since you can request all the variables FROM something (web.config could be usefull), or just declare them.

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: 27 October 2003 at 12:14pm

It would be nice if someone can explain the reply again before in this topic about using respons.write and request in modules and classes. Something there was not that clear for me. Or maybe a good link?

Back to Top
 Post Reply Post Reply Page  <1234>

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.