p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 2.0 Basics (http://p2p.wrox.com/forumdisplay.php?f=136)
-   -   Pass value to second page (create & pass var) (http://p2p.wrox.com/showthread.php?t=76090)

ismailc September 8th, 2009 04:23 AM

Pass value to second page (create & pass var)
 
Good day, I need help and Don't know how to do.

I have 2 apsx pages: 1 aspx page calls the 2 aspx page.

But now in the 2 page I have a textbox with a btn to redirect to an url page passing the text box value as parameter for url report.
What I want is to move the the textbox to the 1 page
and pass the value of the 1 page textbox to 2 page url.

[code1:]
Page 1 call page 2
TargetUrl="Page2.aspx"

Page 2
<input type="text" text="Keyword" id="keyword" value="">
<IFRAME id="frame1" src="http://server&KEY = 'keyword'>
[/code:]

Please provide some code or examples.
Regards

Imar September 8th, 2009 05:05 AM

Hi there,

I don't understand what you're trying to accomplish. Can you provide more information and a better description of the situation?

Imar

ismailc September 8th, 2009 05:22 AM

Thanks for assisting.

I would like to have a textbox in Page1.
The Page2 has an iframe with src being a report url with a parameter.

When Page1 triggers Page2 I would like to pass the Page 1 textbox value to the Page 2 url parameter.

Page1 Textbox : <input type="text" text="Keyword" id="keyword" value="">
Page1 Trigger Page2 : TargetUrl="Page2.aspx"

Page 2
URL Parameter KEY
src="&KEY = Page1 textbox (Keyword) value

I think in Page 2 I have to define a variable and the in Page 1 I have to pass the var by:
TargetUrl="Page2.aspx?Var=testvalue"
but i don't know how (code)

Please Assist!

Imar September 8th, 2009 05:26 AM

I still don't get it. What do you mean with "Page1 triggers Page2 "? How do you "trigger" the other page? Through a Response.Redirect? Or a Server.Transfer? Or maybe you're using cross-page postbacks?

You need to provide more, specific info, including relevant code.... "triggering" is a bit too vague....

Cheers,

Imar

ismailc September 8th, 2009 05:39 AM

Apologies, The pages are aspx file extensions with HTML code format

Page1:
<ignav:Item TargetUrl="Page2.aspx" TagString="" HoverClass="mnuMainHover"
TargetFrame="" CssClass="mnuMain" Text="Home" ToolTip="Navigate to Home"> </ignav:Item>

Sorry not trigger but navigates: Page2.aspx

Imar September 8th, 2009 05:45 AM

I hate to be a pain, but this is still not telling me a whole lot. What is ignav:Item? Is it creating client side links? Postbacks buttons? Link Buttons? Can't tell. And "not trigger but navigates" is not too clear either. Navigating can be done in many differnet ways, both client side as server side.

Let's turn it around. Here's a link to an article about passing info from page to page: http://msdn.microsoft.com/en-us/library/6c3yckfw.aspx

That should contain the info you need.

If it's a client side solution, take a look here:

http://www.google.com/search?hl=en&q...t&aq=f&oq=&aqi=

Cheers,

Imar

ismailc September 8th, 2009 05:54 AM

Sorry for wasting your time, i think what i'm looking for is HTML or Javascript

Thank You :)

capacitor143 April 19th, 2010 10:51 AM

calling session variable using javascript and using RESONSE.REDIRECT.
 
Can i calling session variable using javascript and using RESONSE.REDIRECT. in asp.net

csevl April 24th, 2010 07:03 AM

Code:

Default.aspx.cs

string tmp=TextBox1.text;
Response.Redirect("Default2.aspx ?",+tmp);
Default2.aspx.cs

string tmp1=Request.QueryString[0];



All times are GMT -4. The time now is 01:08 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.