CodeVerge.Net Beta


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




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: 1/17/2008 2:37:12 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 3 Views: 44 Favorited: 0 Favorite
4 Items, 1 Pages 1 |< << Go >> >|
LiteIce
Asp.Net User
How to access a web user control in masterpage from form?1/17/2008 2:37:12 PM

0

Whats the easiest way to to access a web user control that has been placed within a masterpage from a web form?

 

Thanks

kkarasinski
Asp.Net User
Re: How to access a web user control in masterpage from form?1/17/2008 4:11:24 PM

0

 

 ' the ctr in the master page
        Dim ctr As PlaceHolder = Page.Master.FindControl("phHeader")
        'a txt box in a web user control in the master
        Dim txt As TextBox = ctr.Controls(0).FindControl("txtSearch")
        Response.Write(txt.Text)
  
Amanda Wang - M
Asp.Net User
Re: How to access a web user control in masterpage from form?1/21/2008 3:17:58 AM

0

Hi,

You can try to do access a web user control that has been placed within a masterpage from a web form by using the findcontrol,

Like below:

 UserControl uc = (UserControl)this.Master.FindControl("UC1l1");// UC1l1 is the id of the usercontrol that is on the master page.

Or you also can access the UserControl's controls by using the findcontrol method.

For example:

Button btn = (Button)this.Page.FindControl("ctl00$UC1l1$Button1"); // the Button1 is a button control on the usercontrol.

Hope it helps.


Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Yours sincerely,
Amanda Wang
Microsoft Online Community Support
ovaisgeo
Asp.Net User
Re: How to access a web user control in masterpage from form?1/21/2008 7:43:55 AM

0

thanks amenda its great working

4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Beginning ASP.NET 2.0 E-commerce in C# 2005: From Novice to Professional Authors: Cristian Darie, Karli Watson, Pages: 681, Published: 2005
ASP.NET 2.0 MVP Hacks and Tips Authors: David Yack, Joe Mayo, Scott Hanselman, Fredrik Normén, Dan Wahlin, J. Ambrose Little, Jonathan Goodyear, Pages: 400, Published: 2006
Professional C# 2005 with .NET 3.0 Authors: Christian Nagel, Bill Evjen, Jay Glynn, Karli Watson, Morgan Skinner, Pages: 1748, Published: 2007
Visual Basic 2005: How to Program Authors: Harvey M. Deitel, Pages: 1513, Published: 2006
C# for Programmers: Updated for C# 2.0 Authors: Paul J. Deitel, Pages: 1317, Published: 2005
Visual C# 2005: How to Program Authors: Harvey M. Deitel, Paul J. Deitel, Pages: 1591, Published: 2006
Pro Ajax and the .NET 2.0 Platform Authors: Daniel Woolston, Pages: 463, Published: 2006
Mastering Web Development with Microsoft Visual Studio 2005 Authors: John Paul Mueller, Pages: 822, Published: 2005
Professional ASP.NET 2.0 Databases Authors: Thiru Thangarathinam, Pages: 504, Published: 2007
Programming ASP.NET: Building Web Applications and Services with ASP.NET 2.0 Authors: Jesse Liberty, Dan Hurwitz, Pages: 930, Published: 2005

Web:
ASP 2.0: How to access Master Page from Web User Control on Page?

Master Page

.... Posts: 1. Unhappy Web userControl Access MasterPage methods/properities ...
MasterPage Class (System.Web.UI) UserControl System.Web.UI.MasterPage. Thread Safety. Any public static (Shared in Visual Basic) members of this type are thread safe. ...
MasterPage Class (System.Web.UI) To access controls, properties, and functions of the master page, the Master property can be .... Web.UI.UserControl System.Web.UI.MasterPage. Thread Safety ...
Access property and control of master page from a customized ... Customized base page class --> web page --> master page ... however this method doesn't work on access a user control. how to solve? ...
Web User Controls on Masterpage - ASP.NET Forums E.g. I have created a Login web user control and placed it within my masterpage. Now I would like to access certain elements in that control ...
ASP.Net 2.0 - Master Pages: Tips, Tricks, and Traps Apr 11, 2006 ... In fact, the MasterPage class derives from the UserControl class. ..... NET 2.0, each master page and web form can compile into a separate ...
ASP.NET 2.0 MasterPages and FindControl() - Rick Strahl's Web Log NET Forums - Server Control dynamic access by Web Forms February 21, ... This code will locate a linkbutton and a user control on a master page. ...
Data exchange between user control and master page GoogleTagged: asp net get data masterpage from getting data user control ... asp net access read only property master page user control from find user web ...
CodeProject: An Extensible Master-Page Framework for ASP.NET 1.1 ... Web.UI.HtmlControls.HtmlForm object. This Form object would be used to add our famous master-user-control or Part-C in it. Now, our master page would be ...
Less Than Dot - Wiki - ASP.NET: Access Master Page controls from ... ASP.NET: Access Master Page controls from the Content Page ... Web.UI.Page; Protected Sub Page_Load(ByVal sender As Object, ByVal e As System. ...






making an option selected of the databound dropdownlist

public connection string in a page for several sub to use.

unable to cast object of type 'system.web.ui.webcontrols.contentplaceholder' to type 'customerdb._default'.

asp.net forum starter kit.

good path usage

aspx script code wont execute

custom provider question

web form buttons

help needed! - general questions

global variable

selecting multiple files for upload with asp:fileupload tag

personal website in ctp release

forms authentication against sql

cross site scripting

extreme newbie

creating the pubs database problems

how to change color of active image/button?

current text field value

using third party tools

what's a .mspx file

overload

response back to the orginal form without opening a new window

editing existing dropdown boxes in asp.net

redirect syntax

object reference null

how do i change file upload to accepd pdf and other doc types

asp.net and flash remoting?

app_code folder

folder names within a website

web form to ms access

   
  Privacy | Contact Us
All Times Are GMT