Wednesday, February 10, 2010

AjaxControlToolkit and SmartNavigation

After spending almost 4 hours investigating the following problem with an Ajax extension object:




‘Error: Sys.ArgumentTypeException: Object of type ‘AjaxControlToolkit.PopupBehavior’ cannot be converted to type ‘AjaxControlToolkit.PopupBehavior’.
I finally realized the page was using the smartNavigation directive. This directive has become obsolete with .NET 2.0, you can now use Page.SetFocus() and Page.MaintainScrollPositionOnPostBack() instead to obtain similar result. However, during the upgrade process from 1.1, the wizard didn’t flag this directive as a problem, so I was not aware of its presence until I came across the problem above.
Anyway, I was not surprised that upon removing this directive, the page was no longer throwing the javascript exception.
Lesson learned.

source : http://rafsystems.com/2007/05/22/ajaxcontroltoolkit-and-smartnavigation/

Wednesday, December 16, 2009

Is it the same for everybody ?




Something to think..
Thought how true that is.... and will be....

Thursday, December 3, 2009

For Future Reference


The most common answer to this problem is to go to the Data menu and choose Show Data Sources. This option does not appear for me.
The Show Report Data Pane keyboard shortcut did work for me: CTRL+ALT+D. There is nothing in the menus that I could find that does this same thing.

WeakReference Class
http://msdn.microsoft.com/en-us/library/system.weakreference.aspx





Caching Dynamically Created Images
private void writeContent(HttpContext context, byte[] content, string contentType)
{

context.Response.Cache.SetExpires(DateTime.Now.AddMinutes(60));
context.Response.Cache.SetCacheability(HttpCacheability.Public);
context.Response.Cache.SetValidUntilExpires(false);

context.Response.ContentType = contentType;
context.Response.BinaryWrite(content);
}

Use this SP when you need to find all the SP Names which contains a certain term :

e.g if i need to search for the term 'orders', the following will return all the SPs which contains it

declare @SearchTerm varchar(50)
SET @SearchTerm = 'orders'

SELECT
ROUTINE_NAME,
ROUTINE_DEFINITION
FROM
INFORMATION_SCHEMA.ROUTINES
WHERE
ROUTINE_DEFINITION LIKE '%' + @SearchTerm + '%'
ORDER BY
ROUTINE_NAME

Copy Data Between DB Tables:

INSERT INTO [DBDestination].[dbo].[TableA]([Col1],[Col2],[Col3],[Col4],[Col5],[Col6])

SELECT [Col1],[Col2],[Col3],[Col4],[Col5],[Col6]
FROM [DBSource].[dbo].[TableA]