Quantcast
Channel: Shailesh – Broken Code
Browsing latest articles
Browse All 60 View Live

IIS 404 Custom Error not working as expected

When I tried to access fake .aspx page to make sure IIS returns custom 404 error page, I saw .net specific error “The resource cannot be found”. Screenshot# 1 I was wondering why IIS custom 404 error...

View Article


ASP.NET session expires before timeout value specified in Web.Config

Note: You can refer this article to know more about different ways to store session state. There are number of reasons why values stored in session being lost before session timeout value set in...

View Article


Add JavaScript inside Head at runtime

I was wondering how can I emit JavaScript within the <HEAD> element of ASP.NET page from code behind.  I knew that we can insert JavaScript using RegisterClientScriptBlock and...

View Article

Visual Studio 2010 Keyboard Shortcut Posters

I always hate to use mouse while writing code in Visual Studio to do certain things like go to line, bring up solution explorer/Team Explorer window,  comment out code etc..  I prefer to use short cut...

View Article

Troubleshooting Scrum for Team System v2.2 installation in TFS 2008

We recently upgraded TFS 2005 to TFS 2008.  Since we follow Agile-Scrum methodology, we had Scrum for Team System template installed in TFS 2005.  It wasn’t so easy to migrate TFS 2005 to TFS 2008 so...

View Article


Fatal Execution Engine Error (7A036050) (80131506)

I recently installed PowerCommands for Visual Studio 2008 SP1 and after that whenever I open any existing project’s solution, Visual studio crashes immediately.  I looked at the event log to see if...

View Article

Case Insensitive String Replace

When we do string comparison or string replacement, it’s good practice to compare/replace string ignoring the case of string unless there is a need of it. It’s very simple when you want to compare two...

View Article

Understanding Silverlight Basics

In this article I will give you an overview of how browser renders Silverlight application and what are the main components that involves during the execution of Silverlight application. Let’s create...

View Article


Error while trying to view work item

I recently installed SP1 for Visual Studio 2008.  When I try to open any work item, I ended up getting the following error. Could not load type...

View Article


Generic Method – How to specify type constraint on T for enum type

In my current application I really need to write a generic method that accept any enum type as a parameter. Let me first explain my situation why I need generic method.  Here is the method that I need...

View Article

Difference between “throw” and “throw ex”

Have you ever wonder what’s difference between “throw ex” and “throw’?  I used to do “throw ex” from inside catch block rather than “throw”.  But it’s really need to know the different between those...

View Article

ModalPopupExtender without TargetControlID

You need to specify Control ID (clicking on this control trigger to open modal popup) to TargetControlID property of ModalPopupExtender control and TargetControlID is required property.  If you don’t...

View Article

Session is null in ASHX handler

I was trying to access session inside ASHX page but I was getting a null reference exception.  I think session should be available on every request but it’s not the case with ASHX handler.  I was wrong...

View Article


How to: Bind Jagged array or Single dimension array to repeater control

In this article I will show you how you can bind Jagged array or single dimension array to the repeater control. 1) Jagged array Let’s create Jagged array first. Create repeater control on the aspx...

View Article

How to define Enum in JavaScript

Everybody familiar with Enum in server side scripting language.  I was wondering if we can define Enum type in JavaScript and I found that we can define type as Enum. Here is the syntax to define Enum....

View Article


Response.Redirect() throws an error when called inside Update Panel

When I tried to call Response.Redirect() inside a UpdatePanel, it was throwing me an AJAX error. Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be...

View Article

why does Modalpopup close on postback?

ads: Watch Indian TV Serials Online I thought modalpopup control is very easy to use but it’s not.  It took me whole day to figure it out why ModalPopup Extender closes down during page postback. You...

View Article


ASP.NET color converter tool

Wants to convert HEX to RGB or RGB to HEX in C# ASP.NET application? I have created Color Converter ASP.NET application.  You can convert HEX color code values to RGB Color.  It’s free tool.  I have...

View Article

Join Video files(mpg, flv) using DOS command

I have downloaded couples flv files and I wanted to join those files so that I can watch video file by just opening one video file.  I was looking for freeware software I can use to join mpg or...

View Article

File upload control fails first time, then works on subsequent submits

As everybody knows that FileUpload control doesn’t work inside update panel, there are some work around and in fact I have posted post about that as well.   Here is my post link just in case you got...

View Article

Howto: Set page focus to message after Ajax update

There are so many good things about AJAX but we need to tweak it some times to make it even user experience. Let me explain my situation first.  I have a datagrid that has a edit button tied to...

View Article


Can’t drag and drop Song/Video file in iTunes

Usually I just drag and drop music(mp3) files into itune when want to add  music file into my iPhone 4.  But suddenly I can not drag and drop songs in iTunes after updating iTune software to version...

View Article


ASP.NET Custom Validator Validation not firing

I have been using ASP.NET CustomValidator when I want to validate field based on values of other fields. For example, User must provide other contact info if selected.  For this let says we have other...

View Article

Howto: Fire an ASP.NET Validator from JavaScript

