FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Embed Javascript for Alert and self.close in C# .NET





shenyl
I have developed these 2 JS that I find useful in my Web Development.

You can cut and paste as a class within your source code, and use the Static Class methods.

You need to use Response.Write(one of the 2 static methods).

Here are the codes:

public class clUtilJS
{
// To form an JS Alert Message
static private string jsText1 =
"<script language=javascript>alert(\"";
static private string jsText2 = "\")</script>";
static private string jsSelfClose =
"<script language=javascript>self.close();</script>";

public clUtilJS()
{
//
// TODO: Add constructor logic here
//
}

static public string SetJSAlert(string INMsg)
{
// Format the JS statement to be Send to the Browser
return (jsText1 + INMsg + jsText2);
}

static public string JSSelfClose()
{
// Return the Javascript for self.close
return jsSelfClose;
}

}

Feedback for improvement are welcomed.
Related topics
Drag images (Javascript)
What computer languages you know?
Feedback Wanted :)
visual basic.net
Java tutorials
Password Protecting a webpage
skrypt do odtwarzania filmów na www
customize this search code for me and earn 75 Frih$
Applying for C# .NET Developer Position
Need help with site getting error on http://validator.w3.org
dot.tk how to remove ads it works for me
:O An OS in C#/.NET ?!
How does javascript linked to an asp.net page?
How to make javascript alert bomb work on operamini browser?
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.