PDA

View Full Version : [CLOSED] ASHX handler - returning javascript and other questions



macinator
Oct 31, 2013, 12:53 PM
Hi,

I am very new to EXT.net so please forgive these beginner questions

I am writing panels where it's important that I limit the amount of postbacks (as they are dynamically generated forms that need to be recreated at every postback) - so I was thinking that I would send the server destined data to an ashx handler who's job it is to evaluated the data and return javascript that would then be evaluated on the client

so questions

1. if i have a event listener (say a button click) that does a event with the url being a ashx handler, does this invoke a postback of the page ?

2. if not how to i return javascript from my handler and have that jscript evaluated to dynamically update the page - please provide a simple example

3. if so can you suggest another alternative and provide a simple example ?

Thanks

Mac

Daniil
Oct 31, 2013, 3:21 PM
Hi @macinator,

First of all, IMHO, you are on the right way. I mean avoiding PostBacks and using ASHX handlers instead.



1. if i have a event listener (say a button click) that does a event with the url being a ashx handler, does this invoke a postback of the page ?

No, it doesn't.



2. if not how to i return javascript from my handler and have that jscript evaluated to dynamically update the page - please provide a simple example

3. if so can you suggest another alternative and provide a simple example ?


It is best to use DirectEvents or DirectMethods. Here are examples with WebServices.
http://examples2.ext.net/#/Events/DirectEvents/WebService/
http://examples2.ext.net/#/Events/DirectMethods/WebService/

There won't be any principal difference with ASHXes.