After adding CSS through code behind in asp.net on page_load, it works perfectly on my local environment but fails to work on the server. Here is the code snippet for your reference:
protected void Page_Load(object sender, EventArgs e)
{
string selectedValue = Request.QueryString["selectedValue"];
updateCareer.Attributes.Add("style", "word-break:break-all; word-wrap:break-word");
errordiv.InnerHtml = "";
if (!IsPostBack)
{
rep_Jobs.DataBind();
}
}
The error message I am encountering is:
'System.Web.UI.UpdatePanel' does not contain a definition for 'Attributes' and no extension method
'Attributes' accepting a first argument of type 'System.Web.UI.UpdatePanel' could be found (are you
missing a using directive or an assembly reference?)
Please advise on why this issue is occurring even though I have included all the necessary namespaces.