CodeVerge.Net Beta


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

ASP.NET Web Hosting – 3 Months Free!



Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 9/14/2006 12:12:05 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 20 Favorited: 0 Favorite
3 Items, 1 Pages 1 |< << Go >> >|
Zippeh
Asp.Net User
Creating and accessing objects from Master pages9/14/2006 12:12:05 PM

0/0

Hi there, I have a Security object that I would like to be created on each page of my application. So I thought best place to put this would be in the Master page vb file as it's included in every page. I have since read that it is best not to use the masterpage for this kind of thing as its meant for layout purposes. What would be the best way to get about this?



Also, my code for accessing the object created in the master page does not work:



Master page code: 

    Public diogelwch As Gwynedd.Diogelwch.Diogelwch

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        diogelwch = New Gwynedd.Diogelwch.Diogelwch(Request.ServerVariables("AUTH_USER"), Request.ServerVariables("REMOTE_ADDR"))

    End Sub

  

And I have been trying to access the "diogelwch" object from my pages but with no luck :(



Thanks in advance. 


http://www.gwynedd.gov.uk
stiletto
Asp.Net User
Re: Creating and accessing objects from Master pages9/14/2006 12:36:42 PM

0/0

Create your own base page class that inherits from Page and then have all of your applications pages inherit your base page class.  This is where you'd add any functionality that you want shared across your pages.  Then you could access your example property on each page that inherits your base via: this.diogelwch
Zippeh
Asp.Net User
Re: Creating and accessing objects from Master pages9/14/2006 1:15:18 PM

0/0

That's spot on mate exactly what I wanted :D

 

Many thanks! 


http://www.gwynedd.gov.uk
3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Professional ASP.NET 2.0 Authors: Bill Evjen, Scott Hanselman, Farhan Muhammad, Srinivasa Sivakumar, Devin Rader, Pages: 1253, Published: 2005
Adobe InDesign CS3 Bible Authors: Galen Gruman, Pages: 988, Published: 2007
Pro ASP.NET 2.0 Website Programming Authors: Damon Armstrong, Pages: 641, Published: 2005
Beginning ASP.NET 3.5: In C# and VB Authors: Imar Spaanjaars, Pages: 734, Published: 2008
ASP.NET 2.0 Website Programming: Problem-design-solution Authors: Marco Bellinaso, Pages: 576, Published: 2006
Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter Kit: visual web developer 2005 express edition starter kit Authors: David Sussman, Alex Homer, Pages: 312, Published: 2005
Adobe Creative Suite 3 Design Premium All-in-One Desk Reference for Dummies Authors: Jennifer Smith, Christopher Smith, Pages: 816, Published: 2007
Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages Authors: Jacob J. Sanford, Pages: 474, Published: 2007
Adobe Creative Suite All-in-One Desk Reference For Dummies Authors: Jennifer Smith, Jen DeHaan, Pages: 744, Published: 2004
Professional C# 2005 with .NET 3.0 Authors: Christian Nagel, Bill Evjen, Jay Glynn, Karli Watson, Morgan Skinner, Pages: 1748, Published: 2007

Web:
Introducing ASP.NET 2.0 Master Pages This means you need to create one property for each control that should be made available to the content ...




Search This Site:










having problem debugging a web application

vb / c# conversion - httpwebrequest & response question

is there something wrong with response.redirect

hyperlink to same web page

uploading files, saving and retrieving files to network locations...

a limit to the number of letter in a textbox

bugged asp:label transparancy?

asp.net - good sources for beginning info?

can't edit the content

dropdownlist selected item

sqlconnection not defined

reload the datagrid?

open link automatically in email

listbox ??

cannot post to web service via http from client?

first internet app

a page can have only one server-side form tag??

problem with importing namespace "microsoft.visualc"

is there a way to use a field that is null in an if then statement

checkednodes: odd behavior

smaall problem..

asp label properties

server.transer to a new window without javascript

collection

binding to multiple labels with .databind()

migration tool for beta 2

how to access value inside the nested ascx file

exporting dataset to excel

difference b/w string with capital s and string with small s

tutorial on sending email

  Privacy | Contact Us
All Times Are GMT