return data from c# web app.  
Author Message
lizalou





PostPosted: Sun Aug 07 17:11:21 CDT 2005 Top

ASP.Net >> return data from c# web app. hellow the thing is i have a web page with a javascript code, in this page
i'm using the xmlhttprequest object in order to send values to a C# web
application and it's working fine this way, but now i need to get data from
another web app. but i don't know how to get data from that web app in other
words how is the code in the web app to return a value to a xmlhttprequest
object i tried the return statemen but it doesn't work in that web app.
In the client side i thing i have to use the XmlHttpRequest.responseText to
get the server response but i don't know how to mke this server response.

i hope my explanation is clear enough, any questions please let me know

any suggestions or code sample would be appreciate

thanks in advance.

Web Programming384  
 
 
Tom





PostPosted: Sun Aug 07 17:11:21 CDT 2005 Top

ASP.Net >> return data from c# web app. Hi,


I think you need a tutorial :
http://www.google.com/search?q=xmlhttprequest&sourceid=opera&num=0&ie=utf-8&oe=utf-8

The first hit seems good.

Let me know if you have a more specific question.


Cheers,
Tom Pester

> hellow the thing is i have a web page with a javascript code, in this
> page i'm using the xmlhttprequest object in order to send values to a
> C# web application and it's working fine this way, but now i need to
> get data from another web app. but i don't know how to get data from
> that web app in other words how is the code in the web app to return a
> value to a xmlhttprequest object i tried the return statemen but it
> doesn't work in that web app. In the client side i thing i have to use
> the XmlHttpRequest.responseText to get the server response but i don't
> know how to mke this server response.
>
> i hope my explanation is clear enough, any questions please let me
> know
>
> any suggestions or code sample would be appreciate
>
> thanks in advance.
>


 
 
kstriyhon





PostPosted: Mon Aug 08 10:57:35 CDT 2005 Top

ASP.Net >> return data from c# web app. hellow Tom this is the main idea i have a javascript code and a C# code

this is the javascript code.

var req = new ActiveXObject("Microsoft.XMLHTTP");
req.open('GET', "http://sharepoint:8081/TestWA1/Webform1.aspx", false);
req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
req.responseText();

this is the part of the web app code i'm interested in. because i get the
user name in the creden variable and i need this value to be returned to
javascript code what i don't know is the right sintaxis to do this in the web
app.
i tried return in the method but this method is void so how can i return tne
creden var??


public class WebForm1 : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here

string creden = WindowsIdentity.GetCurrent().Name;

}

any suggestion would be appreciate.

thanks in advance



 
 
kstriyhon





PostPosted: Mon Aug 08 12:31:05 CDT 2005 Top

ASP.Net >> return data from c# web app. i'm using visual studio.NET 2003 to develop this web app

"EMail@HideDomain.com" wrote:

>
> Are you using ASP.NET version 1 or 2. In case you use version 2 I can come
> up with some cleaner code.
>
> Cheers,
> Tom Pester
>
> > hellow Tom this is the main idea i have a javascript code and a C#
> > code
> >
> > this is the javascript code.
> >
> > var req = new ActiveXObject("Microsoft.XMLHTTP");
> > req.open('GET', "http://sharepoint:8081/TestWA1/Webform1.aspx",
> > false);
> > req.setRequestHeader('Content-Type','application/x-www-form-urlencoded
> > ');
> > req.responseText();
> > this is the part of the web app code i'm interested in. because i get
> > the
> > user name in the creden variable and i need this value to be returned
> > to
> > javascript code what i don't know is the right sintaxis to do this in
> > the web
> > app.
> > i tried return in the method but this method is void so how can i
> > return tne
> > creden var??
> > public class WebForm1 : System.Web.UI.Page
> > {
> > private void Page_Load(object sender, System.EventArgs e)
> > {
> > // Put user code to initialize the page here
> > string creden = WindowsIdentity.GetCurrent().Name;
> >
> > }
> >
> > any suggestion would be appreciate.
> >
> > thanks in advance
> >
>
>
>