"If at first you don't succeed; call it version 1.0" :-Unknown

Pages

Showing posts with label ASP.NET Ajax. Show all posts
Showing posts with label ASP.NET Ajax. Show all posts

Saturday, January 21, 2012

Create Custom AutoComplete

Hi *.*,
I already posted ajax autocomplete and jquery autocomplete Its the time to Custom autocomplete :). Advantage of custom is v can have a full control over that and its upto us which and what should display and its awesome to work around that.

CODE

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!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>
    <style type="text/css">
        div
        {
            width: 150px;
            height: auto;
            border: 1px dotted red;
            z-index: 9999px;
            position: absolute;
            background-color: #CCCCFF;
            filter: alpha(opacity=65);
            -moz-opacity: 0.65;
            opacity: 0.65;
        }
        div#img
        {
            z-index: 9999px;
            position: absolute;
            filter: alpha(opacity=99);
            -moz-opacity: 0.99;
            opacity: 0.99;
        }
        tr:hover
        {
            color: red;
            background:white;
            border: 1px dotted red;
            filter: alpha(opacity=99);
            -moz-opacity: 0.99;
            opacity: 0.99;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:TextBox ID="txtDemo" runat="server" onkeyup="txt(this.id);" onfocus="txt(this.id);" onblur="VanishDiv();"   Width="150px"></asp:TextBox><br />
    <div id="DIVname">
    </div><br />
    DEMO by:WWW.SIMPLYASP.BLOGSPOT.COM
    </form>
    <script type="text/javascript" src="Jqueryt.js"></script>
    <script type="text/javascript">
        function VanishDiv() {
            $('#DIVname').empty();
        }
        function ind(d) {
            $('#txtDemo').val(d.innerHTML);
        }
        function txt(value) {
            var condition = $('#' + value).val();
            var data = "Arun,Binu,Deepu,Sam,Nagarjuna,Samphu,Robin";
            var a = data.split(',');
            $('#DIVname').empty();
            var t = "<table width='150px'>";
            var c = a.length;
            for (var i = 0; i < c; i++) {
                var bool = a[i].search(condition);
                if (bool != "-1") {
                    t = t + "<tr><td id=" + a[i] + " onkeyup='ind(" + a[i] + ");' onkeydown='ind(" + a[i] + ");' onmouseover='ind(" + a[i] + ");' onclick='ind(" + a[i] + ");'>" + a[i] + "</td></tr>";
                }
            }
            t = t + "</table>";
            $('#DIVname').append(t);
        }
    </script>
</body>
</html>



If u had any trouble just ask, Happy to help u :)
Stay Tune...
Have a nice day... 'N happy Coding :)

Thursday, January 12, 2012

javascript binding over checkbox , radiobutton and javascript short listing

