S
Sue
All
I have a bunch of label controls on my form. All those label controls
will start with the id "lblEffDt_".
(lblEffDateValue_ddlDeliveryMethod, lblEffDateValue_txtPriority
etc...)
I want to have a common function, which receives the id of the
control as a string (which would be the string after the _ underscore
in the lblEffDate) along with actual value and based on it set some
value.
private void EnableChangedControls(string controlName, string effDate)
{
((Label)("lblEffDateValue_" + controlName)).Text = effDate;
}
and I can call that fucntion as
EnableChangedControls("ddlDeliveryMethod", "01/01/07");
But it erros out with the message
"Cannot convert type 'string' to 'System.Web.UI.WebControls.Label'
Is there an easier way to do this. I have whole lot of controls on the
webform and doing something similar will help.
thanks
sue..
I have a bunch of label controls on my form. All those label controls
will start with the id "lblEffDt_".
(lblEffDateValue_ddlDeliveryMethod, lblEffDateValue_txtPriority
etc...)
I want to have a common function, which receives the id of the
control as a string (which would be the string after the _ underscore
in the lblEffDate) along with actual value and based on it set some
value.
private void EnableChangedControls(string controlName, string effDate)
{
((Label)("lblEffDateValue_" + controlName)).Text = effDate;
}
and I can call that fucntion as
EnableChangedControls("ddlDeliveryMethod", "01/01/07");
But it erros out with the message
"Cannot convert type 'string' to 'System.Web.UI.WebControls.Label'
Is there an easier way to do this. I have whole lot of controls on the
webform and doing something similar will help.
thanks
sue..