adsense

Friday, December 19, 2014

Easy clipboard management tool for .Net

Ditto is an extension to the standard windows clipboard. It saves each item placed on the clipboard allowing you access to any of those items at a later time.

Read more and download

Cheers
Samitha

Monday, November 17, 2014

.Net 2015

Check New features of .Net 2015..!!!

Monday, November 10, 2014

Linq Distinct By

When development with LINQ it seems that some of the essential methods is not provided. Morelinq comes into the aid of developers by providing bunch of those valuable methods.

download MoreLink

cheers

Samitha

Thursday, October 9, 2014

C# Latest News Website

Following website latest technology trends and news for C # developers. I found it is very useful .

The Morning Brew

Cheers
Samitha

Thursday, September 25, 2014

Using Jquery to check logged in user

When checking for the logged in user, normally we methods such as checking the Session object. It is really exciting that that this can be done from the client side using jQuery.

Following articles gives you the guidelines to implement it.

http://www.dotnetfunda.com/articles/show/2974/checking-for-logged-in-user-using-jquery-in-aspnet

Cheers
Samitha

Wednesday, August 27, 2014

ASP.Net keep Scroll Position On every Postback or Refresh

When a page is posted to the server the scroll position of the page resets, and  this causes the user  to scroll back to the part where the user was working on. ASP.NET 2 has introduced a property called MaintainScrollPositionOnPostback that will tackle this problem for you most of the times.

The issue get rather tricky when we place UpdatePanels in the page and scroll bars resets on each request. I have seen lot of users having difficulties resolving this issue and recently came across the following post that will provide you the desired workaround.

 Read more 
 http://en.hasheminezhad.com/scrollsaver

Regards
Samitha

Monday, August 25, 2014

Web Developer toolbar

This extension adds various web developer tools to the browser that can be really useful in web development. This extension is available for Chrome, Firefox and Opera.

Read more and download
http://chrispederick.com/work/web-developer/

Cheers
Samitha

Tuesday, July 29, 2014

JSON not Defined (IE 9)

When using JSON , IE 9 browser seem to behave bit strangely.  When I dig in to the issue i found that its because documents should be rendered in standards mode, as showing in the following code snippet.



...

Read more about document compatibility here.

Regards
Samitha

Sunday, July 13, 2014

Miscrosoft Exams online practice questions

Following web site offers online practice exams for some of the current Microsoft exams ( exams for Java, CPA hopefully will be added in the near future).

Available Microsoft exams includes
70-480, 70-482,70-483,70-484,70-485, 70-486, 70-331,70-332...

http://axiommanifold.com/#/

Cheers
Samitha

Thursday, June 26, 2014

jquery not working after postback

It seems that after a partial postback occured from an update panel jquery events does not work as expected. This can be solved by usin pageLoad() instead of $(document).ready() as shown in the following link http://encosia.com/2009/03/25/document-ready-and-pageload-are-not-the-same/

Cheers
Samitha

Monday, June 9, 2014

format Jquery autocomplete result set

