Need help refreshing a datagrid client side

Discussion in 'ASP .Net' started by msnews, Aug 10, 2005.

  1. msnews

    msnews Guest

    Hi --

    I'm very, very new to ASP.Net, and I've been trying for several days to
    figure out how to update a datagrid AND refresh it on the client side so
    that the page doesn't refresh. I've torn my code apart over and over each
    time I tried what I thought would be the code that would solve my problem.

    Maybe I'm going down the completely wrong path here. Essentially,
    here is an explanation of my ASP.NET webform application and what I
    want it to do:

    Employees add how much time they spend on a job, and then that
    information is added to a SQL database and displayed in a datagrid.
    I've got everything working on the client side (we are using an AJAX
    approach), except the refreshing
    of the datagrid.

    When the page loads and/or when a new record is added, I want the
    datagrid to update (without the page refreshing). The information
    that is returned is in XML format, and I somehow have to get it into
    the datagrid.

    Here's one record of the XML that is returned into variable
    oResult.value:

    "<ROOT><NewDataSet>
    <ActivityHistory>
    <ActivityID>312</ActivityID>
    <CustomerName>Test</CustomerName>
    <Description>312-Development</Description>
    <ActivityDate>2005-08-10T00:00:00.0000000-05:00</ActivityDate>
    <ReferenceCode>J-1007</ReferenceCode>
    <Minutes>15.00</Minutes>
    </ActivityHistory>
    </NewDataSet></ROOT>"

    But for a given period of time, there will be several of these
    ActivityHistory records.

    Below is the function I have so far (sorry about the wrapping), but as I
    said, I could be going
    down a completely wrong path. I would greatly appreciate if any of
    you have corrections for my code or if you have ideas/suggestions for
    a different/better way to do this (since my way doesn't work,
    anything would be better). Yes, I'm a newbie, and I'm just
    not "getting" this at all. I have no idea what to do now that
    nothing has worked thus far.



    function LoadTable()
    {

    var Employee = document.getElementById
    ("_ctl1__ctl0_ddlEmployee").value;
    var StartDate = document.getElementById
    ("_ctl1__ctl0_TextStartDate").value;
    var EndDate = document.getElementById
    ("_ctl1__ctl0_TextEndDate").value;

    // Update the xml island with the employee history
    information
    var oResult = Methods.EmployeeActivity(Employee,
    StartDate, EndDate);

    var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
    xmlDoc.async=false;
    xmlDoc.load("activityhistory.xml");

    var loaded = xmlDoc.loadXML(oResult.value);
    if (loaded) {
    var xslDoc=new ActiveXObject
    ("Microsoft.XMLDOM");
    xslDoc.async=false;
    xslDoc.load("ActivityHistoryStyle.xsl");
    document.getElementById
    ("Table1Inner").innerHTML = xmlDoc.transformNode(xslDoc);
    }
    }

    Thanks!
    msnews, Aug 10, 2005
    #1
    1. Advertising

  2. msnews

    Lucas Tam Guest

    "msnews" <> wrote in news:#:

    > I'm very, very new to ASP.Net, and I've been trying for several days to
    > figure out how to update a datagrid AND refresh it on the client side so
    > that the page doesn't refresh.


    Are you using .NET 2.0? Only .NET 2.0 supports Client Side Callbacks
    (refreshing data on the client side).

    If you're using ASP.NET 1.1 or need cross browser compatibility, take a
    look at Dart's LiveControls. Or for a generic implementation, AshleyIt's
    Javascript Remoting, or for a (free) .NET version Thycotic's .NET
    Javascript Remoting.

    --
    Lucas Tam ()
    Please delete "REMOVE" from the e-mail address when replying.
    http://members.ebay.com/aboutme/coolspot18/
    Lucas Tam, Aug 10, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Harlan Messinger

    Self-refreshing and non-self-refreshing controls

    Harlan Messinger, Aug 4, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    440
    =?Utf-8?B?Y2xpY2tvbg==?=
    Aug 4, 2006
  2. Boss302
    Replies:
    0
    Views:
    1,006
    Boss302
    Nov 21, 2006
  3. Bogdan
    Replies:
    2
    Views:
    630
    Bogdan
    Jun 9, 2008
  4. msnews

    Need help refreshing a datagrid client side

    msnews, Aug 10, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    126
    clintonG
    Aug 11, 2005
  5. Harlan Messinger

    Self-refreshing and non-self-refreshing controls

    Harlan Messinger, Aug 3, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    175
    Harlan Messinger
    Aug 3, 2006
Loading...

Share This Page