How to download embedded resources of webcontrol on AJAX call?
-
Hi, I developed a custom webcontrol in which all resources (like images, javascript etc) are embedded. Since everything is embedded only single DLL is deliverable. In the consumer page, its object is instantiated. Related html and resources gets rendered in the page response. Obviously the response gets heavier based on size of resources (plus lot of other toolkit generated files) Now, this is a modalpopup feature which is not used daily so we want to make it on demand. Which means that we don't want to instantiate control's object every time the page renders. But will provide a link of page which user can click-on to view the feature in a modal popup. At the click, an AJAX call will be made and will pull the necessary information and html to be displayed. The problem is how to download the embedded resources of webcontrol on AJAX call? It will also need the toolkit generated files too. Any ideas will be appreciated? Thanks Pankaj
-
Hi, I developed a custom webcontrol in which all resources (like images, javascript etc) are embedded. Since everything is embedded only single DLL is deliverable. In the consumer page, its object is instantiated. Related html and resources gets rendered in the page response. Obviously the response gets heavier based on size of resources (plus lot of other toolkit generated files) Now, this is a modalpopup feature which is not used daily so we want to make it on demand. Which means that we don't want to instantiate control's object every time the page renders. But will provide a link of page which user can click-on to view the feature in a modal popup. At the click, an AJAX call will be made and will pull the necessary information and html to be displayed. The problem is how to download the embedded resources of webcontrol on AJAX call? It will also need the toolkit generated files too. Any ideas will be appreciated? Thanks Pankaj
Microsoft has provided an HTTP Handler in ASP.NET 2.0 and greater that performs this task for you. It goes by the name of
webresource.axd
. Google[^] has plenty of examples on its use. Hope that helps. :)--Jesse
"... the internet's just a big porn library with some useful articles stuck in." - Rob Rodi