473,388 Members | 1,390 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

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.
Nov 19 '05 #1
4 1311
Hi,
I think you need a tutorial :
http://www.google.com/search?q=xmlht...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.

Nov 19 '05 #2
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

Nov 19 '05 #3

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

Nov 19 '05 #4
i'm using visual studio.NET 2003 to develop this web app

"To********************@pandora.be" 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


Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Juan Carlos CORUÑA | last post by:
Hello all, I have developed an automation server using Mark's win32 extensions and I must return a IStream COM object from one method of the automation server. Here is an extract of my code:...
3
by: RubiconXing | last post by:
Hi All Beginner question - please be patient with me :-) I am new to c#. If one creates a child modal (and also non-modal) form what is the best way of returning the collected data back to the...
1
by: Piotr | last post by:
I have popup window (window.open) where I put any value in input field. After submit I wan to to return to the main window and get value from popup window. How to close popup window and return to...
5
by: Fabio Fracassi | last post by:
Hi, I belive what i am trying to do is not possible, but I hope someone can change my mind. Here is some code i'd like to write: template <class type> class engine1 {}; template <class...
5
by: Neal Coombes | last post by:
Posted to comp.lang.c++.moderated with little response. Hoping for better from the unmoderated groups: -------- Original Message -------- Subject: Return appropriately by value, (smart)...
7
by: hugo27 | last post by:
obrhy8 June 18, 2004 Most compilers define EOF as -1. I'm just putting my toes in the water with a student's model named Miracle C. The ..h documentation of this compiler does state that when...
2
by: JS | last post by:
I'm trying to create a data layer and having problems returning a DataSet from my code that's in a class module. Please forgive me. I'm new to C# (VB'er). I decided to create my data layer in...
22
by: semedao | last post by:
Hi , I am using asyc sockets p2p connection between 2 clients. when I debug step by step the both sides , i'ts work ok. when I run it , in somepoint (same location in the code) when I want to...
8
by: WakeBdr | last post by:
I'm writing a class that will query a database for some data and return the result to the caller. I need to be able to return the result of the query in several different ways: list, xml,...
5
by: TompIfe | last post by:
Hi, I have a web service that reads data from an Access database using datareader and place the data in an array that the web method returns. Now, I want to make the web service also to return an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.