<%@ Control Language="c#" Inherits="uc_test" SRC="uc_test.ascx.cs"%>
Code-Behind - uc_test.ascx.cs
using System; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using System.Data; using System.Data.SqlClient; using System.Configuration;
public class uc_test : System.Web.UI.UserControl { private string _CustomProp; private string _CustomProp2;
public string CustomProp { get { return _CustomProp;} set { _CustomProp = value;} }
public string CustomProp2 { get { return _CustomProp2;} set { _CustomProp2 = value;} }
private void Page_Load(object sender, System.EventArgs e) { if (CustomProp == "Yes") { Response.Write ("<BR>The value of my custom property (CustomProp) is: " + _CustomProp); } else {
//Uncomment to test out the inserting the referrer to a database //string sqlText = Request.UrlReferrer.ToSting(); //GetDr( sqlText ); Response.Write ("<BR>The value of my custom property (CustomProp2) is: " + _CustomProp2); }