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
226
8.3k
1.7m
Jquery Yes or No confirmation from a class
Jun 4 2013 1:48 AM
In my previous question regarding the script in class this was extension I am creating a Yes/No confirm here I need to execute the code written in a function when user clicks on Yes
protected void btnclick(object sender,Eventargs e)
{
// Here my class with Yes/No script will be called based on the condition, after user select Yes I need to execute my code
}
My script in a class file
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("CSS/msgBoxLight.css").Append("\" />");
strScript.Append("<script type=\"text/javascript\">");
strScript.Append("(function example()");
strScript.Append("{");
strScript.Append("$.msgBox({");
strScript.Append("title:'Are You Sure'");
strScript.Append(",");
strScript.Append("content:'Would you like a cup of cofee?'");
strScript.Append(",");
strScript.Append("type:'confirm'");
strScript.Append(",");
strScript.Append("buttons:[{value:'Yes'},{value:'No'}]");
strScript.Append(",");
strScript.Append("success:function(result){");
strScript.Append("if(result=='Yes')");
strScript.Append("{");
strScript.Append("alert('One cup of coffee coming right up!')"); // Here Instead of alert I need to pass a value to form something like true or false
strScript.Append("}");
strScript.Append("}");
strScript.Append("});");
strScript.Append("})();");
strScript.Append("</script>");
Can some one help me.
Reply
Answers (
3
)
Jquery code is executing two times on ImageButton click.
ZoomImage on Mouse Over in Slideshow Image