Load Load Control C #

0

I need to add a UserControl conditionally. In what way? if the variable Pap_id is equal to 134, I need to load a UserControl that displays two inputText for the user to enter a start date and an end date:

  var Pap_id = Convert.ToString(Request.Params["app"]);

  if (Pap_id == "134"){

     //Adicionar UserControl      

  }

This code is in the PageLoad () of a page called details.aspx. I would like to know how I do this, because if I drag the usercontrol to the page it appears to the other applications as well, but as said, I want it to be shown only when the condition is met, if (Pap_id == 134). >     

asked by anonymous 27.02.2018 / 12:57

0 answers