All
I have a bunch of label controls on my form. All those label controls
will start with the id "lblEffDt_" .
(lblEffDateValu e_ddlDeliveryMe thod, 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 EnableChangedCo ntrols(string controlName, string effDate)
{
((Label)("lblEf fDateValue_" + controlName)).T ext = effDate;
}
and I can call that fucntion as
EnableChangedCo ntrols("ddlDeli veryMethod", "01/01/07");
But it erros out with the message
"Cannot convert type 'string' to 'System.Web.UI. WebControls.Lab el'
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_" .
(lblEffDateValu e_ddlDeliveryMe thod, 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 EnableChangedCo ntrols(string controlName, string effDate)
{
((Label)("lblEf fDateValue_" + controlName)).T ext = effDate;
}
and I can call that fucntion as
EnableChangedCo ntrols("ddlDeli veryMethod", "01/01/07");
But it erros out with the message
"Cannot convert type 'string' to 'System.Web.UI. WebControls.Lab el'
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..
Comment