TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Dorababu Meka
227
8.3k
1.7m
Javascript as Dynamic class
Jun 3 2013 2:12 AM
Hi all I have created a javascript function along with the scripts in a class file using string builder as follows
public static string ShowAlertMessage(string pHeader, string pError)
{
StringBuilder strScript = new StringBuilder();
strScript.Append("<script type=\"text/javascript\" src=\"").Append("Scripts/jquery-1.4.1.js").Append("\"></script>");
strScript.Append("<script type=\"text/javascript\" src=\"").Append("Scripts/jquery.msgBox.js").Append("\"></script>");
strScript.Append("<link rel=\"stylesheet\" type=\"text/css\" href=\"").Append("Styles/msgBoxLight.css").Append("\" />");
strScript.Append("<script type=\"text/javascript\">");
strScript.Append("function example()");
strScript.Append("{");
strScript.Append("$.msgBox({");
strScript.Append("title:'" + pHeader + "'");
strScript.Append(",");
strScript.Append("content:'" + pError + "'");
strScript.Append("});");
strScript.Append("}");
strScript.Append("</script>");
return strScript.ToString();
}
This method I am calling on each and every page on the button click where ever I required as follows
ClientScript.RegisterStartupScript(this.GetType(), "Popup", Alert.ShowAlertMessage("Hello", "Welcome"), true);
But this is not giving me the output I needed, the one which I converted is the following
http://jquerymsgbox.ibrahimkalyoncu.com/
can some one help me please to achieve my requirement
Reply
Answers (
7
)
How to keep a ActionLink to each row of the JQGrid
Jquery code is executing two times on ImageButton click.