?
Solved

VB.Net and JQuery Provoking

Posted on 2011-09-23
3
Medium Priority
?
276 Views
Last Modified: 2012-05-12
I want to use JQuery statement. But I want to be able to use ASP.Net button to check for something and if the value detects that an error has occured. I want to then display the JQuery statement.

Here is the code it needs to call. Can I add something on the aspx.vb side to allow me to call the jquery?

Thanks,
Jeff
<script type="text/javascript">

		(function($){

			$(document).ready(function(){
				
				$.jGrowl.defaults.closer = false;

				if ( !$.browser.safari ) {
					$.jGrowl.defaults.animateOpen = {
						width: 'show'
					};
					$.jGrowl.defaults.animateClose = {
						width: 'hide'
					};
				}

				$.jGrowl("An Error has occured.", { sticky: true });
//				$.jGrowl("Another notification.", { sticky: true });
//				$.jGrowl("One last one to make a trifecta.", { sticky: true });
			});
		})(jQuery);

		</script>

Open in new window

0
Comment
Question by:jeffreyjseaman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 21

Assisted Solution

by:Craig Wagner
Craig Wagner earned 2000 total points
ID: 36592424
If I understand correctly, the user clicks your button, a postback occurs, you do some processing in the code-behind of the page (i.e. on the server side), and if some condition is true to want to execute the jQuery that you've listed. Does that sum it up?

If that's the case, you basically need to inject the jQuery into your page when the condition occurs under which you want to execute the jQuery. The page has a property called ClientScript which is a ClientScriptManager object. You should look at using the  RegisterStartupScript method. Here's the documentation page with examples.

http://msdn.microsoft.com/en-us/library/z9h4dk8y.aspx
0
 

Accepted Solution

by:
jeffreyjseaman earned 0 total points
ID: 36592580
I got it to work. I set a Session Variable on the Page Load. Then I called that variable from JQuery.

That actually did it for me.

Thanks,
Jeff
0
 

Author Closing Comment

by:jeffreyjseaman
ID: 36813390
User figured it out. Needed to reward someone points for helping.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month11 days, 14 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question