Skip to main content


Showing posts from 2011

javascript close current window without prompt

I searched a lots of solution for closing window without prompt and I got lots of script, but scripts was  not working for all the version of  internet explore some working in IE7 and some in IE8 so I wrote an unique solution which works in all version of internet explore.

Browser detection in javascript

Here is the article for accessing browser info like(Name, version, user agent, cookies enable or disable etc) through javascript it can be done through an object named navigator, navigator object have lots of properties e.g appName for Browser Name,appCodeName for getting Code Name, appVersion for getting browser version info, userAgent etc.

Customize comment box in blogger

Now it is possible to customize your blogger comment box in simple way there no need to edit HTML of your blogger just through the adding some simple css to the blogger.

jquery find text in table and highlight

The bellow article is for how to highlighting text into a webpage through java script you can try demo bellow just type words to the text box it will be highlighted in the table as yellow background color you can add you custom css for the highlighted text but the name of css class must be .highlighted.

What is NameSpace in .Net

This a basic question which allways asked in the interview that what is the namespace ,do you know about namespace,can you tell me some words about namespace.

How to make find and search functionality in html table through javascript

I have search a lot of article for how to make search in HTML table but i didn't find any good article so i wrote my own article for that,Here is a script given bellow for how to make search in HTML table the question is that how to use this code so here is the step by step instructions :- 

What is abstract class in c#

Abstract class is a class that contain complete and abstract (incomplete) both type of member and it can not be instantiated, Abstract classes are one of the essential behaviors provided by dotnet.

What is a Interface in C# .Net

Interface is a type which contains only the signatures of methods, delegates or events, it has no implementation. Implementation of the methods is done by the class which implements the interface.

Scrollable Gridview with fixed headers in

horizontal and vertical scrollable Gridview with static header row.fixed header in gridview in header in gridview through java script.I was looking for a solution for this for a long time and found most of the answers are not working or not suitable for my situation i also find most of the java script code for that they worked but only with the vertical scroll not with the horizontal scroll and also combination of header and rows doesn't match.

Scrollable HTML Table with fixed header in javascript

Horizontal and Vertical scrolling table with static headerrow.Fixed headers in large HTML tables.static header in table through java script.I was looking for a solution for this for a long time and found most of the answers are not working or not suitable for my situation i also find most of the java script code for that they worked but only with the vertical scroll not with the horizontal scroll and also combination of header and rows doesn't match.

Where and in which format View State information stored in a webpage in

View state data stored in which format. where is view state information stored (server or client)?
View state data is stored in the client side(Webpage) in the form of a hidden control(HTML hidden field) named “__VIEWSTATE” and View State Data is stored in Base64 String encoded format which can be further decoded.

Select all div text in single click in JavaScript

Here is the code for selecting a div content through javascript with single click of button or mouse click,just copy and paste javascript code given bellow and call the function selectText at the button click and pass the parameter divid.

Highlighting text inside div in JavaScript

The bellow article is for finding a text on the a div content and highlighting that search text.
we can use this article by two waygetting highlighting search text through the prompt of java script or pass default highlighting search text to the function.

An Analog Clock Widget for Blogger or WebSite

Here is the code for getting an analog clock widget  for your blog or for your website, This all clock as on Indian time just copy and paste code bellow on your page where you want to show the clock.

Highlighting text in web pages in JavaScript

Below article is for finding a text on the webpage(document) and highlighting that search text.
we can use this article by two way getting highlighting search text through the prompt of java script or pass default highlighting search text to the function.

Finding, convert text input into hyperlink in JavaScript

The bellow article is for finding a text on the webpage and convert that text into a link.
we can use this article by two way 
Getting search text and link herf through the prompt of javascript or pass default search text and link href to the function.

Scrolling a Div in JavaScript

Here is a example to scroll div through javascript by clicking a button or linkbutton bellow is 5 linkbutton for scrolling different-different way to a div content Scroll Top,Bottom,Absolute,Up and Down.

What is AppSetting Section in Web.Config file in

Web.config file defines configuration for a web project. Using "AppSetting" section, we can define user-defined values (custom key value dictionary) like "service url, stop word, Max Connection, mail server, mail port etc, that will be accessible through configuration  manager class through out the project for any other purpose.
<appSettings>    <addkey="connection1"value="server=tdsw008;database=ERM; uid=sa;pwd=********;"/>    <addkey="connectionSAP"value="server=;database=ACDB_PROD;uid=sa;pwd=********"/>    <addkey="ServerName"value="tdsw017"/> </appSettings>

