Monday, December 19, 2022

Get value from master page string data members ASPX C#

master page file

 public partial class Site2 : System.Web.UI.MasterPage

    {

        public int TransferDriveID = 0;

        public string TransferDriveName = "";

}


other apsx file

 ((Site2)this.Master).TransferDriveID 


or

string val = Request[((SiteMaster)Master).txtSearchName.UniqueID];

or
DropDownList ddlTest = this.Master.FindControl("ddlTest") as DropDownList;

https://stackoverflow.com/questions/17783165/pass-master-page-control-values-on-content-page-on-page-load


https://stackoverflow.com/questions/7536843/master-page-is-adding-additional-text-in-textbox-id


https://www.c-sharpcorner.com/UploadFile/301dc3/accessing-control-of-master-page-from-the-content-page-in-as/

No comments:

Post a Comment