May be duplicate but how can I do this in a webpart?
ClientScript.RegisterStartupScript(this.GetType(), "alert", "HideLabel();", true);
What should I import for this? Importing from Page is not working
This article is a great reference for this exact question.
Although I'm not sure what version you're on, it looks like your syntax is incorrect.
ScriptHelper.RegisterStartupScript(this, typeof(string), "alert", "HideLabel();", true);
Thanks a lot Brenden, works perfect.
Please, sign in to be able to submit a new answer.