J
jdn
I have a simple problem that probably requires a simple solution but I
am obviously overlooking something.
I have a Address form on a ASP.NET page that include a state field. I
created a simple user control that is a drop down list of all 50 states
plus DC.
On a certain function (basically calling OnItemCommand from a datagrid),
I bind various textboxes and labels to the values pulled from a stored
procedure and they all work fine. But the User Control never gets the
proper value.
The user control has a public property that should set the selected
value for that dropdownlist such as:
public static string SelectedValue {
get { return ddlStateList.SelectedValue; }
set { ddlStateList.SelectedValue = value; }
}
and then I try to bind the value as such in the page it is embedded in:
_DDLStateControl.SelectedValue = myDataRow["State"].ToString();
In debugging mode, the myDataRow value is correct, but it doesn't
acutally set the selected value at all.
I reference the User Control in the page itself with
TagPrefix="UserControl" and TagName="StateList"
I'm wondering if I should be doing something like
UserControl:Statelist.SelectedValue = blah
but I don't know what the correct syntax is.
TIA
jdn
(e-mail address removed)
am obviously overlooking something.
I have a Address form on a ASP.NET page that include a state field. I
created a simple user control that is a drop down list of all 50 states
plus DC.
On a certain function (basically calling OnItemCommand from a datagrid),
I bind various textboxes and labels to the values pulled from a stored
procedure and they all work fine. But the User Control never gets the
proper value.
The user control has a public property that should set the selected
value for that dropdownlist such as:
public static string SelectedValue {
get { return ddlStateList.SelectedValue; }
set { ddlStateList.SelectedValue = value; }
}
and then I try to bind the value as such in the page it is embedded in:
_DDLStateControl.SelectedValue = myDataRow["State"].ToString();
In debugging mode, the myDataRow value is correct, but it doesn't
acutally set the selected value at all.
I reference the User Control in the page itself with
TagPrefix="UserControl" and TagName="StateList"
I'm wondering if I should be doing something like
UserControl:Statelist.SelectedValue = blah
but I don't know what the correct syntax is.
TIA
jdn
(e-mail address removed)