<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="HyperLinkTest" %>
HyperLink Test
File: Default.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class HyperLinkTest : System.Web.UI.Page
{
protected void Page_Load(object sender, System.EventArgs e)
{
if (drpLinks.SelectedIndex == 0)
hypTest.Visible = false;
}
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";
}
}
}