What is event bubbling in Asp.Net

Handling(tracking) child controls events (only button type child controls) through parent control in data bind controls known as event bubbling.

Identifying that the Page is Post Back or not in

When you need perform different different task according to Get and Post request type then you should know about current request of which type and how to identify it.

Accept only number in a text box in JavaScript

similar: 1) Allowing only certain character in a text box. 2) Validation in TextBox which accepts only numbers value. 3) Allow only numbers / digits in TextBox.
Here is the code bellow

Binding a version in two version of same assembly in GAC.

You need to specify “bindingRedirect” in your config file. For instance in the below case “ClassLibraryVersion” has two versions “1.1.1830.10493” and “1.0.1830.10461” from which “1.1.1830.10493” is the recent version. However, using the bindingRedirect we can specify saying “1.0.1830.10461” is the new version. Therefore, the client will not use “1.1.1830.10493”

What is Boxing and Unboxing In .Net Framework

Boxing and unboxing act like bridges between value type and reference types. When we convert value type to a reference type it’s termed as boxing.
Unboxing is just vice-versa. When an object box is cast back to its original value type, the value is copied out of the box into the appropriate storage location.

What is ILDASM (Intermediate Language Disassembler) Tool In .Net Framework

Interview Questions:-
When it comes to understanding of internals, nothing can beat ILDASM. ILDASM converts the

What is a CLS (Common Language Specification) In .Net Framework

This is a subset of the CTS, which all .NET languages are expected to support. It was always a dream of Microsoft to unite all different languages in to one umbrella and CLS is one-step towards that. Microsoft has defined CLS, which are nothing but guidelines, that language should follow so that it can ommunicate with other .NET languages in a seamless manner.