Hi *,
Again just floating over jquery. Last day we had a GD across me , TL and PM to populate redefine some grids which take a more than 3 sec to load, Unfortunately that task is assigned to me :( ,My pockets are already full.
I remember moo (Manoj sharma, Who interviewed me first in .net, ha ha Can't forgot that moments)when i was 1 yr experience he told me too achieve a functionality searchable grid without postback.I was fully new to JavaScript and not even heard about jquery. My answer was i can't, i got support from another senior that it can achieve only in jsp pages.Now it AGAIN BACK TO ME !!! At this time i can.Thank God.

Thursday, December 1, 2011

youtube instant using Asp.net

Hi*.*,
I'm grad to announce here that.I created a YouTube instant in just 1.48 hr.i'm soooo happy. for  just  a craze started after my friend told the story abt Feross Aboukhadijeh. my friend prajeesh encouraged me to do it.After finish it passed code to my friends @ night !!!! i'm so carzy @ that moment.On morning i got a call from my friend who working on cyber crime told me don't publish the code !!!!. i got surprise y?. using that logic and alternation of code anyone can steel data from any website with out visiting.after his call i gone through wht he said.i tried. yes i'm able to download all the links in a webpage.(didn't gone through capcha page,will try it).
Then y i announce is, i feel i should announce here.but if ur webpage is entirely scripted like gmail.com and facebook.com. my code has limitation.
DEMO



Stay Tune... Have a nice day... 'N happy Coding :)

Saturday, November 19, 2011

Unknown server tag 'asp:xxx'.

Hi *.*,
Its another common error seen after adding Ajax or by adding new web-config file to project.
Its happen when asp can't understand server tag !!!
Solution:
  • Remove Ajax dll from bin folder add Ajax once more ('m not recommending this)
  • Add tagprefix on webconfig.

Saturday, November 5, 2011

One page with multi Default Button

Hi *.*,
As part of my last post.My friend ask me whether its possible to have multi Default Button in one page. Yes it possible.

Monday, October 10, 2011

Conditionally enabling and disabling dropdown using jquery

Hi *.*,
2day i'm showing enable/disable dropdownlist through checkbox selection using Jquery 
Code

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>DEMO BY SIMPLYASP.BLOGSPOT.COM</title>
    <script src="Script/jquery-1.4.1.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#chkbox").click(function () {
                if (this.checked)
                    $('#DrpList').attr('disabled', 'disabled');
                else
                    $('#DrpList').removeAttr('disabled');
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:CheckBox ID="chkbox" runat="server" Text="Enable/Disable" /><br />
        <asp:DropDownList ID="DrpList" runat="server">
            <asp:ListItem Text="Select" Value="-1"></asp:ListItem>
            <asp:ListItem Text="Option1" Value="1" />
            <asp:ListItem Text="Option2" Value="2" />
            <asp:ListItem Text="Option3" Value="3" />
        </asp:DropDownList>
    </div>
    </form>
</body>
</html>





If u had any trouble just ask, Happy to help u :)
Stay Tune... 
Have a nice day... 'N happy Coding :)

Saturday, September 24, 2011

Response.RedirectPermanent in asp.net

It is continuous process to either move web pages or content in Web Application development over the years. Search Engine Optimization and page hit count, getting more traffic for the website is the most important things in day today, moving pages or ceasing pages might not find the new page hits in search engines.

For example: Imagine that you have categories of products in your E-Commerce web application. When the old categories are replaced or updated by new categories, each year a page in your site might be replaced or updated accordingly. If any external sites (or even internal pages) have links to the category of these web pages in your web application, when link is clicked for the next time then it would have thrown error.

You would typically use Reponse.Redirect to suppress the error. But this is a manipulation, not actual work. This will work for the visitor but it internally 302 redirect.

Response.Redirect
In previous versions of ASP.NET we are using Response.Redirect that redirects to HTTP 302 found status response in turn redirects the page URL temporarily to the specified page URL. This is extra overhead to the server, performance hit here.

Problems
1. There is a round trip here.
2. 302 redirect is temporary redirect for the page.
3. No Search Engine Optimization (SEO) benefits due to this approach
4. You are neither informing search engine to updated internal indexes nor pass old page rank to new page.

Solution: Issuing permanent HTTP 301 redirect will solve the purpose, directly available in ASP.NET 4.0

Importance of HTTP Response Code 301:
This happens to move some WebPages or entire website from one domain to another or change the URL of some of the pages inside the website most of the time. This is quite difficult for a webmaster who deletes the pages from the old server, maps them to the new domain. In this case webmaster looses SEO that is related to previous links. In order to prevent SEO loss we need to make use of 301 Redirects.
HTTP Response Code 301 instructs the browser that the particular page has been moved permanently from the old location to the new location. The benefit of using 301 Redirects is that the search engine, crawlers store SEO information related to the old link based on 301 redirects. It also informs the search engines that the page location has permanently moved and it needs to index the page from the new location in future. This is really useful for search engines like Bing or Google that will carry over page rank to the new page if this status code is seen.

Response.RedirectPermanent
It’s the method of Page.HTTPReposne class that permanently redirects a requested URL to specified URL and issue HTTP 301response code Moved permanently responses. It uses the URL given by the location header. Unnecessary round trip for the browser is eliminated using this feature. This is used in migrating websites from old domain to new domain especially. As inbound traffic is important for significant usage of the web application this option is very much useful in live web applications as the requested URL is permanently redirected to some location using this mechanism. Since the redirection is HTTP 301 response status, search engine knows the new link that is redirected and results in the redirect.
Syntax :

Response.RedirectPermanent("/newlocation/oldcontent.aspx");

 Stay Tune...
 Have a nice day... 'N happy Coding :)

Sunday, June 26, 2011

http-request and -responce handling in server side

On previous post Handling httprequest using jquery. Today Handling that on server side.
Code
Invoke 2 namespace 
  • using System.Net; 
  • using System.IO;

Wednesday, June 22, 2011

Asynchronous httpway of Handling Data Jquery

 On my old post I shown using JavaScript asynchronous httpway of handling data. It is fast and reliable but I think depending upon effort it not enough. So I dropped their only, on my Current project my client need a fast way to access data. As he not using a dedicated server, he need that otherwise that project will get fucked up so when he prefer I also agree.

Thursday, June 2, 2011

Ajax MaskedEdit and Validator Sample.

MaskedEdit is an ASP.NET AJAX extender that attaches to a TextBox control to restrict the kind of text that can be entered. MaskedEdit applies a "mask" to the input that permits only certain types of characters/text to be entered. The supported data formats are: Number, Date, Time, and DateTime. MaskedEdit uses the culture settings specified in the CultureName property More>>
Demo



  • MaskType - Type of validation to perform:
    None - No validation
    Number - Number validation
    Date - Date validation
    Time - Time validation
    DateTime - Date and time validation
  • Mask Characters and Delimiters
    9 - Only a numeric character
    L - Only a letter
    $ - Only a letter or a space
    C - Only a custom character (case sensitive)
    A - Only a letter or a custom character
    N - Only a numeric or custom character
    ? - Any character

    / - Date separator
    : - Time separator
    . - Decimal separator
    , - Thousand separator
    \ - Escape character
    { - Initial delimiter for repetition of masks
    } - Final delimiter for repetition of masks

    Examples:
    9999999 - Seven numeric characters
    99\/99 - Four numeric characters separated in the middle by a "/" 
Code: