Solved

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

Posted on 2007-04-06
1
242 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

707 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