How to display different System.Web.UI.UserControl under different circumstances?

M

mehdi_mousavi

Hi folks,

Consider a System.Web.UI.UserControl, say ProductCtrl, that's supposed
to display 3 different products based on a given property at run-time.

<%@ Register TagPrefix="uc1" TagName="ProductCtrl"
Src="ProductCtrl.ascx" %>
<uc1:productCtrl id="m_ctrlProduct" runat="server"></uc1:productCtrl>

for example, if the Brand property is set to "BMW" *at runtime*, the
control has to display the BMW form, while it'll display the Benz form
if the mentioned property is set to "Benz". I've got 2 other user
controls, one for Benz, and the other for BMW. How can I display the
given UserCtrl, at this page.

TIA,
Mehdi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top