A
Abraham Andres Luna
hey everyone,
i have a control that inherits from dropdownlist:
using System;
using System.Web.UI.WebControls;
namespace RDK.WebControls
{
public class SelectedValueDropDown : DropDownList
{
protected override void OnInit(EventArgs E)
{
this.Items.Add(new ListItem("NONE", "NONE"));
}
public override string SelectedValue
{
get
{
return this.SelectedValue;
}
set
{
try
{
this.SelectedValue = value;
}
catch
{
this.SelectedValue = "Error";
}
}
}
}
}
when i try to set the selectedvalue i get a server application unavailable
error page
<%@ Page %>
<script runat="server">
void Page_Load(Object Sender, EventArgs E)
{
ddlWhich.SelectedValue = "ME";
}
</script>
<html>
<head>
<title>Drop Down</title>
</head>
<body>
<form id="frm" runat="server">
<RDK:SelectedValueDropDown id="ddlWhich" runat="server" />
</form>
</body>
</html>
how am i supposed to override/use the selectedvalue property
i have a control that inherits from dropdownlist:
using System;
using System.Web.UI.WebControls;
namespace RDK.WebControls
{
public class SelectedValueDropDown : DropDownList
{
protected override void OnInit(EventArgs E)
{
this.Items.Add(new ListItem("NONE", "NONE"));
}
public override string SelectedValue
{
get
{
return this.SelectedValue;
}
set
{
try
{
this.SelectedValue = value;
}
catch
{
this.SelectedValue = "Error";
}
}
}
}
}
when i try to set the selectedvalue i get a server application unavailable
error page
<%@ Page %>
<script runat="server">
void Page_Load(Object Sender, EventArgs E)
{
ddlWhich.SelectedValue = "ME";
}
</script>
<html>
<head>
<title>Drop Down</title>
</head>
<body>
<form id="frm" runat="server">
<RDK:SelectedValueDropDown id="ddlWhich" runat="server" />
</form>
</body>
</html>
how am i supposed to override/use the selectedvalue property