Showing posts with label built. Show all posts
Showing posts with label built. Show all posts

Monday, March 26, 2012

Ajax Tool Kit

We have built a website using ASP.net 2.0 and Ajax 1.0 version. We are using AjaxTool kit for Calendar,CollapsiblePanelExtender(4) and few other Ajax controls.We have conducted performance Testing and found the page is taking more time. Based on the logfiles, I have observed that "CollapsiblePanelExtender" taking longer time.Component Time in MillisecondsASP.Net 9467.40Ajax Control 4170.57 To Process All Layers 300 Is the AjaxToolKit makes the application Slow ? Is there any work around to resolve the issue ?

Dear Sunny,

There could be a lot of content generated which is increasing your page size. Checkthis post specific to CollapsiblePanelExtender.

Also check the amount of viewstate generated. To compress viewstate, checkthis article.

HTH,

Suprotim Agarwal

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?

Wednesday, March 21, 2012

AJAX TabPanels and user defined controls

Hi,

I've built a control in which I implement the behaviour described in this video:How Do I: Trigger an UpdatePanel Refresh from a DropDownList Control? Basically, I want to update the nodes of a TreeView when I change the item in a DropDownList.

This works great except if I load the control dynamically into a tab panel...In this case, the first SelectedIndexChanged event doesn't trigger anything and all of the following events trigger a full page postback...

So, to sum this up:

    User control statically defined in a page -> OKUser control statically defined in a tab panel -> OK (it works when I put the code of the control inside the tab panel)User control dynamically loaded into a placeholder -> OK (using PlaceHolder1.Controls.Add(Page.LoadControl("WebUserControl.ascx"));)User control dynamically loaded into a tab panel -> NOT OK! (using both TabPanel1.Controls.Add(Page.LoadControl("WebUserControl.ascx")); and TabPanel1.ContentTemplate = Page.LoadTemplate("WebUserControl.ascx");)

I can't put the code of the control inside the tab panel statically (point 2 in the previous list) because the tab panels are being generated dynamically also...

Anyone has suggestions to solve this, please??

When are you adding these dynamically created controls? It sould be during the Page_Init event and not later (such as during the Page_Load).


I'm not adding the controls in the Page_Init as I can't do that...when my page first loads it has only a DropDownList with a list of options.

Then, when the selected option is changed, there is a postback (as the DropDownList has AutoPostBack = "True") and only then the tabs are created and the user control is loaded.

The user defined control is being rendered and is visible, but its behaviour is strange...


If you dynamically add your contorls into an updatepanel, the issue comes.

There are few good articles written byScott Mitchell on dynamically loading Controls which you will find in the following links:

Dynamic Controls in ASP.NETWorking with Dynamically Created ControlsDynamic Web Controls, Postbacks, and View State