Showing posts with label back. Show all posts
Showing posts with label back. Show all posts

Monday, March 26, 2012

Will Atlas Work With Opera 8.60 for Pocket PC?

myAtlas Update Panels are working fine when i access the page from a standard desktop Opera browser. However the page is posting back when i do the same thing from within the PDA. the PDA is running the latest 'Opera 8.60 for Pocket PC' browser.

can i somehow configure the Atlas or the page so that it will work on the PDA browser? or am i on a hiding to nothing?

thanks

I don't speak for the ASP.Net team; however at this time there is no real 'support' for mobile devices (so yours being opera is not a slant). Currently there is some Opera desktop browser support and they are looking at expanding it. As with all new tools we get to play with - mileage will end up varying - however if you are familiar with Java Script... there may be a means for you to roll your own if its a mission critical scenario... However, personally - I don't think right now the focus is in provding mobilie support as it is more inline to polishing desktop browser experiences... NOt to sy it won't won't happen.. but usually mobile applications don't rely on the jazzability that memory / cpu intensive desktop browsers can utlize...

Saturday, March 24, 2012

working with Asynchoronous Call back Events

Hiiii,

I want to Implement some Asnynchoronous call back events along with some regular postback event.Please Help me..

Regards,

Harsha

Hi

Search more about synchonus and asynchronus postback triggers


http://ajax.asp.net/docs/overview/AsynchronousLayerOverview.aspx

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.

xmlHttp with responseXML

I'm trying to write a script page that uses the xmlHTTP to an aspx page that then sends back some XML which I can then use the javascript to read and populate a dropdown list.

I seem to be running into the problem of the returned XML (or lack there of) If I do a responseText, all is well cept the response is not formatted as XML just a large string.

Here is the Javascript

1<script type="text/javascript">2 /* Create a new XMLHttpRequest object to talk to the Web server */3 var xmlHttp = false;45 function CreateXmlHttp()6 {7 /*@dotnet.itags.org.cc_on @dotnet.itags.org.*/8 /*@dotnet.itags.org.if (@dotnet.itags.org._jscript_version >= 5)910 try11 {12 xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");13 } catch (e)14 {15 try16 {17 xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");18 }19 catch (e2)20 {21 xmlHttp = false;22 }23 }24 @dotnet.itags.org.end @dotnet.itags.org.*/2526 if (!xmlHttp && typeof XMLHttpRequest != 'undefined')27 {28 xmlHttp = new XMLHttpRequest();29 }30 }313233 function callServ()34 {3536 var site;37 var siteddl = document.getElementById('ddlSites');38 for (var i = 0; i < siteddl.options.length; i++)39 {40 if (siteddl.options[i].selected)41 {42 site = siteddl.options[i].value;43 //document.write(site);44 }45 }46 if (site == '-1')47 {48 return;49 }50 else51 {5253 CreateXmlHttp();5455 var url="popddls.aspx?w=1&id=" + escape(site);565758 xmlHttp.open("GET", url, true);5960 xmlHttp.setRequestHeader("Content-Type", "text/xml");6162 xmlHttp.onreadystatechange = updatePage;6364 xmlHttp.send(null);65 }6667 }6869 function updatePage()70 {71 if(xmlHttp.readyState ==4)72 {73 var response1 = xmlHttp.responseXML;7475 var ddlGrades = document.getElementById('ddlGrades');7677 var grades = response1.getElementsByTagName("grade");78 //ddlGrades.options.length = 0;79 for (var x=0; x < grades.length; x++)80 {81 var id = grades[x].childNodes[0].value;82 var gradedate = grades[x].childNodes[1].value;83 document.write(id + " " + gradedate);84 var newOption = new option();85 newOption.text = gradedate;86 newOption.valueOf = id;87 ddlGrades.options[ddlGrades.length] = newOption;88 }8990 }91 }929394 </script>

Here is the code for popddl which if I run it, it does write the correct XML

1Sub load_gradesddl()2Dim idAs Integer = Request.QueryString("id")3Dim sqlAs String ="select id,gradedate from grades where siteid=" & id4Dim dsAs System.Data.DataSet = DataFunc.FillDS(sql,"gcioq")56 Response.Write("<?xml version=""1.0"" encoding=""utf-8"" ?>")7 Response.Write("<grades>")8For IAs Integer = 0To ds.Tables(0).Rows.Count - 1910 Response.Write("<grade>")11 Response.Write("<id>" & ds.Tables(0).Rows(I).Item("id") &"</id>")12 Response.Write("<gradedate>" & ds.Tables(0).Rows(I).Item("gradedate") &"</gradedate>")13 Response.Write("</grade>")14Next15 Response.Write("</grades>")16End Sub

the error I get in firefox is response1 has no properties. in IE7 I do not get an error but it doesn't work.

What am I doing wrong here?

EDIT:

I also noticed if I do a document.write(grades.length) I get a Zero back though I know the popddl is generating correct XML.

Ok, I got it to work but only in IE7, in firefox it get the right amound of nodes but everything comes out as undefined.

using this to get the data

var id = grades[x].childNodes[0].firstChild.text;

var gradedate = grades[x].childNodes[1].firstChild.text;

Also, this is the XML output

<?xml version="1.0" encoding="utf-8"?>

-<grades>

-<grade>

<id>11</id>

<gradedate>11/27/2007</gradedate>

</grade>

- <grade>

<id>18</id>

<gradedate>11/27/2006</gradedate>

</grade>

-<grade>

<id>19</id>

<gradedate>11/28/2007</gradedate>

</grade>

-<grade>

<id>20</id>

<gradedate>11/29/2007</gradedate>

</grade>

-<grade>

<id>21</id>

<gradedate>11/30/2007</gradedate>

</grade>

</grades>


Ok, I got it to work but only in IE7, in firefox it get the right amound of nodes but everything comes out as undefined.

using this to get the data

var id = grades[x].childNodes[0].firstChild.text;

var gradedate = grades[x].childNodes[1].firstChild.text;

Also, this is the XML output

<?xml version="1.0" encoding="utf-8"?>

-<grades>

-<grade>

<id>11</id>

<gradedate>11/27/2007</gradedate>

</grade>

- <grade>

<id>18</id>

<gradedate>11/27/2006</gradedate>

</grade>

-<grade>

<id>19</id>

<gradedate>11/28/2007</gradedate>

</grade>

-<grade>

<id>20</id>

<gradedate>11/29/2007</gradedate>

</grade>

-<grade>

<id>21</id>

<gradedate>11/30/2007</gradedate>

</grade>

</grades>


Hi,

Thank you or your post!

I suggest you try this for firefox:

var id = grades[x].childNodes[0].firstChild.nodeValue;

var gradedate = grades[x].childNodes[1].firstChild.nodeValue;

If you have further questions,let me know.

Best Regards,