Tuesday, June 28, 2011

Allow Only Numbers in a Textbox

Dear Googler,

Sometimes we need the user to enter only numbers in a text filed, so I have some up with a small piece of JavaScript to do exactly that. It works for both IE and Firefox.

Code: JavaScript

function onlyNumbers (evt)
{
       var e = event || evt ; // for trans-browser compatibility

Friday, June 3, 2011

How to add Client-Side confirmation when deleting items in GridView?

Dear Googler,
When using ASP.NET GridView component, its really easy to display rows of data from 
database or from some other source.

In GridView there is no confirmation dialogs for Deleting of some important data.

Fortunately, there is an easy solution for this common requirement.

We only need to add one TemplateField to the Columns of the GridView, and to add 
LinkButton component to the ItemTemplate. Next we must set CommandName="Delete" 
property on LinkButton and then we can use controls OnClientClick event handler to 
add simple JavaScript confirmation box that will pop-up on the users screen when 
he/she clicks on this Delete link.

Here is the actual code snippet from the GridView declaration on page:

 
  <asp:TemplateField>
    <ItemTemplate>
        <asp:LinkButton CommandName="Delete" runat="server" Text="Delete" 
               OnClientClick="return confirm('Are you sure you want to delete this data Row?')" />
    </ItemTemplate>
</asp:TemplateField>


Here Confirm is the built-in javascript command. 
If user click the link button, the confirmation dialog will appear using the 
"Confirm" JavaScript function. If user click the yes button it will return true 
and our data is deleted, but user clicks No button it will return no and our data 
are not deleted.

Monday, January 31, 2011

How To Prevent Multi user Login In ASP.Net

Dear Googler,
               In this post, i explain how to prevent multi user login in web application. Here we are done some basic step. That is in the user table we add the "STATUS" Filed and then if the user Enter the web application the STATUS will be changed "1" and then the user properly click the logout button " We will change the STATUS as "0" using the Logout click button Event. Other wise the user click the Browser

Friday, January 28, 2011

VB.Net Golden Rule Capitalization


Dear Googler,

                In this post, how we are declare variables,classes and namespace in the programming language. Here I the VB.Net Capitalization rule

 Capitalization

Follow the standard Naming Guidelines established by

Thursday, January 20, 2011

Captcha Image Verification Using Generic HTTP Handler

Dear Googler,
         In this post, I explain how to Generate the Captcha image and verify that image using Generic HTTP Handler. Here these steps are given below.

Disable Back Button in Browser

Dear Googler,
          In this i explain how to disable back button in browser. It is very important for secure web application and website. Here we are using small piece of  javascript code to do this.

In the Script block just type the below code.

Wednesday, January 19, 2011

AdRotator Using Ajax Timer Control

Dear Googler,
        This is my First Post in my Blog. Here I post, How to use Ajax Timer Control in AdRotator.
We are all know, in the AdRotator Web Server Control need a XML file. So first we create a XML file. here is the Syntax