// I wrote the following code but it is not working.
// Any help please?
// ------------------------------------------------
using System;
using System.Collecti ons;
using System.Componen tModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.Sess ionState;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.H tmlControls;
namespace Testings
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class CallJavaScriptF romServerCode : System.Web.UI.P age
{
private void Page_Load(objec t sender, System.EventArg s e)
{
string toRed = "<script language=\"java script\"> ";
toRed += "function RedIt() { ";
toRed += "document.bgCol or = \"red\"; } ";
toRed += "</script>";
if(!IsClientScr iptBlockRegiste red("bgColor"))
{
RegisterClientS criptBlock("bgC olor",toRed);
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArg s e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeCompo nent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeCompo nent()
{
this.Load += new System.EventHan dler(this.Page_ Load);
}
#endregion
}
}