473,795 Members | 2,839 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Q: move between pages

Hello,
What is the best way to move from aspx page to aspx page by passing
variables. I was using session variables with Response.Redire ctin both ways,
it may not be the right way. Users click a button in the current page and I
need pass a variable to use in the second page and when user click close I
need to jump back to first page. How can I do this? Can you give me exaple
please?
Thanks,
Jim.

Nov 19 '05 #1
7 1272
A QueryString works well:

<a href="Page2?Som eParam=5">Go to page 2</a>

and in Page2.aspx's Page_Load:

string val = Request.QuerySt ring["SomeParam"];

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hello,
What is the best way to move from aspx page to aspx page by passing
variables. I was using session variables with Response.Redire ctin both
ways,
it may not be the right way. Users click a button in the current page
and I
need pass a variable to use in the second page and when user click
close I
need to jump back to first page. How can I do this? Can you give me
exaple
please?
Thanks,
Jim.


Nov 19 '05 #2
What is the best way to move from aspx page to aspx page by passing
variables.


I use query strings. No idea if that's 'best' or not.

-Darrel
Nov 19 '05 #3
Oops, sloppy post -- Juan's gonna be all over me ;)
<a href="Page2?Som eParam=5">Go to page 2</a>


Should have been (note .aspx added):

<a href="Page2.asp x?SomeParam=5"> Go to page 2</a>

-Brock
DevelopMentor
http://staff.develop.com/ballen

Nov 19 '05 #4
Thanks for the reply. all these htlm confuses me. can I handle it code
behind? can you give me a site that has query string example.

"Brock Allen" wrote:
Oops, sloppy post -- Juan's gonna be all over me ;)
<a href="Page2?Som eParam=5">Go to page 2</a>


Should have been (note .aspx added):

<a href="Page2.asp x?SomeParam=5"> Go to page 2</a>

-Brock
DevelopMentor
http://staff.develop.com/ballen

Nov 19 '05 #5
Here's a nice, simple way to pass values from one page to another:
(VB.NET code)

'Add data to the context object before transferring
Context.Items(" myParameter") = x
Server.Transfer ("WebForm2.aspx ")

Then, in WebForm2.aspx:

'Grab data from the context property
Dim x as Integer = CType(Context.I tems("myParamet er"),Integer)

Of course there are a number of ways to pass values from one page to
another, such as using the querystring, cookies, session,
context, saving to a temporary table in the database between each page, etc.
You'll have to decide which technique is best for your application.
Here are several good articles on the subject to help you decide.
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

http://www.aspalliance.com/kenc/passval.aspx

http://www.dotnetbips.com/displayarticle.aspx?id=79

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"JIM.H." <JI**@discussio ns.microsoft.co m> wrote in message
news:30******** *************** ***********@mic rosoft.com...
Hello,
What is the best way to move from aspx page to aspx page by passing
variables. I was using session variables with Response.Redire ctin both
ways,
it may not be the right way. Users click a button in the current page and
I
need pass a variable to use in the second page and when user click close I
need to jump back to first page. How can I do this? Can you give me exaple
please?
Thanks,
Jim.

Nov 19 '05 #6
Hello,
I have;
string strName = this.Context.It ems["name"].ToString();
in page_load in WebForm2.aspx. It works fine when loading, I need to close
this page and return back to first page so I have a close button with
Response.Redire ct("MyPage.aspx ");
When I click I get “Object reference not set to an instance of an object.”
at tle line I mentioned above. What should I do?
Thanks,
Jim.
"Steve C. Orr [MVP, MCSD]" wrote:
Here's a nice, simple way to pass values from one page to another:
(VB.NET code)

'Add data to the context object before transferring
Context.Items(" myParameter") = x
Server.Transfer ("WebForm2.aspx ")

Then, in WebForm2.aspx:

'Grab data from the context property
Dim x as Integer = CType(Context.I tems("myParamet er"),Integer)

Of course there are a number of ways to pass values from one page to
another, such as using the querystring, cookies, session,
context, saving to a temporary table in the database between each page, etc.
You'll have to decide which technique is best for your application.
Here are several good articles on the subject to help you decide.
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

http://www.aspalliance.com/kenc/passval.aspx

http://www.dotnetbips.com/displayarticle.aspx?id=79

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"JIM.H." <JI**@discussio ns.microsoft.co m> wrote in message
news:30******** *************** ***********@mic rosoft.com...
Hello,
What is the best way to move from aspx page to aspx page by passing
variables. I was using session variables with Response.Redire ctin both
ways,
it may not be the right way. Users click a button in the current page and
I
need pass a variable to use in the second page and when user click close I
need to jump back to first page. How can I do this? Can you give me exaple
please?
Thanks,
Jim.


