Introduction
I was had to set the heading of the application page dynamically from the code behind (server side).
Solution
Your application page will look something like this.
What you can do is simply replace "My Application Page" with a label and you can replace the text from the back end.
- <%-- This is Heading of the page --%>
- <asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
- <asp:Label runat="server" ID="labelPageTitle"></asp:Label>
- </asp:Content>
Now from the code behind you can access the label by its id and set the text as you need.
- labelPageTitle.Text = "From code behind";
Conclusion
Your page will look something like this.
No comments:
Post a Comment