Solved

how to insert ONE link dynamicaly/on page load on a page

Posted on 2007-04-06
1
228 Views
Last Modified: 2013-12-17
is it and how is it possible to dynamicaly create control on a web page.

example:
a search engine search. one inputs keywords and then the search is executed. on the search results page i need each keyword to be a link, but there can be one, two, three or more keywords. how to dynamicaly insert the links on a page?

don't worry about iteration, just tell me how to insert ONE link dynamicaly/on page load on a page.
thnx

c# asp.net mssql
0
Comment
Question by:qwekovaqwe
1 Comment
 
LVL 15

Accepted Solution

by:
dave4dl earned 500 total points
ID: 18867408
first place a div in your page that you can drop controls in dynamically like so:

    <div style="width: 100px; height: 100px" runat="server" id="searchLinks">
    </div>

then add controls to it like so:
        HyperLink myLink = new HyperLink();
        myLink.Text = searchTerm;
        myLink.Target="http://mysite/mypage.aspx?"+searchTerm;
        searchLinks.Controls.Add(myLink);
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now