LoGanathan
I am LoGanathan. I am a Software professional. I write here on the technologies that I like, learn and use.
Thursday, 24 January 2013
Wednesday, 16 January 2013
Posted by Logu on 01:59 with No comments
There’s a couple of exceptions to look out for when you start developing custom ASP.NET Ajax client controls. They are:
These errors can be caused when you have a custom control/component which gets added and then re-added at some later point in time – such as when you have a partial page render. This is being caused because the Sys.Control or Sys.Component gets registered with the Sys.Application when you call the initialize method of your component like so:
Under the hood, the Sys.Application keeps a list of all the components that are registered with it – that’s how $find works. So when you call ‘initialize’, Sys.Application looks at the list of components that it currently knows about and if yours already exists then you will likely see one of the errors listed above.
The trick is to make sure that you call dispose on your control’s base when you are finished:
Microsoft JScript runtime error: Sys.InvalidOperationException: Two components with the same id ‘ctl00_MainContentPlaceHolder__eventsRepeater_ctl01_ke1′ can’t be added to the application.
and…
Microsoft JScript runtime error: Sys.InvalidOperationException: A control is already associated with the element.
These errors can be caused when you have a custom control/component which gets added and then re-added at some later point in time – such as when you have a partial page render. This is being caused because the Sys.Control or Sys.Component gets registered with the Sys.Application when you call the initialize method of your component like so:
MarkItUp.Web.MyCustomControl.callBaseMethod(this, ‘initialize’) ;
Under the hood, the Sys.Application keeps a list of all the components that are registered with it – that’s how $find works. So when you call ‘initialize’, Sys.Application looks at the list of components that it currently knows about and if yours already exists then you will likely see one of the errors listed above.
The trick is to make sure that you call dispose on your control’s base when you are finished:
dispose : function() {
$clearHandlers(this.get_element()) ;
// any other cleanup work
MarkItUp.Web.MyCustomControl.callBaseMethod(this, ‘dispose’) ;
}
Friday, 11 January 2013
Posted by Logu on 02:40 with No comments
looks at the
<system.web> section of Web.config instead of the <system.webServer> section (which is used by IIS7, unless it's running in compatibility mode). To render this meta tag on every page of your site when running IIS6, I believe the best option is to add it to your MasterPage. I ended up adding the following code block to the OnPreRender event of my MasterPage:Page.Header.Controls.AddAt(0, new HtmlMeta { HttpEquiv = "X-UA-Compatible", Content = "IE=EmulateIE7" });The reason I used AddAt instead of just plain Add is because the X-UA-Compatible meta tag apparently has to be the first thing in the page header in order for it to be respected.
Hope this helps someone in the same boat!
Categories: .Net
Search
About Me
Categories
Blog Archive
Popular Posts
-
I have created a team calendar mainly to share meetings, travels and vacations plans. Because I also wanted to manage differently those eve...
-
Create a folder in your C drive called backup. Then give the path as C:\backup This will save the backup file in c:\backup folder You dont h...
-
This slide show web part displays the images with it's original size. Due to this the web part changes its size according to the image s...
-
In this article,how we can use the Ajax Control Toolkit in Sharepoint 2010.using this sharepoint designer and Visuval studio. 1.Download the...
-
PowerShell command are, Backup a Site Collection with PowerShell command Backup-SPSite -Identity http://myserver -Path "c:\......bak...
-
However when we try to add conditions for formatting I cannot add more than 5 Conditions? How can this be overcome? Yo...
-
The picture library webpart uses the css classes in corev4.css in sharepoint 2010. The web part uses “ .ms-WPBody ” css class for styling. I...
-
First step from the site actions drop down choose view all site content on the blogsite Click on the comments list And choose list from ...
-
There’s a couple of exceptions to look out for when you start developing custom ASP.NET Ajax client controls. They are: Microsoft JScript r...
-
Adding a new menu item to the SharePoint welcome/user menu is fairly straight forward. Thanks to Sohels blog for pointing me in the right di...





