after i  saw the example like :

        [AjaxPro.AjaxMethod]
        public string getList(int tid,int cid)
        {
           GridView gv = new GridView();
           gv.DataSource = (new Article()).ExecuteArticle(tid, cid);
           gv.DataBind();
           return RegString.RenderControlToString(gv);
        }

RenderControlToString is the method that Control.Render(HtmlTextWriter)

the problem is: if the binding control is datalist,i should use
LoadTemplate method to set template for it,

        [AjaxPro.AjaxMethod]
        public string getList(int tid,int cid)
        {
           DataList dl= new DataList();
           dl.ItemTemplate = Page.LoadTemplate(path);//path has defined

           dl.DataSource = (new Article()).ExecuteArticle(tid, cid);
           dl.DataBind();
           return RegString.RenderControlToString(dl);
        }
  as you know,"dl.ItemTemplate = Page.LoadTemplate(path)" can't run
  can i send the Page object from client?
  or any other ways to use datalist and load it's template in a ajax
method?

  thank you very much!!!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Ajax.NET Professional" group.

To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]

For more options, visit this group at http://groups.google.com/group/ajaxpro

The latest downloads of Ajax.NET Professional can be found at 
http://www.ajaxpro.info/

Don't forget to read my blog at http://weblogs.asp.net/mschwarz/
-~----------~----~----~----~------~----~------~--~---

Reply via email to