Dynamically Change User Control in ASP.Net

后端 未结 4 1377
Happy的楠姐
Happy的楠姐 2020-11-30 05:55

I\'m trying to create a web page that will display an appropriate user control based on the selected value of a drop down list.

Basically the page layout is this:

4条回答
  •  半阙折子戏
    2020-11-30 06:48

    Don't add the control in the SelectedIndexChanged handler, add it during Page_Load. You'll just have to test the value of the dropdown each time the page loads, and load the correct control for that value.

提交回复
热议问题