CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

MS SQL 2008 on ASP.NET Hosting



Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 9/25/2007 6:36:39 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 27 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
imranaziz
Asp.Net User
Single codebehind for multiple pages9/25/2007 6:36:39 AM

0/0

Hello All, I have to dynamically generate multiple pages, and for each page I have to do some security checks at the start of the page and based on that allow access or redirect from the page. The logic for each page is the same so I want to keep the checking code at one central location, is it best to keep the code behind of these pages the same and then do the required checking there, or is there a better way to go about this?

 Thanks a lot,

Imran.


Imran Aziz
Software developer
http://www.i4t.org
humormuch
Asp.Net User
Re: Single codebehind for multiple pages9/25/2007 8:41:26 PM

0/0

Use separate code behind files for each page.  However, add a class (AppCode) that has common functionality and call that functionality from each of your code behind files.


If you want to pay me over $150/hr send me a message.
imranaziz
Asp.Net User
Re: Single codebehind for multiple pages9/26/2007 8:53:29 AM

0/0

Thanks for your response, and I will consider that your name actually means what your response is :)  you do create humor with your posts isnt it!

 I am using MT to generate the dynamic files on each blog post hence no point of creating multiple code behind files, as for using one method I already have a class that does all the checking and I call that class from code behind anyway. The question was to find out if there are any resource sharing or concurrency issues with using one code behind file for multiple asp.net pages.

 Anyone have a better suggetion for this one please.

 Thanks a lot.


Imran Aziz
Software developer
http://www.i4t.org
khurramatk2
Asp.Net User
Re: Single codebehind for multiple pages9/26/2007 8:38:19 PM

0/0

If you create a basePage class inheriting from Page and write all the common code in it and then inherit your on the fly created class from this class you can achieve what you are looking for i guess.

-- Please mark it as Answer if its helps you..


Khurram Shahzad

Email:[email protected]
Cell: 092 333 5118396
(Reply == Helpful ? "Mark as Answer" : "-")
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
ASP.NET Unleashed: unleashed Authors: Stephen Walther, Pages: 1488, Published: 2003
Beginning ASP.NET 2.0 with C# Authors: Chris Hart, John Kauffman, David Sussman, Chris Ullman, Pages: 735, Published: 2006
Beginning ASP.NET 2.0 Authors: Chris Hart, John Kauffman, Chris Ullman, David Sussman, Pages: 759, Published: 2005
Pro C# 2008 and the .NET 3.5 Platform Authors: Andrew Troelsen, Pages: 1370, Published: 2007
Pro C# 2005 and the .NET 2.0 Platform: Public Beta Edition Authors: Andrew W. Troelsen, Pages: 982, Published: 2005
Complete Flash Remoting MX Authors: Joey Lott, Pages: 596, Published: 2003
Special Edition Using Visual Basic .Net Authors: Brian Siler, Jeff Spotts, Safari Tech Books Online, Pages: 830, Published: 2002
Pro C# with .NET 3.0: exploring the .NET universe using curly brackets Authors: Andrew Troelsen, Pages: 1186, Published: 2007
ASP.NET 2.0 Website Programming: Problem-design-solution Authors: Marco Bellinaso, Pages: 576, Published: 2006
Core Internet Application Development with ASP.NET 2.0 Authors: Randy Connolly, Pages: 1049, Published: 2007

Web:
ASP.NET Web Page Code Model Code can be reused for multiple pages. Compilation and Deployment. Compilation and deployment of both single-file and code-behind pages is similar. ...
Two aspx files that use one codebehind file. Is that possible ... Net 1.1, I know it was possible to share a single code behind file against multiple aspx pages. One of the developers I worked with insisted ...
Newbie: Multiple codebehind files fashion for various controls across multiple pages. .... I am able to reference a single custom class file from a codebehind but I have a ...
The Codebehind vs. Inline code ASP.NET Debate The term “Codebehind” simply refers to code that a web form (or web service or ... the code for multiple pages, Global and other classes are all in a single ...
InformIT: Separating Code from Presentation > Using Code Behind You can inherit multiple presentation pages from the same code-behind file. ... could inherit all the pages in your Web site from a single code-behind file. ...
Multiple Code Behind Pages - .NET ASP Multiple Code Behind Pages. Get answers to your questions in our . ... might as well just use a Module or Class file inside the single ...
It the use of multiple languages in ASP.NET code behind pages ... NET website that has multiple pages written in both C# and Visual Basic .NET. ... as teams usually have expertise with a single language. ...
Inside Microsoft: Code Reuse Strategies Using ASP.NET - Part 1 ... Each ASPX file could have its own code behind file and multiple ASPX files .... and not generally use the same code behind page for multiple pages except in ...
CodeProject: Building ASP.NET Web Pages Dynamically in the Code ... Apr 25, 2008 ... NET came along and introduced the code-behind concept. C# and VB. ..... Single pages would be reworked five times or more. ...
ASP.NET Tutorial One of the ways in which a code-behind file can be conveniently shared among multiple pages is by using common names for common controls. ...

Videos:
Zero Configuration networking with Bonjour Google TechTalks November 2, 2005 Dr. Stuart Cheshire, Apple Computer http://www.stuartcheshire.org/ ABSTRACT The desirability of making IP networ...




Search This Site:










module installation

dotnetnuke firefox login suceeds, ie fails?

solpart menu help please im running blank here

module definitions error

print option output is displayed centered - can this be changed?

problems with installing dnn 3.1.0

dnn 3.1.1 bug - site settings very slow because of file access

2.0 - dynamically loading controls problem in desktopcontrols.createchildcontrols

from root to virtual directory

3.0.13 upgrade "machinekey" security steps

dnn 3.0.7 popup calendar date format

customizing desktopdefault.aspx

good hosting service for dnn? blazernetwork.

backport to version 2 or continue...

linkclick usage

dnn and mysql

font size interactive skin/css

dnn user defined table issue

site log -- disabled ??

error installing dnn3!

impossible to query roles table?

dnn install/upgrade problem

noob install problem

new installation without some core modules (announcements, html, links, etc)

bulk emailer removes host in path - sometimes

problem with dnn.com forum for projects

dotnetnuke graphics

need some dummy proofing.

labels in the d/l module...

dnn 3.1 missing many files

  Privacy | Contact Us
All Times Are GMT