CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 4/20/2006 8:08:06 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 2 Views: 41 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
3 Items, 1 Pages 1 |< << Go >> >|
dtharby
Asp.Net User
Retrieve text from MasterPage Textbox4/20/2006 8:08:06 AM

0/0

Hi All,

From my content page, I would like to get the text from a textbox that is on the MasterPage.

On my content page, I have added the <%@ MasterType VirtualPath="MasterPage.master" %>

However when I use the FindControl method and attempt to populate a textbox on the content page with the data from the masterpage textbox, nothing is passed.

Any ideas ?

Thanks
Dan

bpag
Asp.Net User
Re: Retrieve text from MasterPage Textbox4/20/2006 12:40:05 PM

0/0

You're probably not finding the control when you call FindControl. This can happen if you're not calling FindControl against the naming container of the control you want. If you are doing Master.FindControl("mycontrol") but mycontrol is on the master page but inside a naming container control the FindControl won't find it. You would have to call Master.FindControl("namingControl") and then do a FindControl on that for your control. Maybe if you show us the content of your MasterPage.master we can help figure out what you need to do exactly to find your textbox.

You also need to make sure you aren't doing this too early in the page's life cycle otherwise the control won't exist yet.

If this post answered your question please remember to 'Mark as Answer'!
bitmask
Asp.Net User
Re: Retrieve text from MasterPage Textbox4/20/2006 3:19:03 PM

0/0

I have a couple examples in my Master Pages: Tips, Tricks, Traps article. There are some alternatives presented, including how to use FindControl, and how to expose the TextBox as a strongly typed property of the master page.
3 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Core Internet Application Development with ASP.NET 2.0 Authors: Randy Connolly, Pages: 1049, Published: 2007
Beginning ASP.NET 2.0 Authors: Chris Hart, John Kauffman, Chris Ullman, David Sussman, Pages: 759, Published: 2005
Dreamweaver MX 2004 Savvy: Christian Crumlish, Lucinda Dykes Authors: Christian Crumlish, Lucinda Dykes, Pages: 670, Published: 2004
The Handbook of Software for Engineers and Scientists Authors: Paul W. Ross, Pages: 1557, Published: 1996
Pro ASP.NET 3.5 in C# 2008 Authors: Matthew MacDonald, Mario Szpuszta, Pages: 1498, Published: 2007
Visual Web Developer 2005 Express Edition For Dummies Authors: Alan Simpson, Pages: 358, Published: 2005
Professional ASP.NET 2.0 Authors: Bill Evjen, Scott Hanselman, Farhan Muhammad, Srinivasa Sivakumar, Devin Rader, Pages: 1253, Published: 2005
Quarkxpress 3.3 for Macintosh: Visual QuickStart Guide Authors: Elaine Weinmann, Pages: 248, Published: 1994

Web:
Less Than Dot - Wiki - ASP.NET: Access Master Page controls from ... Load; ' Set the value of the Master Page's Label to the Content Page's TextBox; txtTest.Text = CType(Page.Master, site).MyText; ' Update the Master Page's ...
ASP.Net Tutorial - Using PreviousPage with a Master Page (ASP.Net ... Dim Name As TextBox Name = Page.PreviousPage.FindControl("txtName") Label1.Text = Name.Text. As we stated earlier, if you're using a Master Page in your ...
Master Page and Dynamic Controls in Content Page - ASP.NET Forums //how to retrieve the value of above two text boxes ... Write("The text in the first textbox = " + strForTextbox1 + "
"); Response. ...
Visual Studio Magazine Online | Practical ASP.NET: Using ... May 16, 2008 ... But if the text box is inside an ASP.NET FormView, this code will fail. ... property to access the Master Page and retrieve a control: ...
ASP.NET 2.0 MasterPages and FindControl() - Rick Strahl's Web Log ((TextBox)FindControl("txt_" + tempObject.FiscalYear.ToString())).Text Any help would be greatly appreciated! Thanks, Mick. re: ASP.NET 2.0 MasterPages and ...
Retrieving data from ViewState using Masterpage : page, using I am using masterpages and VB. In a content page (code behind) I create a series of ... I tried to get the text in any hidden textboxes from the ViewState, ...
Finding Value of Dynamic Control in MasterPage/ContentPage System ... interfering with the ability of my code to retrieve the value in the ... FindControl("txtbxExample"), TextBox) lblValue.Text = txtbxTextBox. ...
Masterpage, contentpage and input textbox? - ASP.NET Forums If I put the textbox on the masterpage and the Calendar tag on the ... the textbox, while not using it makes it impossible to retrieve the ...
Safari Books Online - 0672327384 - Sams Teach Yourself ASP.NET 2.0 ... The Web controls in the master page can collect user input or retrieve ... The master page includes three Web controls: a Label, a TextBox, and a Button. ...
TheMSsForum.com >> Asp >> How To: Set Label Text Property In ... Is it > possible to put a text box WITHIN a CheckBoxlist? ..... How do i set the text property for a label control on my master page? I am able to use. ...




Search This Site:










ide not behaving

dotnetnuke.services.exceptions.moduleloadexception: request failed.

give me a online examination project in asp.net using c# and his database in ms-sql 2000.

debugging web services in vs.net 2005 - a step backward

foxpro

menu adapter: active arrow not showing up

partial classes for code behind classes

menu adapter not working in ie7

question about vwd & framework 2.0

can sitemap,menu,treeview declaritively open node in new "_blank" window?

dnn module security question...

how to use sitemap control?

problem with modifying create user wizard

container's css not linked on some pages/portals

how do i compile the entire website asp.net 2.0 into a single assembly?

unencrypt password temporarily

problems with module : documents and others ..

a first chance exception of type....

unable to install sql express 2005

new to asp.net - please help

no data

wysiwyg modules

need help translating fileexists from cfml to asp.net

centralized administration of webparts customization ??

sql server does not exist or access denied

help with tree view / site map

is dynamic skin loading possible at all in dnn?

caching causing me real problems

create vertical space in menu control...

dropdown box

 
All Times Are GMT