Showing posts with label JAVASCRIPT. Show all posts
Showing posts with label JAVASCRIPT. Show all posts

Friday, December 20

Snow falls using javascript


Introduction:-
                   In my previous article i have explained scrolling of a page using jquery. Now a days a dot net developer can do whatever they wants by coding.In this article i have created a animated page using javascript,After writing all these code you can get a similar looks of snow falls in your web page.

Description:-
 
               
                  Now i am going to describe the process.First create one .aspx page and inside that page ,give script tag i,e:<script type="text/javascript"> and inside that script tag write your jvascript functions.
I am randomly created that points which exactly looks like snow falls.It will be better for me to explain you with a example.so i am going to give a overlook on my .aspx page, where i have explained all the functionality.Now you have to write the code like shown below. 

Saturday, June 8

How to Scroll Page from Top to Bottom and from Bottom to Top Using Jquery/Javascript

Introduction:-
                 In this article i have explained  How to Scroll Page from top to bottom and from bottom to top using Jquery/Javascript.
Description:-
       
     In this article i have created one aspx page and has taken three html div where ID as top,div1 and div2 in three different background color for distinguish each other.I have taken three contents for this example but you can take as many contents you want.Created one javascript function and called this function dynamically in jquery click event.

Thursday, April 18

How to Bind State by Selecting Country DropDownList using WebMethod in Asp.net

Introduction:-
                 In this article I have explained  how to bind a dropdownlist using Ajax.
Description:-
               Some developers binding the dropdownlist directly in pageload.which will give low performance to your site.Now a days every user wants to avoid unnecessary postbacks during any events.Lets take a common example that  I want to bind a state list according to the country selection. I can do it in code behind selectedindexchange event,but it will result performance issue as discussed previously,so I will prefer to use ajax here.

How to Upload and Save Image Without any Postback by User in Asp.net

Introduction:-
                  Here I have explained how to store and display image instantly after choose by user in asp.net using jQuery.
Description:-
                 In this article I have explained how to avoid upload button functionality after choosing a image in asp.net. Some users usually don't likes to view image after clicked on upload button or any button control,They always prefers to view image instantly after selecting a specific image from dialog box.
               It make sense that it will possible only if we will use ajax or some client side functions.so here I am using javascript functions with taking one Image control and File upload button to open a dialog to choose a image from it.In my other post I have explained
How to Update previous Image URL During Update Mode , and  FileUpload Content Refreshed During pageloadif it is used in a user control .
 
 To get the result follow the below steps. where I  have explained each content with source code.

How to Save Image in Different Size in Asp.net

Introduction:-
                     This article explains how to create a image with different size in asp.net.
Description:-
                     In my previous post How to Upload and Save Image Without any Postback by User in Asp.net ,I have explained on image file validation check in javascript as well as instantly reading the image after selecting from dialog box.Here I am going to explain how you can store that same image in different sizes.
   
                   You have to specify some unit to store image in different sizes.As I have explained before you have to take one image upload control and one image viewer control.There is so many different approach is there to do this work but I am providing code which is very simple to implement as well as light weight than other approaches.

Tuesday, December 4

How to get Checkboxlist value with comma Separator by jquery

Introduction:-
                     Here I have explained How to get Checkboxlist value with comma Separator using  jquery  in asp.net.
Description:-

Now here I will explain how you can get the values of checkboxlist using jQuery.As many you can get the output,for example if you check 3 checkboxes then you will get 3 outputs with comma separator.

Monday, November 19

How To use google map in asp.net

Introduction:-
                 
                  Here I have explained how to create a Google map using javascript in asp.net.

Description:-
                
                  In this article I have given three different examples to create a Google map in your asp.net application. Also explained how to create latitude and longitude of an area using javascript function.I have provided the source code for three different examples.

Thursday, November 1

How to call javascript function in code behind

Introduction:-

                  
                    Here I have explained how to call a javascript function from code behind and a simple javascript alert message from code behind in asp.net.
 

Description:-

 Here I will explain how to show a alert message from code behind as well as javascript function call from code behind in asp.net application.

Sunday, October 28

Create your own Calculator By Using Jquery


Introduction:-

                  Here I have explained how to create one calculator using jquery.

Description:-

                  In my previous article I have explained Image cropping using jquery ,Differnt types of jQuery combobox in Asp.net ,How to calculated Value difference between two dates using JQuery? .


Here I am going to create a simple web page which will looks like a calculator having all similar features. For this I have taken few buttons and labels control. I am preparing this calculator by using JQuery.

I have provided here lots of functionality which is generally used in a calculator. This calculator is having all the basic operators. It is most important that along with calculator functionality there must be a proper design. By the way design has the vital role in a application.

I have written some inline style which is not recommended, you just put these CSS into a file and call that style sheet to your page.

For this you should have the jQuery plug-in inside your application or you can use any online plug-in for it. Then take one .aspx page and follow the below process.

Tuesday, September 4

How to Show a pop up with Grid View row data using String Builder ? and How to change Gridview Row Color Dynamically ?


Introduction:-

                     Here I have explained how to show gridview row data in pop up  using string builder as well as I have explained how to change gridview row color dynamically.

