June 03, 2014

How To Import Excel data to ASP.Net



Import excel data to ASP.NET

Hello Friends

In our daily life there are various situations in which we have to show entire excel sheet data  to our ASP.Net GRIDVIEW/REPEATER etc.
So to solve this type of problem is very easy.

  1.    Firstly please define the column name in excel file, so that we can compare it in our ASP.Net code to bind it in the GRIDVIEW/REPEATER.
  2. Suppose we have two columns in excel file (First is(A1)-->Name, Second is(B1)-->Mobile)
  3.   So to do this firstly we create a connection for excel file.
  4.  Then read the data from excel sheet.
  5.   Save it in a datatable.
  6.  Bind it to GRIDVIEW/REPEATER.
  7.   Dispose the datatable.
  8. In below code i have remove duplicate mobile numbers also.

May 31, 2014

JQuery ajax autocomplete extender textbox using json response type

 

JQuery ajax autocomplete extender textbox using json response type


In this post we will discuss about how to implement autocomplete functionality for counties textbox by using jquery, jqueryui, jquery ajax and response type json.



Asp.net-HTML combobox using JQuery UI


Asp.net-HTML combobox using JQuery UI

By using JQuery-UI plugin we can easily convert asp.net dropdown or html select control to combobox.
In this example we will convert the asp.net dropdown (html select) as combobox which will allow the users to type and select the value from the list (similar to autocomplete extender) and clear the input if the entered value is not there in the list.



May 27, 2014

Count characters in Text box just like way2sms.com



Count characters in Text box like way2sms.com

Some time in the normal world we need to type in text box just like way2sms.com. i.e. "160" character remaining. So to do this we need to do simple below JavaScript function.

December 24, 2013

Javascript Validation Part 8 ( Various Card Validations)

Validation Part 8 ( Various Card Validations)

  1. <html >
    <head>

        <title>JavaScript form validation - checking non-empty</title>
        <style type="text/css">
            li
            {
                list-style-type: none;
                font-size: 16pt;
            }
            .mail
            {
                margin: auto;
                padding-top: 10px;
                padding-bottom: 10px;
                width: 400px;
                background: #D8F1F8;
                border: 1px soild silver;
            }
            .mail h2
            {
                margin-left: 38px;
            }
            input
            {
                font-size: 20pt;
            }
            input:focus, textarea:focus
            {
                background-color: lightyellow;
            }
            input submit
            {
                font-size: 12pt;
            }
            .rq
            {
                color: #FF0000;
                font-size: 10pt;
            }
        </style>
       

Javascript Validation Part 7 ( checking all letters and numbers)

<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JavaScript form validation - checking all letters and numbers</title>
    <link rel='stylesheet' href='form-style.css' type='text/css' />
</head>
<body onload='document.form1.text1.focus()'>
    <div class="mail">
        <h2>
            Enter your Registration Number and Submit</h2>
        <form name="form1" action="#">
        <ul>
            <li>
                <input type='text' name='text1' /></li>
            <li class="rq">*Enter numbers and alphabets only.</li>
            <li>&nbsp;</li>
            <li>

Javascript Validation Part 6 ( checking all numbers)

<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JavaScript form validation - checking all numbers</title>
    <link rel='stylesheet' href='form-style.css' type='text/css' />
</head>
<body onload='document.form1.text1.focus()'>
    <div class="mail">
        <h2>
            Input registration number and submit</h2>

October 28, 2013

Javascript Validation Part 5 (Registration Form Validation)


<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Registration Form Validation</title>
<script language="javascript" type="text/javascript">
function validate() {
var summary = "";
summary += isvalidate();
summary += isvalidateFirstname();
summary += isvalidateLocation();
if (summary != "") {
alert(summary);
return false;
}
else {
return true;
}
}
function isvalidate() {
var uid;
var temp = document.getElementById("<%=user.ClientID %>");
uid = temp.value;
if (uid == "") {
return ("Please Enter UserName" + "\n");
}
else {
return "";
}

Javascript Validation Part 4 (Checking-length-restriction)

<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JavaScript form validation - checking-length-restriction</title>
    <link rel='stylesheet' href='form-style.css' type='text/css' />
    <style type="text/css">
        li
        {
            list-style-type: none;
            font-size: 16pt;
        }
        .mail
        {
            margin: auto;
            padding-top: 10px;
            padding-bottom: 10px;
            width: 400px;
            background: #D8F1F8;
            border: 1px soild silver;
        }
        .mail h2
        {
            margin-left: 38px;
        }
        input
        {
            font-size: 20pt;
        }
        input:focus, textarea:focus
        {
            background-color: lightyellow;
        }
        input submit
        {
            font-size: 12pt;
        }
        .rq
        {
            color: #FF0000;
            font-size: 10pt;
        }
    </style>

Javascript Validation Part 3 (Checking non-empty Text)

<html lang="en">
<head>
   
    <title>JavaScript form validation - checking non-empty</title>
    <style type="text/css">
        li
        {
            list-style-type: none;
            font-size: 16pt;
        }
        .mail
        {
            margin: auto;
            padding-top: 10px;
            padding-bottom: 10px;
            width: 400px;
            background: #D8F1F8;
            border: 1px soild silver;
        }
        .mail h2
        {
            margin-left: 38px;
        }
        input
        {
            font-size: 20pt;
        }
        input:focus, textarea:focus
        {
            background-color: lightyellow;
        }
        input submit
        {
            font-size: 12pt;
        }
        .rq
        {
            color: #FF0000;
            font-size: 10pt;
        }      
    </style>