470,815 Members | 1,333 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,815 developers. It's quick & easy.

How to send a big amount of data from an aspx page to another

Hi,
I have webpage (sql.aspx) in asp.net with a big textbox. In this
box, I generate SQL queries. Some of the queries can takes more than
2000 characters lenght. I want to send the content of the textbox (the
query) in another webpage(result.aspx) textbox. I just don't know how.
Can I use postmethod send ? can I use a public textbox object ? and
how ?

thank you,
Simon
Nov 17 '05 #1
3 2714
If the page has same session scope(in the same virtual directory) use
session...
"Simon" <mu**********@hotmail.com> wrote in message
news:79*************************@posting.google.co m...
Hi,
I have webpage (sql.aspx) in asp.net with a big textbox. In this
box, I generate SQL queries. Some of the queries can takes more than
2000 characters lenght. I want to send the content of the textbox (the
query) in another webpage(result.aspx) textbox. I just don't know how.
Can I use postmethod send ? can I use a public textbox object ? and
how ?

thank you,
Simon

Nov 17 '05 #2
Session, Cache, Database, etc.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Simon" <mu**********@hotmail.com> wrote in message
news:79*************************@posting.google.co m...
Hi,
I have webpage (sql.aspx) in asp.net with a big textbox. In this
box, I generate SQL queries. Some of the queries can takes more than
2000 characters lenght. I want to send the content of the textbox (the
query) in another webpage(result.aspx) textbox. I just don't know how.
Can I use postmethod send ? can I use a public textbox object ? and
how ?

thank you,
Simon

Nov 17 '05 #3
You could use something like the following to Post that data to your
receiver page and then use the posted data 'Request.form.tosting()' to
process it from the receiver page. Something like the following (not tested)
Carefull for screen wrapping.

<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.IO" %>

<html>
<script language="vb" runat="server">

Sub button_click(sender as object, e as EventArgs)

Dim mgWebRequest As HttpWebRequest
Dim stringPost, stringResult As String
Dim mgStreamWriter As StreamWriter
Dim mgWebResponse As HttpWebResponse
Dim mgStreamReader As StreamReader

mgWebRequest
=CType(WebRequest.Create("http://your.website.com/yourreceive.aspx"),HttpWeb
Request)

mgWebRequest.Method = "POST"
stringPost = senddata.text
mgWebRequest.ContentLength = stringPost.length 'length
mgWebRequest.ContentType = "application/x-www-form-urlencoded"
mgStreamWriter = Nothing
mgStreamWriter = New StreamWriter(mgWebRequest.GetRequestStream())
mgStreamWriter.Write(stringPost)
mgStreamWriter.Close()
mgWebResponse = CType(mgWebRequest.GetResponse(),HttpWebResponse)
mgStreamReader = New StreamReader(mgWebResponse.GetResponseStream())
stringResult = mgStreamReader.ReadToEnd()
response.write(stringResult)
mgStreamReader.Close()
end sub
</script>
<body>
<form runat=server>
<asp:textbox id=senddata text="text that your want to send" width=500
textmode=multiline rows=26 wrap=true runat=server/>
<asp:button id=send text=send onclick=button_click runat=server/>
</form>
</body>
</html>
"Simon" <mu**********@hotmail.com> wrote in message
news:79*************************@posting.google.co m...
Hi,
I have webpage (sql.aspx) in asp.net with a big textbox. In this
box, I generate SQL queries. Some of the queries can takes more than
2000 characters lenght. I want to send the content of the textbox (the
query) in another webpage(result.aspx) textbox. I just don't know how.
Can I use postmethod send ? can I use a public textbox object ? and
how ?

thank you,
Simon

Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by HANG LAM | last post: by
4 posts views Thread by ad | last post: by
1 post views Thread by khawar | last post: by
2 posts views Thread by bhav | last post: by
9 posts views Thread by eswanson | last post: by
6 posts views Thread by Daniel Walzenbach | last post: by
4 posts views Thread by =?Utf-8?B?dHBhcmtzNjk=?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.