Showing posts with label provided. Show all posts
Showing posts with label provided. Show all posts

Wednesday, March 21, 2012

writing json back to client

I am making an xmlhttp request (using the scripts provided inAjax for Web Application Developersby Kris Hadlock) to get data from an aspx page. When I create a dataset and return xml with an xmldocument it works fine. I am using the following where dsreturn is the getXML of the dataset.

Dim xdocAs XmlDocument =New XmlDocument()

xdoc.LoadXml(dsreturn)

xdoc.Save(Response.OutputStream)

The problem is that I also want to return json. I have created a biz class to parse a dataset and return a json string. I know this works because I have used it in other web services. When I do this I get nothing. I think that my problem is how to return the json string in the response.outputstream. I am not sure how to do this. Just using response.write doesnt seem to work.

Thanx

Have you considered using page methods instead of doing it all by hand? They return JSON by default.

XML webcontrol conflicts with Atlas?

hi,
I am trying to use XML control to display the xml by xsl.
Also, I would like to have the feature of no-refreshing provided by Atlas.

The followind is the simple code in my web page:

<atlas:ScriptManager ID="S1" EnablePartialRendering="true"runat="server" ><asp:button id="btn_Submit" runat="server" /><atlas:UpdatePanel ID="up1" runat="server"> <ContentTemplate> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> </ContentTemplate> <Triggers> <atlas:ControlEventTrigger ControlID="btn_Submit" EventName="Click" /> </Triggers></atlas:UpdatePanel><asp:Xml ID="Xml1" runat="server" DocumentSource="myXML.xml" TransformSource="XMLTemplate.xsl"></asp:Xml><atlas:UpdateProgress ID="p1" runat="server"> <ProgressTemplate> <div class="progress"> <img src="images/ajax-loader.gif" />Data Loading... </div> </ProgressTemplate></atlas:UpdateProgress>

When I set the attribute of EnablePartialRendering to be false,
it would successfully display my xml data .

Is there anything I miss when using Xml webcontrol?
Or there is some other ways to fulfill my requirement?
Wish to hear some advices...Yes,there is a conflict with atlas client controls and asp.net controls.I suggest you to download the latest Atlas and try it again.Maybe it has solved the problem.
Oops...

My version was already the latest version , July CTP.

It seems that it hasn't solvd this problem yet.

So is there another way to display XML data by XSL template in the web page?

As i understand all unusual client blocks doesn't work with atlas?
When i added <IE:TEMPLATEPRINTER ID="printer"/> tag to the master page all Partial Rendering contents ceased to work.
I'm using latest version of Atlas


ok..my problem sloved.
I put XML webcontrol into another UpdatePanel of Atlas component.
It works fine now.
But I don't know why...