PDA

View Full Version : Can I Use Asp.net web Service to fetch data?



albertostellpflug
25 Apr 2011, 11:15 PM
Hello

I have to develop mobile web site in asp.net. I already have visual studio solution for asp.net website.

I wanted to reuse Asp.net web service in my mobile project.

Can I use asp.net web service to fetch data if I use sencha touch to develop my mobile website in asp.net??

-Thanks

tryanDLS
26 Apr 2011, 9:57 AM
Short answer. Yes.

There are quite a few threads here regarding .Net and ExtJs. As long as you can make an AJAX request to your webservice, you can process the data with ExtJs, preferably passing JSON, but also XML, if that's what your webservice returns.

albertostellpflug
26 Apr 2011, 8:30 PM
Thanks tryanDLS ,

I am totally newbie to Sencha touch . I don't know how to use sencha touch with asp.net web forms.

Means how can I develop pages using sench touch?

I wanted to develop following type of layout....

-------------------
Home
-------------------

Here content
will come.....

-------------------
About|Contact|....
-------------------

Any idea how to develop it ? Can I use Asp.net controls ?

IF you have any sample code for asp.net with sencha then please send me..

-Thanks

albertostellpflug
27 Apr 2011, 4:42 AM
Hello ,

I got some what idea of how to fetch data from asp.net web service from below link...

http://www.sencha.com/forum/showthread.php?58805-Strange-behaviour-using-Ext.Ajax.request-POST-and-.NET-Webservice&langid=1


But I am getting error while feting data from web service..

Here is my code..

----------------------------------------------------------------
Ext.setup({
onReady: function () {

var url = "http://pc1/DemoWeb/Demo.asmx/HelloWorld";

Ext.Ajax.request({
url:'http://pc1/DemoWeb/Demo.asmx/HelloWorld'
,method:'post'
,jsonData:{'a':'1'}
,headers:{'Content-Type':'application/json;charset=utf-8'}
,success:function(response, options){
alert('success');
}
,failure:function(response, options){
alert('fail');
}
});
}
});
----------------------------------------------------------------

My asmx web service


[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public string HelloWorld(string a)
{
return "Hello World";
}


But when run code fail message is displaying..

When I checked firebug one error was there..

Error: g.getAllResponseHeaders() is null
Source File: http://localhost:6792/SenchaTouchDemo/sencha-touch/sencha-touch.js
Line: 6

Please help..

Thanks..

tryanDLS
27 Apr 2011, 6:19 AM
Is that a cross-domain request? Firefox won't let you do that - you need to have your backend service on the same domain as your page, in this case localhost.

albertostellpflug
27 Apr 2011, 8:38 PM
I have added backend service is same domain as my page..but its still not working,,giving fail message

albertostellpflug
28 Apr 2011, 4:35 AM
Hello I tried a lot but I cannot got it working...

By anyhow I wanted to get it working because without it cannot start further development...

Here is the link of my .net solution ,please check what wrong is there..

http://cid-b638e334cbc0aa40.office.live.com/self.aspx/.Public/SenchaAsp.rar

of if possible can u please send me a working copy of it...or any working example...

erhandemirci
30 Jan 2012, 12:19 PM
hi albertostellpflug (http://www.sencha.com/forum/member.php?265852-albertostellpflug) . I not enter skydrive link . can you sent your file please ? my-email adress:demirci.erhan@windowslive.com

erhandemirci
4 Feb 2012, 1:22 AM
your working your sharring file ? not working or working?