In this web programming tutorial we will learn that how we can call a javascript function from server side in asp.net using c#. see the below simple code in which we are trying to call a radiobutton click event that is defined in Client side, but we will call it on page load event in asp.net using c#.
Javascript Function in head section
Code for Function call in .CS file on Server side in page load event.
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
RBAllHis.Attributes.Add("onclick", "others()");
}
}