CTS , CLS Explaition :
CTS is a base class library that contains all type information like Int32, Int64, String Boolean etc.  CLR understands only base type of library type not others type like CLR dont know what is int (C#) or Integer (VB)CLR only know Int32 type, So what about the CLS - CLS just a documentation that map base type into different - 2 language datatype, compiler reads and converts language datatype to documented base type (i.e CTS type) e.g compiler reads the associated base type of int(C# Integer in VB) is Int32 from CLS guidelines and convert it to Int32.

Exporting Pie Chart into excel file from csharp

This Article shows how to make a 3D Pie chart from a datatable into an Excel file , save this file and open the excel application through C#. It works with .Net Development Server  while it will not not work in application
hosted on IIS cause IIS does not allowed to start a process on server at all.

using Excel=Microsoft.Office.Interop.Excel;

Calling server function on fileupload text change in

How to Post a page to server on fieupload path change by client in Here is a code for doing postback when u click on browse button of a file upload and choose a file then Page posted to the server through linkbutton refrence and server involk the linkbutton_click event and you can upload your file at linkbutton click event.

//****************Code of .Aspx File************** <asp:FileUploadID="fu"onChange="FileUploadPostBack();"

Importing all sheet of excel 2003 .xls,2007 .xlsx file into dataset and bind it to gridview in c#

In this article you will see how to import all sheet from excel 2003 and 2007 file to c# dataset object and then you will display this data into girdview.

Method ImportExcelXLS given below takes two parameter first full path of .xls or .xlsx file and another bool type hasHeaders that is for including header of sheet or not, if you want to import data client file then you need to upload this file through fileupload and save this posted file to the server then pass this server full file path to this method and display data to girdview.

Uploading files to ftp server programmatically in

This code sample shows how to use using C# code to programmatically upload files to an ftp server,There is a lot of ways  to upload file to FTP Server here is the two of them first using with FtpWebRequest and another withWebClient.

Importing data from excel 2003 file in a gridview in c#

In this article you will see how to import given sheet from excel 2003 file into dataset and then display this data into girdview.
Below is the code for import data from given sheet named Sheet1$ into dataset then bind it to gridview, change sheet name as per your excel sheet name you have to ad suffix $ in sheet name.

Exporting gridview data into excel (.xls,.xlsx) file in c#

How to export table/gridview/datagrid to excel in :- To export a datagrid or a gridview data we have to get rendered html in server side for that we use 'RenderControl' property of controls which gives the render html in a HtmlTextWriter and then copyied in a StringWriter. For exporting a table add an attribute Runat='Server' in table MyTable = ID of Gridview/Datagrid/table (runat='server')

using System.Web.UI.HtmlControls;

show alert message from server side

If you want to show msg if you are posting the page to server through update panal (asynchronous postback) then you have to use this function.

//During Asynchronous Post Back in Update Panal Use ScriptManager (Inside Update Panal) public void alertBox(string Message)

Moving Image through javascript like flash file in

This article used for making slide show from JavaScript. Many time we need to do such task like moving images in html pages or an aspx page then we think about flash to do that task but it is must to install flash plugin in client browser,so we need an alternative solution of flash to move image just like flash, so here is the solution for making image slide solution through javascript, Just Add Your Image In Picture Array And Add Fuction to body onload.

Validation for blank field in javascript

Here is the code for validate text box for not to be leave blank it pop up a message box when user leave field blank 'The required field has not been filled in' just copy and paste this code and pass the parameter that is id of text box.

function check_blank(tbId) { var tbObj = document.getElementById(tbId); if (tbObj.value.length == 0 || tbObj.value.charAt(0) == " ") {         alert("The required field has not been filled in"); returnfalse;     } }

How to validate dropdownlist in JavaScript

In this article you will see how to put validation in dropdownlist by javascript, suppose first item value of dropdownlist is 0 and text is "-Select-" just like given below and we have to validate that at least one item is selected excluding default i.e "-Select-".

Validate radiobuttonlist in javascript

Here is the function for validating radiobutton list to select at least on Item through JavaScript radio button list is a ollection of rediobuttons so we have to navigate all sub radio button and check that if selected or not.

Geting controls inside a table in javascript

Often we need to navigate in html container controls like table, div, p etc through JavaScript for doing some type of validation or another task with child of that container control for that we need to

How to open print dialog box to print page or part of the page in JavaScript

some time we need to print only a portion of page or whole page through Javascript, Javascript provide a function named print() to print the current page, so if you want to print whole page then just call window.print() function but if you want to print specific portion of the page then you need to do something extra. Handler For Writing and Downloading Binary

An ASP.NET HTTP handler is the process (frequently referred to as the "endpoint") that runs in response to a request made to an ASP.NETWebapplication. The most common handler is an ASP.NETpagehandler that processes .aspx files. When users request an .aspx file, the request is processed by the page through the page handler. You can create your own HTTP handlers that render custom output to the browser.

The HttpHandler is apre-processing logic implementationblocks and is the part of the ASP.NET request pipeline. Whenever theIISServerrecieves a request, it looks for anISAPIfilter(looking for the perticuler httphandler to handle a perticuler extension) that is capable of handlingweb requests.
ASP.NET maps HTTP requests toHttpHandlers. Each HttpHandler enables processing of individual HTTP URLs or groups of URL extensions within an application.Handlers are considered to be more lightweight object than pages. That's why they are used to serve dynamically-generated images, on-the…

Comparing two date in JavaScript

This is an article to show how to calculate two date difference using JavaScript.

By subtracting two date java script returns difference in milliseconds so if we want to show difference in days then we have to convert milliseconds value into days by multiplying some factor.

Back button in JavaScript

Go Back using Java Script:-
Here is an article showing that how to redirect to a back page within client side through java script.

Java Script have a method history.back() by which we can go to the just back page in browser through browser cache if cache not removed otherwise from server side.

<asp:LinkButtonID="btnBack"runat="server"style="font-size:14px;color: Black ;font-family:Arial;font-weight:bold;"Text="Back"OnClientClick='javascript:history.back(); return false;'/>

Making compute column in with conditions

A question came up in the My Mind as to how to handle Data Column Expressions within a DataTable in Ado.Net. The expression syntax available to create calculated columns is probably much richer than you might think if you don't play around a lot with the Expression Property of the DataColumn.

Sending email in with email body

This article is for sending email from with the use of gmail smtp server for that we have to required gmail credential, provide SmtpClient class for connecting to the smtp server andMailMessage for getting mail requirement.

Get Server Name and Server Port No in Asp.Net

As we know that there is a need to get server name or port no at run time that request came from where, is port no exist or not to make application dynamic URL, assume when we are working in

Sending emails in using Gmail Credentials

This article is for sending email from with the use of gmail smtp server for that we have to required gmail credential, provide SmtpClient class for connecting to the smtp server and MailMessage for getting mail requirement.

Refreshing page in Javascript

In this article we will see that how to refresh or reload a page through Java Script there are a lot of ways to refresh or reload a document depending how we want (from server side

Access Query string in javascript

Many time we need to access query string through javascript for a specific task but there is no built in funciton of javascript to access querystring.

You have to make your own function just read current url string by window.location.href property of javascript, split this urlstring by the char '?' and '&', enumerate this array of string and further split by the char '=' then the first value must be the key and second one is the value of that key.