Search content within the blog

Sunday, October 17, 2010


What is Thread.Join() in threading ?
There are two versions of Thread.Join :-
. Thread.join().
. Thread.join(Integer) this returns a Boolean value.

The Thread.Join method is useful for determining if a thread has completed before starting another task. The Join method waits a specified amount of time for a thread to end. If the thread ends before the time-out, Join returns true; otherwise it returns False. Once you call Join, the calling procedure stops and waits for the thread to signal that it is done.

Example you have "Thread1" and "Thread2" and while executing 'Thread1" you call "Thread2.Join()".So "Thread1" will wait until "Thread2" has completed its execution and the again invoke "Thread1".Thread.Join(Integer) ensures that threads do not wait for a long time. If it exceeds a specific time which is provided in integer the waiting thread will start.

Monday, October 11, 2010

Add a Row Number to the GridView

Here’s a simple way to add a Row Number to the GridView. Just add the following tags to your section of your GridView

<asp:TemplateField HeaderText="RowNumber">
<%# Container.DataItemIndex + 1 %>
and you will get the following output

Retrieve DIV value in ASP.NET using jQuery

In this example, we will see how to retrieve and display the value of a div in an alert box, on the button click event.

<html xmlns="">
<head runat="server">
<title>Retrieve Value of DIV in ASP.NET</title>
<script type="text/javascript"

<script type="text/javascript">
$(function() {

$('input[id$=btnClick]').click(function () {
var divValue = $('#div1').html();
return false;



<form id="form1" runat="server">
<div id="div1">Div Sample content</div><br />
<asp:Button ID="btnClick" runat="server" Text="Click" />