Wednesday, November 16, 2011

Repeat Headers in SSRS on each page and appear on scroll of the Page

This gave me hard time today.Finally figured it out.


To make the row headers to appear in every page and appear on scroll of the page


1) Click the grouping pane of the tablix
2) Click Advanced Mode
3) Set the Following Properties

  1. FixedData -- True
  2. KeepWithGroup -- After
  3. RepeatOnNewPage --True
4)Set FixedColumnHeaders and FixedRowHeaders to false for the tablix

Wednesday, November 2, 2011

Passing Table Valued Parameters to SQL Server Stored Procedures

Passing Table Valued Parameters to SQL Server Stored Procedures

Can also be used to pass arrays to SQL Server
1) Improves performance
2) Easy to Handle
3) Get Rids of  Changing Comma Separated values to table in SQL.

1) Works only with SQL Server 2008 and above

http://msdn.microsoft.com/en-us/library/bb675163.aspx
http://www.dotnetspeaks.com/DisplayArticle.aspx?ID=47

Friday, August 12, 2011

Display Status of Long Running Process in ASP.NET using Jquery.

Whenever we encounter a long process in a web application, we don't want the user to see frozen browser for long time. He may find it difficult to assert whether the process is done or not. So its better that  we display the progress or tell about each sub process completion in such scenarios.

We can achieve this by using Web Services and JQuery to call the web service asynchronously to find out the status of the application.

Attached is the sample application which demonstrates the same.

P.S: We cannot use session to hold the status as using session will force asp.net to process the web service requests only after the long running process.

Drop out your comments or questions if you have any. Please let me know if there is a better way to achieve this task.

Sample Application

Wednesday, August 3, 2011

SQL Server restore

SQL Server - Take Back up  and restore and execute to fix the orphaned users. When u restore u dont find the user in msdb. so u have to execute this  .. (not sure abt this )


exec sp_change_users_login 'auto_fix','UserName',NULL,'Password'

Sunday, June 5, 2011

Java script Optimization

1) Minify JavaScript and CSS
2) use CDN's wherever possible
3) use scripts at the bottom of the page (http://developer.yahoo.com/performance/rules.html)
4) CSS sprites for images
5) http://yuiblog.com/blog/2007/01/04/performance-research-part-2/
6) Add an Expires or a Cache-Control Header
7) Put Stylesheets at the Top
8)Make JavaScript and CSS External


http://www.jquery-asp.net/blog/squishit-javascript-and-css-compressor/

YUI


http://www.mattfitz.info/library/article/86



Friday, May 6, 2011

Handling Javascript Event Binding in Ajaxised Page.

We are using MS ajax to add a function that does the rebinds JS events to the elements.

$(window).load(function () {
 Sys.WebForms.PageRequestManager.getInstance().add_endRequest(RunThisAfterEachAsyncPostback);}
        });
This is the function that executes the rebinding code

 function RunThisAfterEachAsyncPostback(sender, eArgs) {
            try {

                if (eArgs.get_error() == null) {
// Rebinding 
                    $("#btnSaveSubScriptions").button();
                    $("#EventsCheckBoxList tbody td").find('input').click(Events_SubClick);
                }
                else {
                    alert("Error Occurred in the System.Please Contact System Admin");
                    alert(eArgs.get_error());
                }                
                
            }
            catch (err) {
                document.write("There are some errors on this page while loading...<br>" + "RunThisAfterEachAsyncPostback");
                document.write("Error is : " + err.description + " <br>Error number is " + err.number);
            }
        };

Wednesday, April 27, 2011

Giving Precedence to a Specific Asynchronous Postback

http://msdn.microsoft.com/en-us/library/bb386456.aspx

Sharepoint-Training 04/27/2010

mhacker@microsoft.com
http://blog.mikehacker.net

Sharepoint 2010 has cool features :)

Sharepoint Connections in Server Explorer to browse through sharepoint site ..

Event Receivers ... can write custom code to events thats happening inside sites ..

Web Parts ..

It is like developing a user control and using that control in a web page... here we develop a user control and deploy it in sharepoint sites.. Its like developing a normal web app .. sharepoint only supports .net 3.5 and 64 bit :)

Sharepoint Governance:


1) Someone has a need or concern about the service
2) That need is assessed against several things
 

Friday, April 15, 2011

Logging in .NET Applications

Logging is very common functionality that needs to be implemented across applications. The main concept for logging is it is common across many applications i.e. the logging remains same across applications. I was missing this idea until i read this article about logging.

"Ideally, the logging functionality would be logically and physically separate from the functionality of each individual page, and adding it to another site would be as simple as dropping an assembly in the site's /bin directory."

Until today i used to use two classes called Errorlog and ErrorLogDB which are the BO and DAO for the logging. I used to copy this classes to any new application i make. I used to write this code in catch block  in every function in every code behind and every method of BL and DAL classes


Old bad way of logging :

catch (Exception ex)
{
    ErrorLog er = new ErrorLog(ex, "functionname""classname");
    ErrorLogDB.Persist(er);
}


. Now i realize how wrong this approach is.

Ok !! Never Late than Never. Lets learn the better way :)



ELMAH: Error Logging Modules And Handlers



Adding ELMAH to an ASP.NET Web Application


Learning about HTTP handlers and Modules

A Brief Overview of HTTP Handlers and Modules


An HTTP handler is a class that is responsible for rendering a particular type of resource. For example, the code-behind class for an ASP.NET Web page is an HTTP handler, knowing how to render the markup for the particular Web page. It helps to think about handlers as specialized renderers that know how to create the markup for a particular type of resource.


An HTTP module is a class that can tap into the various events raised as a request passes through stages of its lifecycle on the server. One such ASP.NET application event is the Error event, which fires when an unhandled exception occurs



URL Rewriting

URL Rewriting in ASP.NET

Tuesday, March 1, 2011

Wednesday, February 9, 2011

Understanding ASP.NET Ajax Internals

This is a very good post about this i found

http://weblogs.asp.net/davidbarkol/archive/2007/03/25/asp-net-ajax-client-side-event-viewer.aspx