Cross Post Pages from Code Behind File

C

CSINVA

Trying to figure out how to do a cross post page within the code
behind file. I need to do some calculations before I send a string
value to another pages. Here is an example of the concept I would
like to achieve.

Lets start with 2 pages, page1.aspx has the text boxes and page2 is
where I want to display the informaiton.

Page1.aspx

textBox1.text = "John"

textBox 2.text = "Smith"

In my page1.aspx.vb page I have something like

Dim full as string
full = textBox1.text & " " & textBox2.text

Dim url as string = http://localhost/page2.aspx

Page.Response.Redirect(Url)


On page2.aspx all I want to do is display "full" on the page.

Your Full Name: "full"

I have looked at the page.previous.findcontrol but since this is all
done within the code behind file I don't have a control. I need to
beable to instead of findcontrol findvariable("full"), but don't know
how to accomplish that.
 
I

IfThenElse

If you can use Server.Transfer("page2.aspx"); instead off
response.redirect(.....

Dim full as string
full = textBox1.text & " " & textBox2.text
Context.Items.Add("full", full)

Server.Transfer("page2.aspx")



On page2.aspx.

Dim full as string

full = Context.Items("full").ToString()

Response.Write(full) ' etc...
 
C

CSINVA

If you can use Server.Transfer("page2.aspx"); instead off
response.redirect(.....

Dim full as string
full = textBox1.text & " " & textBox2.text
Context.Items.Add("full", full)

Server.Transfer("page2.aspx")

On page2.aspx.

Dim full as string

full = Context.Items("full").ToString()

Response.Write(full) ' etc...













- Show quoted text -

Need it to be able to use it with browsers other than IE.
 
I

IfThenElse

pass in URL string , Encrypted if you wish
you may pass it in cookie

Are you crossing domains or servers?

Server.Transfer can work for all browsers.
 
C

CSINVA

pass in URL string , Encrypted if you wish
you may pass it in cookie

Are you crossing domains or servers?

Server.Transfer can work for all browsers.







- Show quoted text -

I was reading something else. The only problem is that I need for
page2 to look like it is coming from page2.aspx and not page1.

For instance. chris.mysite.com/page1.aspx send data to page2 -->
(response.redirect) www.mysite.com/page2. with full on the page.

I have to do it this way because I actually have page 2 just doing a
redirect to the "full" item in the example. And the receive site will
only accept connections from a specific site and web page. It's a
pain, but getting closer.
 

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

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top