Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old April 28th, 2006, 03:52 PM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Trying to find control on content page

Hello. I am trying to access a hidden field that is on a content page, from my custom class being called from my objectdatasource.

Lets see if I can make this more clear:

I have a class named ItemsDAL that has a method called GetRecords.

I have a master/content page that has an ObjectDataSource with Type=ItemsDAL and it's selectMethod=GetRecords.
Also on this master/content page is my GridView and a HiddenField with an ID=MyHiddenField

In the ItemsDAL.GetRecords I'd like to access the value in that hidden field.

I've made the class inherit system.web.ui.page and have tried every combination of Page.FindControl I can think of.

I'm thinking that instead of inheriting system.web.ui.page I need to inherit the page class itself...am I on the right track?

Ryan

  #2 (permalink)  
Old April 28th, 2006, 06:20 PM
Registered User
 
Join Date: Apr 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've discovered that it's due to the fact that APP_CODE gets compiled into it's own assembly first...and thusly items in APP_CODE can be referenced by a page, but not vice versa. I've seen mention that one could build a base class that your pages/master pages derive from, and then you could do this....but I haven't seen an example I can follow yet lol.

Does anyone have a simple VB example of how to build an interface to a masterpage, in the manner I've described?

Ryan



Similar Threads
Thread Thread Starter Forum Replies Last Post
Master Page Method: Code-Behind for Content Page kwilliams ASP.NET 2.0 Professional 3 June 2nd, 2008 12:57 PM
Master Page and Content Page with Java script Harjinder ASP.NET 2.0 Professional 1 February 1st, 2008 10:31 AM
master page and content page interaction mrjoka ASP.NET 2.0 Basics 0 March 15th, 2007 10:45 AM
Access Master page control from Content page. angshujit ASP.NET 2.0 Basics 3 January 11th, 2007 06:20 AM
content page viewstate value in Master Page cbe_seenu ASP.NET 2.0 Professional 0 August 1st, 2006 01:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.