Showing posts with label loads. Show all posts
Showing posts with label loads. Show all posts

Monday, March 26, 2012

AJAX to grab a server controls RenderContents() output

Hi everyone,

My web application dynamically loads custom built server controls at runtime from seperate assemblies using the reflection namespace. Everything works fine, and the server controls display on the page as required.

I would like to extend this, to enable the server controls to be displayed asycronously. Is it possible to make an asynronous request to the web server and then when the server control is loaded, pass back the HTML that is generated in the RenderContents() method as the responseText?

How would I go about doing this? Example code would be great.

Any help is much appreciated,
Ad

Hi,

I'm still stuck on this on this one, any ideas?

Thanks again,
Ad


Hi,

Please refer to this:Emailing the Rendered Output of an ASP.NET Web Control, it implements the function you need.

Hope this helps.

NOTE:This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


This link looks like a good start, but a bit more sample code especially on the Ajax part would be very helpful.

Regards

Dion


Hi Dion,What probelms do you have after you've got the output of a control?

Saturday, March 24, 2012

AJAX Tabs

How would I access the ajax tab index in javascript?

How would I add an auto scroll on the tab menus, so that when the page loads it loops through each tab in a loop?

Hi,

You can manipulate the tabContainer object on client side by finding a reference to it.

For instance:

var tc = $find("ClientIDOfTheTabContainer");

tc.get_tabIndex();

For more information about the functions and properties that tabContainer exposes, please refer to Tabs.js in the source code of AjaxControlToolkit.


I tried to accessing the tabcontainer using your example and it didn't work. I tried to access it adding the script block inside the body and in the head tag and neither worked. Do I have to register the script block with the page?

var tc = $find("TabContainer1_cllTabControl_7Tab_0");
alert(tc);

var tc = $find("TabContainer1");
alert(tc);


try this;

var tabContainer = $get('<%=TabContainer1.ClientID%>')