www.webdeveloper.com
Results 1 to 4 of 4

Thread: Refreshing a Text control

  1. #1
    Join Date
    Mar 2006
    Posts
    2

    Refreshing a Text control

    How to refresh a text control (or datagrid control) with a new data every two minutes without refreshing the page

  2. #2
    Join Date
    Feb 2006
    Posts
    9
    Hi,

    Use XMLHttpRequest Object and achieve it in asyncrhronous way.Yes nothing but AJAX.

    thanks
    prasanth

  3. #3
    Join Date
    Mar 2006
    Posts
    2
    How would I use XMLHttpRequest!!, I need to use it in the HTML part of ASP.NET web page using JavaScript, could you show me the codes

  4. #4
    Join Date
    Feb 2006
    Posts
    9
    Hi,

    Hope this code helps.If not search in google for AJAX + ASP.NET examples.

    <HEAD>

    <style type="text/css">
    <!--
    #contentLYR {
    position:absolute;
    width:200px;
    height:115px;
    z-index:1;
    left: 200px;
    top: 200px;
    }
    -->
    </style>

    <script type="text/javascript">
    <!-- Begin


    function ajaxLoader(url,id) {
    if (document.getElementById) {
    var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
    }
    if (x) {
    x.onreadystatechange = function() {
    if (x.readyState == 4 && x.status == 200) {
    el = document.getElementById(id);
    el.innerHTML = x.responseText;
    }
    }
    x.open("GET", url, true);
    x.send(null);
    }
    }
    //-->
    </script>
    </HEAD>



    <BODY onload="ajaxLoader('demo.xml','contentLYR')">



    <div id="contentLYR">
    </div>

    Thanks
    Prasanth J.V.R.S

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles