Alright this is in my aspx file in the ItemTemplate section of the repeater
<td><cwc:DataDropDownList runat="server" DataSourceID="rolesDataSource" SelectedValue=<%# Eval("Role") %>
DataTextField="Description" DataValueField="id" AutoPostBack=true OnSelectedIndexChanged=dropDownList_SelectedIndexChanged
ExtraData=<%# Eval("FirstName") %> >
</cwc:DataDropDownList></td>
And this is what the code for the DataDropDownList looks like:
namespace CustomWebControls
{
[ToolboxData("<{0}:DataDropDownList runat=server></{0}:DataDropDownList>")]
public class DataDropDownList : System.Web.UI.WebControls.DropDownList
{
string extraData;
[BindableAttribute(true, BindingDirection.TwoWay)]
public virtual string ExtraData
{
get
{
return extraData;
}
set
{
extraData = value;
}
}
}
}
If I set the ExtraData to be something like "wtf" in the aspx then in the drop down's postback it shows up fine. If I leave it at the <%# Eval("FirstName") %> the value ends up being null. And I eval that same item elsewhere and it works fine, so I know it's not a spelling mistake.

Repeater + Extended control not working
IraW
so the property code now looks like this:
public virtual string ExtraData
{
get { return ViewState["ExtraData"]; }
set { ViewState["ExtraData"] = value; }
}
Joao Talles
cis_student
JamesCandy
Good to see that you corrected by yourself using view state. Try the same thing with the control state
.
Regards,
Jimmy
erickson777
Anything you store in the control state remains there until it is explicitly removed. A web page developer can disable view state for the page however control state cannot be disabled.
Regards,
Jimmy