Solved

Access a H1 tag which is in parent master page from a content page

Posted on 2011-02-18
2
1,125 Views
Last Modified: 2012-05-11
Hello experts,

I have a H1 tag whose id is h1top in my parent master page like below. my site is bulit in asp.net 2.0 and C#
<div id="top">
           <div id="leftdot"></div>
           <div id="center">
             <h1 id="h1top" runat="server" class="h1top"></h1></div>
            <div id="rightdot"></div>
  </div>

Open in new window


Now I have a content page called items.aspx which is created from Nested masterpage whose parent masterpage includes the above H1 tag.

I would like to access this H1 tag from the content page items.aspx so I can add some text using the Innertext control programatically on page load

Thanks and appreciate it
0
Comment
Question by:niceoneishere
2 Comments
 
LVL 20

Accepted Solution

by:
informaniac earned 500 total points
ID: 34928039
HtmlGenericControl h1=(HtmlGeneriControl)this.Master.Master.FindControl("h1Id");h1.InnerText = "Text";
0
 
LVL 1

Author Closing Comment

by:niceoneishere
ID: 34943861
thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
A short film showing how OnPage and Connectwise integration works.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

4 Experts available now in Live!

Get 1:1 Help Now