If you want to customize the appearance of the jQuery autocomplete suggestion result set, you have to replace the _renderItem function with your own creation that produces the desired result. The function definition will be as follows.

 $(function () {

 $.ui.autocomplete.prototype._renderItem = function (ul, item) {
            item.label = item.label.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + $.ui.autocomplete.escapeRegex(this.term) + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1");
            return $("
  • ")
                        .data("item.autocomplete", item)
                        .append("" + item.label + "")
                        .appendTo(ul);
            };

    //attach your autocomplete to the textbox. See my previous post http://ssenarath.blogspot.com/2014/06/jquery-autocomplete-suggest-size-is.html
    $("#ContentPlaceHolder1_txtDesignation").autocomplete({
     ...
    });

    });

    A complete discussion of similar topic can be found in http://stackoverflow.com/questions/2435964/jqueryui-how-can-i-custom-format-the-autocomplete-plug-in-results

    Cheers
    Samittha

    Thursday, June 5, 2014

    Jquery Autocomplete suggest size is displayed larger than the textbox

    When you use Jquery to make an autocomplete, IE displays the width of the suggest window lager than the input box.To make the suggestion window smaller you can apply code as shown below.

     $(function () {

     $("#txtSearch").autocomplete({
                source: function (request, response) {
                    $.ajax({

                        contentType: "application/json; charset=utf-8",
                        dataType: 'JSON',
                        url: '../SearchEmployee.asmx/GetEmployeeSuggestionList',
                        type: "POST",
                        data: '{empCode: "' + request.term + '"}',
                        dataType: "json",

                        success: function (data) {
                            response($.map(data.d, function (item) {
                                return {
                                    label: item,
                                    value: item
                                }
                            }))
                        }
                    });

                }            minLength: 1,
                open: function(event, ui)
                {
                    $("#ctl00_cphMobileMainContent_txtSearch").autocomplete("widget").css("width", "300px"); 
                }       
     });
    });

    cheers
    Samitha

    Tuesday, May 13, 2014

    SQL Server Debugging with WinDbg

    Debugging in Server is a on of the concerns for modern developers. The following articles reveal information about a tool that can be used in SQL Server Debugging and what are the reasons for choosing it.

    http://www.sqlservercentral.com/blogs/aschenbrenner/2014/05/05/sql-server-debugging-with-windbg-an-introduction/

    Cheers
    Samitha

    Friday, April 11, 2014

    Colorize Crystal reports Controls

    If you have ever come across a situation where you need to colorize Crystal reports controls using Hex color values, there are few options you can choose between.
    1) Convert the color code to Hex in the sql using a funtion
    2) Convert the color code to Hex using a Crystal Reports custom function

    Following post provided step-by-step instructions on colorizing crystal report controls using a Crystal Reports custom function.

    http://www.paulspatterson.com/crystal-report-functions-to-colorize-background-using-html-hex-color-value/

    Cheers
    Samitha

    Saturday, March 22, 2014

    Redirect to new window using Reponse.Redirect

    We all know that we can use JavaScript's window.open method to open a new window.  I was curious if there is to achieve this from the code behind.  The answer is you can and there are various ways you can use depending on the requirement.

    I did it by using writing an extension method  to Reponse.Redirect as shown below.
    public static class ResponseHelper
    { 
    public static void Redirect(this HttpResponse response, 
    string url, string target, string windowFeatures) 
        { 
    
            if ((String.IsNullOrEmpty(target) || 
    target.Equals("_self", StringComparison.OrdinalIgnoreCase)) && 
    String.IsNullOrEmpty(windowFeatures)) 
            { 
                response.Redirect(url); 
            } 
            else 
            { 
                Page page = (Page)HttpContext.Current.Handler; 
    
                if (page == null) 
                { 
                    throw new InvalidOperationException("Cannot 
    redirect to new window outside Page context."); 
                } 
                url = page.ResolveClientUrl(url); 
    
                string script; 
                if (!String.IsNullOrEmpty(windowFeatures)) 
                { 
                    script = @"window.open(""{0}"", ""{1}"", 
    ""{2}"");"; 
                } 
                else 
                { 
                    script = @"window.open(""{0}"", ""{1}"");"; 
                }
                script = String.Format(script, url, target,
     windowFeatures); 
                ScriptManager.RegisterStartupScript(page, 
    typeof(Page), "Redirect", script, true); 
            } }
     }

    usage
    Response.Redirect(redirectURL, "_blank", 
    "menubar=0,scrollbars=1,width=780,height=900,top=10");
    This has been originally suggested in the following post. The post dscusses various ways you can achieve the same functionality.
    http://stackoverflow.com/questions/104601/response-redirect-to-new-window
     Cheers
    Samitha

    Saturday, March 1, 2014

    HTML 5 Readiness

    The following site is a valuable resource of indicating the HTML 5 readiness of popular browsers and how they have evolved over the years.

    http://html5readiness.com/

    Cheers
    Samitha


    Saturday, February 8, 2014

    using Google map inside update panel

    I  have tried to use the Google Map inside an updatepanel and it ended up giving me strange JavaScript error "javascript - Unable to get value of the property 'offsetWidth': object is null or undefined ".
    After some research I found that it occurred when you have build your map when the Maps API JavaScript has not loaded. I as able to solve the issue when I load the map as displayed below.

     <script type="text/javascript">
            function initialize() {
                var mapOptions = {
                    zoom: 6,
                    center: new google.maps.LatLng(7.0000, 81.0000),
                    mapTypeId: google.maps.MapTypeId.ROADMAP
                }
                var map = new google.maps.Map(document.getElementById("googleMap"), mapOptions);
            
                });
            }

            function loadScript() {
                var script = document.createElement("script");
                script.type = "text/javascript";
                script.src = "http://maps.googleapis.com/maps/api/js?key=<your_api_key>&sensor=false&callback=initialize";
                document.body.appendChild(script);
            }

            window.onload = loadScript;
        </script>

    for more information refer http://stackoverflow.com/questions/5478450/google-map-error-a-is-null

    Cheers
    Samith

    Saturday, January 11, 2014

    Using Google MAP control in Asp.Net

    There are various Google MAP controls available that can be used with Asp.Net. Listed below are few of popular Google MAP controls available.

    1) Subgurim google map
    2) Artem google map
    3) Reimers google map

     I have tried using all of the above controls but my exact retirement could not be achieved. My objective was to get the latitude  and longitude of the clicked location. The problem was I had two map controls on the same form and it seems if two map controls are used on the same form, click event of the second control does not get fired for some reason. I could not find the reason for this to occur and finally ended up using google API provided in w3shools which solved my problem.

    cheers
    Samitha