return data from c# web app.

G

Guest

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.
 
G

Guest

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
 
T

Tom.PesterDELETETHISSS

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,076
Latest member
OrderKetoBeez

Latest Threads

Top