HTML Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs"
Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Parts</title>
</head>
<body>
<form id="form1" runat="server">
<div>
Part No:
<asp:DropDownList ID="ddlpartno" runat="server" AutoPostBack="True">
<asp:ListItem Text="part1" />
<asp:ListItem Text="part2" />
<asp:ListItem Text="part3" />
</asp:DropDownList>
<p>
<asp:HyperLink ID="lnkpartdetail" runat="server">Part Details</asp:HyperLink>
</p>
</div>
</form>
</body>
</html>
Code:
using System;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
lnkpartdetail.NavigateUrl =
String.Format(
"~production/pn_detail.aspx?pnpartnumber={0}",
ddlpartno.SelectedValue);
}
}