Edit page under "User Management"

How to change part of page title inside inline user control? I know that I can run control at the head of the .aspx page, but I have an existing site with many pages that I don’t want to change. All they have in common is a menu. So, I decided that I could put the code there to change the title element of the containing page, but not the cube. The code I'm trying to implement looks like this, however, Page.Header is null.

    Private Sub Page_Load (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim favicon as new htmllink
        favicon.Attributes.Add ("REL", "SHORTCUT ICON")
        favicon.Attributes.Add ("HREF", "images / bh_favicon.ico")
        Page.Header.Controls.Add (favicon)
    End sub

I tried putting it in PreRender and Render events, but the same thing. The Page.Parent.Page.Header file is also null. Is there a better way to do what I want to do? I want to add an icon to a page group other than the default icon. Basically, I have two sites in one code base.

Please, this is my first post.

TIA

+3
source share
3 answers

@Program.X, /. , , , .

0

, , .

:

<head runat="server">

, , . , RegEx .

+4

Thank you for your responses. I know that I requested the least working solution, however, I want to make the code easy for me to manage. I think I'm going to make the master page as a template for all pages (for example, the proposed @devstuff option). Then I will change the existing pages, about 50 pages, to use the main page. Thus, if something like this appears in the future, I can easily change everything in one place.

Thanks for the help!

+1
source

Source: https://habr.com/ru/post/1714148/


All Articles