C# Corner
Tech
News
Videos
Forums
Trainings
Books
Live
More
Interviews
Events
Jobs
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
Java
Learn iOS Programming
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
2
Reply
How can we change a Master Page at runtime?
Rajesh Gami
8y
2.1k
4
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
Using page events we can change the master page during runtime. In Page_PreInit() event we can change the master page by setting the “MasterPageFile” property to the path of the master page what we have to set.
Rajesh Gami
8y
3
Write the code behind of the content page (.aspx.cs)protected void Page_PreInit(object sender, EventArgs e) {this.MasterPageFile = "~/MasterPage2.master"; }
Pankaj Kumar
7y
1
Explain the components of web form in ASP.NET?
How to kill a user session?
Message