Using HyperLink Control

Saranya Boopathi
Posted by Saranya Boopathi under VB.NET category on | Points: 40 | Views : 747
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="HyperLinkTest" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">

<html xmlns="" >
<head runat="server">
<title>HyperLink Test</title>
<form id="form1" runat="server">
<div id="container">
<h1>HyperLink Test</h1>
Use list to specify link:<br/>
<asp:DropDownList ID="drpLinks" Runat="server"

<asp:ListItem>Select a company</asp:ListItem>
Here is a link:
<asp:HyperLink ID="hypTest" Runat="server" />

 protected void drpLinks_SelectedIndexChanged(object sender, System.EventArgs e)
if (drpLinks.SelectedIndex > 0)
string company = drpLinks.SelectedItem.Text;
hypTest.Visible = true;
hypTest.Text = company;
hypTest.ToolTip = "Go to the web site of " + company;
hypTest.NavigateUrl = "http://www." + company + ".com";

Comments or Responses

Login to post response