set property of master page from content page and get that property value from another content page in asp.net

前端 未结 7 904
时光取名叫无心
时光取名叫无心 2021-01-03 01:55

I have a master page with one property name event type. Now I want to set this property from a content page and then that property value should be available to another conte

7条回答
  •  北海茫月
    2021-01-03 02:17

    I had a similar problem. Here's what I did:

    //Id the form tag and place a runat server
      
    //In C# Masterpage.cs - Expose the forms properties public System.Web.UI.HtmlControls.HtmlForm Form1 { get { return form1; } set { form1 = value; } } //In C# Consuming page add this to pageLoad using UniqueId ((SiteMaster)Page.Master).Form1.DefaultButton = btnSearchUsersLink.UniqueID;

提交回复
热议问题