Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

Monday, 28 April 2014

How to expose DevExpress ClientSideEvents in a User Control

User Control:
Markup:

Code Behind:

Page:
Markup:

Code Behind:

Tuesday, 11 June 2013

Add a print button for ReportViewer Reports in Google Chrome

Set up your report viewer as follows:

Friday, 2 November 2012

How to close the browser window without a prompt

If you want to close the browser window in asp.net with javascript but dont want to prompt the user you can use the below code:

Tuesday, 7 February 2012

How to fire an async postback from javascript

Friday, 16 December 2011

How to fire a non static code behind method from a javascript postback

I have found an interesting way of firing code behind methods from javascript functions without creating static web methods and ajax calls.

This in conjunction with an UpdatePanel produces a method that can be called from javascript that does not refresh the page.

If an update panel is used, then its a good idea to use the Id for a control inside the update panel so its marked for asyncrous postback, then differentiate between methods using the event argmument

to post back to the server using a javascript function the following code can be used:



We can then set the code behind to inspect the Request.Form collection for any postback information.

This can be very powerful as potentially any code behind method can be called!

Thursday, 18 August 2011

How to compare dates from an Ajax Calendar Extender

Markup:



Javascript:

Dynamically create and show a jQuery UI dialog from Javascript

If you need to create a jQuery UI Dialog dynamically from javascript, heres how!

Tuesday, 19 April 2011

Bring window to front with jQuery and Javascript

If you open a popup window via javascript it often appears behind the current page so the user may not notice it. A simple solution for this problem is to bring the window to the fron when it has finished loading. This can be achieved with a simple bit of jQuery and Javascript.

Wednesday, 13 April 2011

Javascript check for undefined or null object/variable