[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Consultant

2/25/2004 4:20:00 PM


In a test project, I have created two WebForms and one WebUserControl that contains a textbox and a button. I would like to display a string in the textbox when the WebForm1 is used, but another string when WebForm2 is used. How can I do this? Do I have to create 2 different classes and then reference them in the "@ Register" directive, like this?

In WebForm1:
<%@ Register TagPrefix="uc1" TagName="WebUserControl1" Src="WebCtrlForForm1.ascx" %>

In WebForm2:
<%@ Register TagPrefix="uc1" TagName="WebUserControl1" Src="WebCtrlForForm2.ascx" %>

But what about the default class that is created when I create the WebUserControl? Is it safe to delete it? Sorry for so many question, but WebControls are a subject that I cannot really understand.

Any help is appreciated...

Thank you very much.
Mike