Nov 19 '05 #7
Try ignoring the error or playing with the 2nd (endResponse) parameter as
documented here:
http://msdn.microsoft.com/library/de...recttopic2.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"JIM.H." <JI**@discussio ns.microsoft.co m> wrote in message
news:03******** *************** ***********@mic rosoft.com...
Hello,
I have;
string strName = this.Context.It ems["name"].ToString();
in page_load in WebForm2.aspx. It works fine when loading, I need to close
this page and return back to first page so I have a close button with
Response.Redire ct("MyPage.aspx ");
When I click I get "Object reference not set to an instance of an object."
at tle line I mentioned above. What should I do?
Thanks,
Jim.
"Steve C. Orr [MVP, MCSD]" wrote:
Here's a nice, simple way to pass values from one page to another:
(VB.NET code)

'Add data to the context object before transferring
Context.Items(" myParameter") = x
Server.Transfer ("WebForm2.aspx ")

Then, in WebForm2.aspx:

'Grab data from the context property
Dim x as Integer = CType(Context.I tems("myParamet er"),Integer)

Of course there are a number of ways to pass values from one page to
another, such as using the querystring, cookies, session,
context, saving to a temporary table in the database between each page,
etc.
You'll have to decide which technique is best for your application.
Here are several good articles on the subject to help you decide.
http://msdn.microsoft.com/msdnmag/is...e/default.aspx

http://www.aspalliance.com/kenc/passval.aspx

http://www.dotnetbips.com/displayarticle.aspx?id=79

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"JIM.H." <JI**@discussio ns.microsoft.co m> wrote in message
news:30******** *************** ***********@mic rosoft.com...
> Hello,
> What is the best way to move from aspx page to aspx page by passing
> variables. I was using session variables with Response.Redire ctin both
> ways,
> it may not be the right way. Users click a button in the current page
> and
> I
> need pass a variable to use in the second page and when user click
> close I
> need to jump back to first page. How can I do this? Can you give me
> exaple
> please?
> Thanks,
> Jim.
>


Nov 19 '05 #8

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

Similar topics

17
3890
by: black tractor | last post by:
HI there.. l was just wondering, if l place a "table" in the "editable region" of my template, will the text, graphics placed inside the this "table" MOVE BY ITSELF?? l mean, recently l had a "table" insert in my "editable region", have it placed in the "center" of the page.. while it display correctly on my browser, with setting at 1024x768 (IE6),
2
1274
by: cfmx | last post by:
I'm needing to move a database from SQL 7 to SQL 2000. What is the best way to accomplish this and keep all tables, data, permissions, etc in place throughout the move. Should I use BCP, Replication or something else? Thanks for any help.
1
1457
by: Harald Weiser | last post by:
Good morning everybody. I would like to know if it is possible to move the mousepointer to another location with Javascript? For example Mouse.jumpTo(x,y) THX Harry
5
12234
by: Galina | last post by:
Hello I have an Access 2000 application. The form has got a tab with 3 pages. There are several text boxes and command buttons on one page. I need to move them to another page (to free form space for another control). Is it possible to move controls from one page of a tab to another, or I'll have to re-create them? If it is possible, please could you advise, how? I have tried to move one text box. It happily vanished. Thank you. Galina
4
9531
by: Vincent Yang | last post by:
I'm using Access 2002. My database is in Access 2000 format. I'm designing a form to collect responses to a 40-item questionnaire. I can fit four list boxes on a screen, so I plan to have 11 tab pages (one page at the end for collecting identifying information) on my form. To ease the task for the user, I'd like to have an automatic movement to the next page. For instance, when the user clicks on the choice for Question 4 (the last of...
4
2717
by: David Hearn | last post by:
I am trying to build a few pages basically emulating a wizard that you might find in a Windows product. A few fields to fill out on one page, move to the next, then the next. Finally, at the end, submit the data from all the pages and save it all to a database or send it via email. What is the best way to hold this data so that it there at the end for posting to the database or email? Thanks in advance!
3
1264
by: Wayne Wengert | last post by:
I am rewriting some ASP pages to move them to ASP.NET (VB). The old pages had some include files such as one that had the subroutine to create a connection as well as the code that invoked that sub. My understanding (never tried a user control before so I may well have this screwed up) is that if I create a user control (I use VSNET 2003) I can then put the SUBs in the main section of the code=behind and I am guessing that I put the code...
10
3094
by: Robert | last post by:
I have an app that was originally 1.1, now migrated to 2.0 and have run into some sporadic viewstate errors...usually saying the viewstate is invalid, eventvalidation failed or mac error. My web config does specify a machinekey setting: <machineKey validationKey="447C05E8B3A71401CC4CAE5513A7F1A3494A3618EE819316AAD1D58433F236A759D66FB4154500E01EB4E1BC1DE42046E2D652D391CB8367A1649438867A02EB"...
8
3181
by: Gianni Rondinini | last post by:
hi all, i'm here again. i couldn't find/understand this on w3c css2 recommendation and documentation, then here i ask. i decided to still use some tables in my pages for some forms. i played around with divs and whatever else for some time, but getting things done correctly across multiple browsers requires too much time. with tables, things come pretty easy and, since i'm using these only inside our company, this is 100% ok. i mean:...
0
9673
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
1
10165
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10002
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7543
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5565
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2921
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.