| Author |
Topic Search Topic Options
|
Diep-Vriezer
Senior Member
Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
|
Post Options
Thanks(0)
Quote Reply
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..
|
 |
Mart
Senior Member
Joined: 30 November 2002
Status: Offline
Points: 2304
|
Post Options
Thanks(0)
Quote Reply
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.
|
 |
Boecky
Groupie
Joined: 23 December 2002
Location: Belgium
Status: Offline
Points: 110
|
Post Options
Thanks(0)
Quote Reply
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...
|
 |
Diep-Vriezer
Senior Member
Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
|
Post Options
Thanks(0)
Quote Reply
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..
|
 |
The WizeGuy
Newbie
Joined: 02 October 2003
Location: Sweden
Status: Offline
Points: 34
|
Post Options
Thanks(0)
Quote Reply
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
|
 |
Bunce
Senior Member
Joined: 10 April 2002
Location: Australia
Status: Offline
Points: 846
|
Post Options
Thanks(0)
Quote Reply
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.
|
 |
Diep-Vriezer
Senior Member
Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
|
Post Options
Thanks(0)
Quote Reply
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..
|
 |
Boecky
Groupie
Joined: 23 December 2002
Location: Belgium
Status: Offline
Points: 110
|
Post Options
Thanks(0)
Quote Reply
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?
|
 |