C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




How to access master page controls & writing button click event


Posted Date: 24 Mar 2008    Resource Type: Code Snippets    Category: ASP.NET WebForms

Posted By: raghavendra naidu       Member Level: Silver
Rating:     Points: 7



Calling Master page controls, writing events for master page controls.
the example contains 2lables called from master page and text added.
a button click event is handled.
try not to copy paste the code the intellisence will help in generating the click event.



protected void Page_Load(object sender, EventArgs e)
{
Label segname = new Label();
segname = (Label)Master.FindControl("page");
segname.Text = "Demo";

Label slide = new Label();
slide = (Label)Master.FindControl("sno");
slide.Text = "Page 340 of 360";

ImageButton ib = new ImageButton();
ib = (ImageButton)Master.FindControl("goton");
ib.Click += new ImageClickEventHandler(ib_Click);

}

void ib_Click(object sender, ImageClickEventArgs e)
{
Response.Redirect("Page341.aspx");
}







Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Sending EmailsFrom ASP.NET Web Page
Previous Resource: How to Redirect the page when the session ends
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET WebForms


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

web conferencing

Contact Us    Privacy Policy    Terms Of Use