views:

85

answers:

0

in my .aspx page i call wcf service and the result is get into callback function in .aspx(same) page

i want that 'callbackfunction' to assign variables to result.name, result.title etc.

here is my callback function

    function callBack(result) {      

            var i = 0;
            var j = i;            
            var t = new Sys.Preview.UI.Template.getTemplate($get("divdata"));

            while (result.ContentResult[i]) 
            {

                var publishDateTime = convertJSONDateTimeToNormal(result.ContentResult[i].PublishDate.DateTime);              

                var title =    result.ContentResult[i].Title;
                var author = result.ContentResult[i].Author;                    

                var date= publishDateTime.format("dd | MM | yyyy ");
                var Blurb= result.ContentResult[i].Blurb;

                t.createInstance($get("RecentDiv"),
                {
                title: title,
                author: author,
                date: date,
                blurb: Blurb
                });
                if (i == j) { document.getElementById('RecentstoryDiv').innerHTML += "<hr/>"; }                   
               i++; 
            }  


}

and this is the 'div' in which i render result (theses divs 'divdata' & 'RecentDiv' is in the same .aspx page)

 <div id="RecentDiv">
</div>

<div  id="divdata" style="display:none">
    <p style="float:right;border-style:dotted; padding-bottom:5px; width:100%" >Title:{{title}}
        </p>        
    <p>Story Date: {{ date }}
    </p>
    <p style="padding-bottom:10px">Key(Blurb) :{{blurb}}</p>         
      </div>

Now I want the divdata out of .aspx page which will be in .htm page and my callback function will render the .htm page at runtime

how can it be done please Help