Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Control Placing

Status
Not open for further replies.

koraykazgan

Programmer
Jan 11, 2005
17
0
0
DE
Hi there,

My problem is:
I have a Web Custom Control, a LinkLabel. It is a component which takes an ID of any entity in my program. It gets the text from DB by using the given ID and displays it on the page. When the user clicks on that label, the page will navigate to a new page, displaying the detail of the given ID.

e.g.:
<MyControl id="myControl" runat="server" entityID="234" />
renders like the following on page:
<span onclick="navigateToPage('./detailPage.aspx?id=234');">Name get from DB</span>

So far so good.
Now what I need to do is the following. I have an asp:Label which is storing the following text:
"The Person {0} is the admin."

This text is created dynamic and I need to replace the "{0}" string with the HTML Output of my LinkLabel control.

It is not enough to only render the HTML. When the LinkLabel control is put on the page, it registers some client side functions. I also need this methods to be registred.

So is there a way of putting controls to specific positions in a label? As I said, the position in the text and the count of how many labels should be created are dynamic and not known at design time.

Thanks for help,
bye.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top