0
I need to add a conditional Usercontrol. How? if the Pap_id variable is equal to 134, I need to load a Usercontrol 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 to do this, because if I drag the usercontrol to the page it appears to the other applications too, but as stated, I want it shown only when the condition is met, if(Pap_id == 134).
You don’t want to use the resource
Visible="true"
of the components?– Evandro
Opa, I’m beginner in Asp.Net/C#, in case with this feature would leave it as false and pass to true inside if, this is it?
– Caio Vinícius
Simple as that! Arrow
true
appear, arrowfalse
occult..TextBox.Visible = "true"
– Evandro
Okay, you could tell me how to get the reference from the Usercontrol that’s on the aspx page in Codebehind?
– Caio Vinícius
take a look at this example: link
– Evandro