Let’s take an example of my previous post and make it little bit user friendly.  Here is the demo page link to see in live action. In the example(#1. Without ValidatorEnable), Custom validator fires...

View Article

Howto: Pass own argument as a custom attribute to a specified control from...

I learn something new today that I want to share with you.  How can you pass your own argument to any JavaScript Element object from code behind that you can access it like property of that object from...

View Article


Silverlight 4 DataGrid Example with Add Edit Delete using Linq WCF

In my previous article , I have explain in details how you can bind data, update and delete record in silverlight data grid.  But it has missing feature to add a new record. I took some time to update...

View Article

Getting Started with Silverlight PivotViewer control

Microsft LiveLabs team released very useful Silverlight “PivotViewer” control that enables you to visualize data information in a DeepZoom type experience.  In this article, I will walk you through the...

View Article

how to handle control’s event inside of nested repeater

In this article I will show you how can you handle control’s event that is inside of nested repeater control and pass informative message from user control to main page(f.e success/failure message). I...

View Article

How to find child control’s position in a parent repeater

If you have repeater inside a repeater, in some situation you may need to find position of control( that’s inside child repeater) in parent repeater.  Let’s take an example.  Here is what I have. As...

View Article



Forms authentication doesn’t work in IE

I have found interesting thing about IE that I would like to share with you.  I was using forms authentication for login page.  After successful login, ASP.NET creates an authenticated cookie and sends...

View Article

ASP.NET jQuery Banner Rotator

Recently I have created a simple jQuery banner rotator using ASP.NET that has following features. 1) Bind dynamic data 2) Rotates banner in every 5 seconds (configurable) 3) Pager 3) Jump to any banner...

View Article

Tips for your TFS 2010 migration, more lesson learned

Last couple weeks I have been busy migrating TFS 2008 to TFS 2010.  I would like to share my experience and other website links/posts that helped me a lot. Here are couple useful links. Whats new in...

View Article

Red “X” on TFS Documents and Reports

There are two different permission needs to be set to be able to access “Documents” and “Reports”.  Documents are hosted on sharepoint site so you need to give user permission to sharepoint site and...

View Article


TFS Build strategies for large projects

For large projects that has multiple solutions and many dozens class library projects, Scheduled build or Continuous Integration build often takes lot of time to build entire projects.  The reason not...

View Article

What is RESful service and designning RESTful service using ASP.NET

REST stands for Representational State Transfer.  REST is an architecture style for designing networked applications.  RESTful applications use HTTP requests to post data (either insert or update),...

View Article

Cross Domain ASP.NET Web API Call Using ajax

If you have created RESTful API (using ASP.NET Web API) and creating a nice UI using jQuery ajax call, you may be running into cross domain ajax call issue.  Under the same origin policy, you CAN’T...

View Article


USA State, Counties and Zipcode Boundaries in .shp and .kml formats

Your search ended up here so you may be looking for USA State, Counties or ZipCode boundaries.   I do have USA State, Counties and ZipCode boundaries in .shp and .kml format.   If you are using Google...

View Article


How to convert shape file to kml file using GDAL utilities

I will show you in this article how you could convert shapefile (.shp) to KML file for use in Google Earth or Google Maps.  Many government entities release some portion of their GIS data for public...

View Article

How to track website with multiple Google Analytics accounts

We have built the product that our clients can easily build website and feed content into it without requiring any technology background.  Our client is using Google Analytics to measure user...

View Article

Why is Facebook not reading OG tags?

I have all open graph tags rendered properly in my web page even though Facebook wasn’t reading those OG tags.  I used Facebook debugger tool to see what Facebook sees exactly when it scrapes my web...

View Article

Free tools to compare .net assemblies

There are various tools available to compare .net assemblies.  Most of them are paid version or requires lot of efforts to find code level differences between two assemblies or DLLs.  If you want to...

View Article


HttpCompileException error when browsing asp.net web application

If you setup a new asp.net web application on new application server, you may encounter following error when you browse your asp.net web application.  If you look at the error message, it says that it...

View Article

Useful queries when troubleshooting performance issues in SQL Server

Here are the some of the queries which are very useful when troubleshooting performance issues in SQL Server. This query will return actual execution plan of a given stored procedure. select...

View Article


How to grant permission to domain account to manage windows service

Domain account would need  some special permission to interact with windows service if web application is setup to run under domain or service account and web application needs to interact with windows...

View Article

Useful PowerShell Commands

Below is the list of PowerShell commands that you will find very useful if you are using PowerShell scripting to automate various tasks and if you are in DevOps. Get the registry property values using...

View Article


Invoke-Command with -UseSSL

PowerShell Remoting uses Windows Remote Management (WinRM), which is the Microsoft implementation of the Web Services for Management (WS-Management) protocol, to allow users to run PowerShell commands...

View Article

WhiteSource integration with TeamCity

WhiteSource is a tool which automatically detects all open source components in your code and also alerts if any of those components has security vulnerabilities.  This tool can be used to enforce your...

View Article

How windows authentication works with IIS (Http.sys, Kerberos, NTLM)?

IIS sits on top of HTTP.sys, which is the kernel mode driver in the Windows network stack that receives HTTP requests. IIS picks up requests from http.sys, processes them, and calls http.sys to send...

View Article

Add TDE encrypted database to an Availability Group

You will see below error when you try to add database to availability group if database is TDE encrypted.  This is also an issue when you restore TDE enabled database and then you try to add it back to...

View Article


How to run Fortify Static Code Analyzer for .Net Code

Fortify is a set of software security analyzers that search for violations of security specific coding rules and guidelines in a variety of languages. It finds the security issues early in the...

View Article

Browsing latest articles
Browse All 60 View Live