Description:-

                  In this article I will explain how to show a pop up view like modal pop up using string builder. For this I have taken one gridview control and checkbox inside that gridview. Here I have also explained how to select all checkboxes at a time and also uncheck.


I will explain it more briefly with my source code and table design structure.


Most of the developer uses modal popup control to show records,but I am providing one new procedures to show record in the same manner.


As I have discussed, here I am going to explain, how to show gridview row data in pop up using String Builder.

I have used here one aspx page with a gridview control. Also I have used two images as CloseTab2.jpg and SearchButton.gif in my images folder and .js script in Scripts folder and one sql server database ShibashishDatabase.mdf in App_Data folder as shown Below.

Thursday, August 9

Download Source Code AutoComplete TextBox Using Webservice Application

I am shibashish mohanty going to show you a simple Auto complete Application using web services.

Dopwnload Source Code From My Code Project Article

My source Code:-


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TextBoxAutoComplete.aspx.cs" Inherits="Test.LINQInsert" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function setCompanyMasterID(source, eventargs) {
            document.getElementById("Label2.ClientID").value =
                                         eventargs.get_value();
            document.getElementById("Label2.ClientID").value =
       document.getElementById("TextBox1.ClientID").value;
        }
</script>
    </head>
<body>
  
    <form id="form1" runat="server">
<asp:ScriptManager runat="server"></asp:ScriptManager>
   
   
    <table >
        <tr>
            <td  >
                ID</td>
            <td>
    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
   
   
            </td>
        </tr>
        <tr>
            <td>
                Name</td>
            <td>
                <asp:TextBox ID="TextBox4" runat="server" AutoPostBack="True"
                    ontextchanged="TextBox4_TextChanged"></asp:TextBox>
                <asp:AutoCompleteExtender ID="TextBox4_AutoCompleteExtender" runat="server"
                    DelimiterCharacters=""
                Enabled="True" MinimumPrefixLength="1"  ServicePath="Service1.svc" ServiceMethod="TXTSEARCH" TargetControlID="TextBox4"></asp:AutoCompleteExtender>
            </td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
    <p>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
            DataSourceID="SqlDataSource1">
            <Columns>
                <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False"
                    ReadOnly="True" SortExpression="ID" />
                <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
            ConnectionString="<%$ ConnectionStrings:TestConnectionString2 %>"
            SelectCommand="SELECT * FROM [TextboxAutoImpliment]"></asp:SqlDataSource>
    </p>
    <p>

     <asp:TextBox ID="TextBox1" runat="server" AutoPostBack="True"
                   ></asp:TextBox>
                <asp:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server"
                    DelimiterCharacters=""
                Enabled="True" MinimumPrefixLength="1"  ServicePath="Service1.svc" ServiceMethod="GetCountries" OnClientItemSelected="setCompanyMasterID" TargetControlID="TextBox1"></asp:AutoCompleteExtender>
          
        <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
        <asp:Label ID="Label3" runat="server" Text="Label"></asp:Label>
          
       </p>
    </form>
</body>
</html>


My Code Behind:-
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Threading;
namespace Test
{
    public partial class LINQInsert : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
          
        }

        protected void TextBox4_TextChanged(object sender, EventArgs e)
        {
            DataClasses1DataContext d1 = new DataClasses1DataContext();
            var res = (from result in d1.TextboxAutoImpliments
                       where result.Name.ToLower().StartsWith(TextBox4.Text.ToLower())

                       select new { ID = result.ID }).Take(10);
            foreach (var id in res)
            {
                Label1.Text = id.ToString();
            }
        }

      
       
    }
}

My webService Method:-

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Configuration;
using System.Data.SqlClient;
using AjaxControlToolkit;

namespace Test
{
    /// <summary>
    /// Summary description for AutoComplete
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
    // [System.Web.Script.Services.ScriptService]
    public class AutoComplete : System.Web.Services.WebService
    {

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }

        [System.Web.Services.WebMethod]

        public static string[] GetSuggestions(string prefixText, int count)
        {

            try
            {



                string conStr;

                conStr = WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;

                string sqlQuery = "SELECT [Name],[ID] FROM [TextboxAutoImpliment] WHERE Name like @Name";



                SqlConnection conn = new SqlConnection(conStr);

                SqlCommand cmd = new SqlCommand(sqlQuery, conn);

                cmd.Parameters.AddWithValue("@Name", prefixText + "%");

                conn.Open();



                SqlDataReader dr = cmd.ExecuteReader();

                List<string> custList = new List<string>();

                string custItem = string.Empty;



                while (dr.Read())
                {

                    custItem = AutoCompleteExtender.CreateAutoCompleteItem(dr[0].ToString(), dr[1].ToString());

                    custList.Add(custItem);

                }



                conn.Close();

                dr.Close();



                return custList.ToArray();



            }

            catch (Exception ex)
            {

                throw ex;

            }

        }

    }
}
My database Look:-

Aftter Running View:-


Dopwnload Source Code From My Code Project Article

 Thanks Shibashish Mohanty

.

ShibashishMnty
shibashish mohanty