Manoj Maharana

Manoj Maharana

  • NA
  • 362
  • 123.8k

Dynamically binding headers reference of ascx in aspx page.

May 10 2019 4:52 AM
Dynamically binding headers reference in aspx page.
 
Example:
 
I have used multiple headers reference in single page in c#. Is there any way to bind these headers dynamicaly??
  1. <%@ Register TagPrefix="uc" TagName="SearchCountryObControl" Src="~/APIControls/SearchCountryObControl.ascx" %>  
  2. <%@ Register TagPrefix="uc" TagName="GetCompanyInfoControl" Src="~/APIControls/GetCompanyInfoControl.ascx" %>  
  3. <%@ Register TagPrefix="uc" TagName="SearchCityObControl" Src="~/APIControls/SearchCityObControl.ascx" %>  
  4. <%@ Register TagPrefix="uc" TagName="GetUserRoutingProfilesControl" Src="~/APIControls/GetUserRoutingProfilesControl.ascx" %>  
  5. <%@ Register TagPrefix="uc" TagName="GetRatePlanObControl" Src="~/APIControls/GetRatePlanObControl.ascx" %>  
  6. <%@ Register TagPrefix="uc" TagName="CompanyBilling1EControl" Src="~/APIControls/CompanyBilling1EControl.ascx" %>  
  7. <%@ Register TagPrefix="uc" TagName="GetAllProfilesControl" Src="~/APIControls/GetAllProfilesControl.ascx" %>  
below the method are calling like in aspx page(note that there is no code behind):
 
at single time i used only 1 reference.
  1. var searchCountry = new Voice.Vpbx.Api.UI.APIControls.SearchCountryObControl.SearchCountryObHelper();  
  2. var xml_response = searchCountry.GetAllCountry(lcData);  
  3. var searchCity = new Voice.Vpbx.Api.UI.APIControls.SearchCityObControl.SearchCityObHelper();  
  4. var xml_response = searchCity.GetAllInternationalCity(lcData);  
is there any way to bind these reference dynamically i.e. if this page loads then all the reference are loads so i want to load the single refrence by using dynamically. Is there any best way to do?

Answers (2)