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

Pages

Showing posts with label Javascript. Show all posts
Showing posts with label Javascript. Show all posts

Wednesday, January 15, 2014

Quick walk over most used JavaScript function

Quick walk over most used JavaScript function

Again a url :). This one helps to make a quick walk over the stuff we done previously.

https://code.google.com/p/jslibs/wiki/JavascriptTips

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

Wednesday, March 13, 2013

Disable Cut copy and Paste on a textbox

 Disable Cut copy and Paste on a textbox
 <asp:TextBox ID="TextBox3" runat="server"
onCopy=”return false” onDrag=”return false” onDrop=”return false” onPaste=”return false” oncut="return false">

</asp:TextBox>

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

Monday, February 18, 2013

Thursday, February 7, 2013

decrypt a string in javascript which encrypted in c#

encrypted in string in c# and decrypt that in JavaScript


Code behind  
protected void Page_Load(object sender, EventArgs e)
    {
        Hdn.Value = "sdsd".EncodeTo64();
    }

Wednesday, February 6, 2013

auto resize jquery ui dialog box



$('#AddStage').dialog({ modal: true, "width": "auto" });


"width""auto"
don't forgot to all necessary js and css files

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

Sunday, January 20, 2013

Enable and Disable Regular field validation using javascript



  Enable and Disable Regular field validation using javascript

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.9.0.min.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="txt01" runat="server"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txt01"
            CssClass="val" EnableClientScript="true" runat="server" ErrorMessage="errro"></asp:RequiredFieldValidator>
        <asp:Button ID="btnEnable" CssClass="enb" runat="server" Text="Enable validation" />
        <asp:Button ID="btnDisable" runat="server" CssClass="Dis" Text="Disable Validation" />

Thursday, January 17, 2013

Extension Method In Javascript

Extension Method In Javascript



<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

Tuesday, January 15, 2013

close the ModalPopup by click on the area surround area of the Pop up Panel

close the ModalPopup by click on the area surround area of the Pop up Panel


<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestHideModalByClickBackground.aspx.cs"
    Inherits="SoluTest_ModalOutsideUDP.TestHideModalByClickBackground" %>


Thursday, January 10, 2013

Shuffle div in jquery


Hi, 

Shuffle div in jquery 

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .span1
        {
            width: 228px;
            background-color: #2D89EF !important;
            height: 63px;
            float: left;
            cursor: pointer;
        }
        .span2
        {
            width: 228px;
            background-color: #00A300 !important;
            height: 63px;
            float: left;
            cursor: pointer;
        }
        .span3
        {
            width: 228px;
            background-color: #FFC40D !important;
            height: 63px;
            float: left;
            cursor: pointer;
        }
        .span3:hover
        {
            cursor: pointer;
        }
        .place-right
        {
            float: right !important;
            margin-left: 10px;
        }
        .fg-color-white
        {
            color: #FFFFFF !important;
        }
    </style>
    <script src="Scripts/jquery-1.8.3.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            shuffle();
        });
        function shuffle() {               // pass the divs to the function
            var e = $('#shuffle div');
            var replace = $('<div>');
            var size = e.size();

            while (size >= 1) {
                var rand = Math.floor(Math.random() * size);
                var temp = e.get(rand);      // grab a random div from our set
                replace.append(temp);        // add the selected div to our new set
                e = e.not(temp); // remove our selected div from the main set
                size--;
            }
            $('#shuffle').html(replace.html());     // update our container div with the
            // new, randomized divs
        }
        setInterval(shuffle, 2000);
  
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div style="width: 550px">
        <div id="shuffle">
            <div id='d1' class="span1">
                <img class="place-right" style="margin: 10px;" src="images/simple.png" />
                <h2 class="fg-color-white">
                    D1</h2>
            </div>
            <div id='d2' class="span2">
                <img class="place-right" style="margin: 10px;" src="images/grid.png" />
                <h2 class="fg-color-white">
                    D2</h2>
            </div>
            <div id='d3' class="span3">
                <img class="place-right" style="margin: 10px;" src="images/responsive.png" />
                <h2 class="fg-color-white">
                    D3</h2>
            </div>
            <div id='Div1' class="span1">
                <img class="place-right" style="margin: 10px;" src="images/simple.png" />
                <h2 class="fg-color-white">
                    D1</h2>
            </div>
            <div id='Div2' class="span2">
                <img class="place-right" style="margin: 10px;" src="images/grid.png" />
                <h2 class="fg-color-white">
                    D2</h2>
            </div>
            <div id='Div3' class="span3">
                <img class="place-right" style="margin: 10px;" src="images/responsive.png" />
                <h2 class="fg-color-white">
                    D3</h2>
            </div>
            <div id='Div4' class="span1">
                <img class="place-right" style="margin: 10px;" src="images/simple.png" />
                <h2 class="fg-color-white">
                    D1</h2>
            </div>
            <div id='Div5' class="span2">
                <img class="place-right" style="margin: 10px;" src="images/grid.png" />
                <h2 class="fg-color-white">
                    D2</h2>
            </div>
            <div id='Div6' class="span3">
                <img class="place-right" style="margin: 10px;" src="images/responsive.png" />
                <h2 class="fg-color-white">
                    D3</h2>
            </div>
        </div>
    </div>
    </div>
    </form>
</body>
</html>


To see the demo check out the menu of this blog

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

Monday, January 7, 2013

Turn off autocomplete for textbox in ASP.Net using jQuery

Turn off auto-complete for text-box in ASP.Net using jQuery

Its all about handling autocomplete attribute,It can be done by javascript or implicit given as false

Friday, January 4, 2013

return false; is NOT working [Resolved]

return false; is NOT working

Its a common error while handling logic operation in JavaScript.
Here i'm listing a few reason 

Here chkduplicate() is my function

Wednesday, January 2, 2013

Print Google Maps

Print Google Maps 


To print google maps you have to use the Google Static Maps API if you want printer friendly maps.

It should be pretty easy to build the Static Maps API URL request string from the LatLng or your markers. One caveat is that the URL is limited to 2048 characters including any character escapes, this will limit how many markers you can have on the map at one time.

In the Javascript API, markers have the class 'gmnoprint', which disables them from showing up on the printed rendering. You can iterate through the markers and remove this class, which should allow them to be printed on the page. As far as I know, this will not work for the direction lines.

Saturday, December 22, 2012

Call Client Side JavaScript function() from Server Side

Call Client Side JavaScript function() from Server Side

You can find million of forums with same question and answers.Last day i cn a post in codeproject by P.Salini. Given a well documented solution for it.

Monday, October 22, 2012

Print a div or grid in javascript

 Hi *.*,
 

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Print Gridview Data in asp.net</title>
<script type="text/javascript">
function PrintGridData() {
var prtGrid = document.getElementById('<%=gvUserInfo.ClientID %>');
prtGrid.border = 0;
var prtwin = window.open('', 'PrintGridViewData', 'left=100,top=100,width=1000,height=1000,tollbar=0,scrollbars=1,status=0,resizable=1');
prtwin.document.write(prtGrid.outerHTML);
prtwin.document.close();
prtwin.focus();
prtwin.print();
prtwin.close();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<b>Print Gridview Data</b><br /><br />
<asp:GridView ID="gvUserInfo" runat="server" >
<HeaderStyle BackColor="#df5015" Font-Bold="true" ForeColor="White"/>
</asp:GridView>
<input type="button" id="btnPrint" value="Print" onclick="PrintGridData()" />
</div>
</form>
</body>
</html>




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