10-10-2007, 08:14 PM | #1 | ||
Pro Starter
Join Date: Oct 2000
Location: Cary, NC
|
ASP.NET 2.0 Question: Passing Data to Another Page
What I'd like to do:
Have a page with a list of, say, 32 teams. You click a team, and another page opens with data on that team. My understanding is I can do a link that looks something like: hxxp://www.myleaguesite.net/TeamInfoPage.aspx?teamid=7 Correct? But how do I pull that teamid out on TeamInfoPage.aspx so I can look up and display that team? Yes, I'm a complete noob at web stuff, please bear with me. I've got lots of stuff figured out, but my handful of attempts at this one piece have ended in miserable failure. I'm also willing to go with other options if they'll work better for ASP.NET 2.0.
__________________
-- Greg -- Author of various FOF utilities |
||
10-10-2007, 08:29 PM | #2 |
General Manager
Join Date: Oct 2000
Location: The Satellite of Love
|
It's been a very long time since I messed around with ASP, but I think I used VBScript to get the value of variables from the HTTP. I don't think there's anything in ASP itself that will pull the value.
But this was about 6-7 years ago, so I may be very wrong on that. |
10-10-2007, 08:52 PM | #3 |
Pro Starter
Join Date: Nov 2004
Location: Parañaque, Philippines
|
Use Context.Item
There are several tutorials on the web. You can pass the contents into another webpage after doing a server transfer. The containing data will only exist for that one state, and will expire after that state passes.
__________________
Come and see. |
10-10-2007, 08:53 PM | #4 |
Pro Starter
Join Date: Nov 2004
Location: Parañaque, Philippines
|
Or, if you're working with a VB.Net backbone behind the ASP.Net, you can just create a masterpage, and have everything work inside, so you can encapsulate data and just keep passing variables back and forth via the VB.Net framework.
__________________
Come and see. |
10-10-2007, 09:17 PM | #5 |
Pro Starter
Join Date: Oct 2005
Location: Washington, DC
|
If you're still using nhibernate there's a way to quickly do it (you just query the db again with the id specified), I can look it up tomorrow, as I'm about to head to bed and don't remember it off the top of my head.
__________________
Sixteen Colors ANSI/ASCII Art Archive "...the better half of the Moores..." -cthomer5000 |
10-10-2007, 09:21 PM | #6 |
Pro Starter
Join Date: Oct 2005
Location: Washington, DC
|
dola:
maybe: Customer customer = (Customer) session.Load(typeof(Customer), "ALFKI");
__________________
Sixteen Colors ANSI/ASCII Art Archive "...the better half of the Moores..." -cthomer5000 |
10-10-2007, 10:06 PM | #7 |
Head Coach
Join Date: Dec 2002
Location: Maryland
|
Request.QueryString("teamid") ? Or does that only work in regular asp?
(also, Request("teamid") works generically for both Request.QueryString and Request.Form - I think)
__________________
null Last edited by cuervo72 : 10-10-2007 at 10:07 PM. |
10-10-2007, 10:09 PM | #8 |
Head Coach
Join Date: Dec 2002
Location: Maryland
|
Dola - you could always use php....
(I could hook you up with some things)
__________________
null |
10-10-2007, 11:09 PM | #9 | |
Pro Starter
Join Date: Nov 2002
Location: Winnipeg, MB
|
Quote:
Request.QueryString is the easiest way to do it if the data is being passed in via the URL as gstelmack suggests.
__________________
"Breakfast? Breakfast schmekfast, look at the score for God's sake. It's only the second period and I'm winning 12-2. Breakfasts come and go, Rene, but Hartford, the Whale, they only beat Vancouver maybe once or twice in a lifetime." |
|
10-11-2007, 05:55 AM | #10 |
Pro Starter
Join Date: Oct 2005
Location: Washington, DC
|
ohhhhhh.. you just want to get the actual id in the querystring??
Request.QueryString["TeamId"] or Request.Parameter["TeamId"] should work fine. You'll also want to cast it.. Convert.ToInt32(Request.QueryString["TeamId"]);
__________________
Sixteen Colors ANSI/ASCII Art Archive "...the better half of the Moores..." -cthomer5000 |
10-11-2007, 08:24 AM | #11 |
Pro Starter
Join Date: Oct 2000
Location: Cary, NC
|
Thanks, I think Request.QueryString is exactly what I'm looking for.
I'm not using PHP because I know C# well enough that I'm actually able to get some stuff done (and I love the language). Plus I'm having fun learning ASP.NET 2.0. I've been able to do some pretty cool stuff using C# (I'm pretty proud of the auto-league-calendar generator I've got for WOOF...)
__________________
-- Greg -- Author of various FOF utilities |
10-11-2007, 09:02 AM | #12 |
Pro Starter
Join Date: Nov 2002
Location: Winnipeg, MB
|
C# is a pretty cool language, I moved to it from VB.NET about 6 months ago and I've never looked back.
That said, I'm getting really tempted to dive into the Ruby on Rails stuff.
__________________
"Breakfast? Breakfast schmekfast, look at the score for God's sake. It's only the second period and I'm winning 12-2. Breakfasts come and go, Rene, but Hartford, the Whale, they only beat Vancouver maybe once or twice in a lifetime." |
10-11-2007, 10:10 AM | #13 | |
Pro Starter
Join Date: Oct 2005
Location: Washington, DC
|
Quote:
I am a C# (ASP.NET) developer by profession. I spent about 6 months doing Rails on the side and loved it. Ultimately I decided to put it to bed because it wasn't advancing my knowledge for my career like developing in C# on the side would be. But rails is fantastic.
__________________
Sixteen Colors ANSI/ASCII Art Archive "...the better half of the Moores..." -cthomer5000 |
|
10-11-2007, 10:15 AM | #14 |
Pro Starter
Join Date: Nov 2002
Location: Winnipeg, MB
|
I'm a .NET dev by profession too, and it is those same doubts about "wasting my time" that have kept me away from Rails. That said, with MVP's like Scott Bellware making the switch, it really has me thinking.
Locally a group of guys has started a Rails User Group. Their second meeting is next month so I think I will do a little studying beforehand and then attend. Part of me thinks it might be tempting to switch gears career-wise if the right alternative popped up...
__________________
"Breakfast? Breakfast schmekfast, look at the score for God's sake. It's only the second period and I'm winning 12-2. Breakfasts come and go, Rene, but Hartford, the Whale, they only beat Vancouver maybe once or twice in a lifetime." |
10-11-2007, 10:35 AM | #15 | |
Pro Starter
Join Date: Oct 2005
Location: Washington, DC
|
Quote:
If you'll consider switching gears completely, it's definitely worth trying out. I am too happy with my job to switch over to Rails, but if I wasn't I would love to find a job doing Rails.
__________________
Sixteen Colors ANSI/ASCII Art Archive "...the better half of the Moores..." -cthomer5000 |
|
10-11-2007, 10:37 AM | #16 | |
Head Coach
Join Date: Mar 2003
Location: Hometown of Canada
|
Quote:
I go to the .NET User Group! They mentioned this about Ruby on Rails. I don't do web dev, so I've never used it. http://www.railsmanitoba.com/ |
|
10-11-2007, 10:53 AM | #17 | |
Pro Starter
Join Date: Nov 2002
Location: Winnipeg, MB
|
Quote:
Heh, cool, I bet we were in the same room on tuesday listening to John Bristowe
__________________
"Breakfast? Breakfast schmekfast, look at the score for God's sake. It's only the second period and I'm winning 12-2. Breakfasts come and go, Rene, but Hartford, the Whale, they only beat Vancouver maybe once or twice in a lifetime." |
|
10-11-2007, 10:56 AM | #18 |
Head Coach
Join Date: Mar 2003
Location: Hometown of Canada
|
|
10-11-2007, 11:01 AM | #19 |
College Benchwarmer
Join Date: Oct 2000
Location: North Carolina
|
Are there really there really a lot of enterprise apps using Rails? I don't really know anything about it, but I had the impression that it was more of a "Web 2.0" fad.
__________________
"I'm losing my edge--to better looking people... with better ideas... and more talent. And who are actually really, really nice." "Everyone's a voyeurist--they're watching me watch them watch me right now." |
10-11-2007, 11:02 AM | #20 |
Pro Starter
Join Date: Nov 2002
Location: Winnipeg, MB
|
You didn't happen to go out for drinks at Bailey's after did you?...
__________________
"Breakfast? Breakfast schmekfast, look at the score for God's sake. It's only the second period and I'm winning 12-2. Breakfasts come and go, Rene, but Hartford, the Whale, they only beat Vancouver maybe once or twice in a lifetime." Last edited by Fidatelo : 10-11-2007 at 11:03 AM. |
10-11-2007, 11:18 AM | #21 | |
Pro Starter
Join Date: Oct 2000
Location: Cary, NC
|
Quote:
My experiences with Rails are colored by the host that WOOF was on...
__________________
-- Greg -- Author of various FOF utilities |
|
10-11-2007, 11:37 AM | #22 |
Head Coach
Join Date: Mar 2003
Location: Hometown of Canada
|
|
10-11-2007, 12:37 PM | #23 | ||
Pro Starter
Join Date: Oct 2005
Location: Washington, DC
|
Quote:
There are definitely some mid-level ones, and probably some sites you use, but I don't know about enterprise. Quote:
Yeah.. dreamhost has a lot of haters for different reasons, probably mostly justified.
__________________
Sixteen Colors ANSI/ASCII Art Archive "...the better half of the Moores..." -cthomer5000 |
||
10-11-2007, 01:52 PM | #24 | |
Pro Starter
Join Date: Nov 2002
Location: Winnipeg, MB
|
Quote:
Heh, cool. You know, I'm gonna end up profiling the whole crowd at the next one now :P
__________________
"Breakfast? Breakfast schmekfast, look at the score for God's sake. It's only the second period and I'm winning 12-2. Breakfasts come and go, Rene, but Hartford, the Whale, they only beat Vancouver maybe once or twice in a lifetime." |
|
10-11-2007, 02:01 PM | #25 |
Head Coach
Join Date: Mar 2003
Location: Hometown of Canada
|
|
10-11-2007, 02:27 PM | #26 |
Pro Starter
Join Date: Nov 2002
Location: Winnipeg, MB
|
Well that will be easy then, I'll just look for the guy crouched behind a chair...
__________________
"Breakfast? Breakfast schmekfast, look at the score for God's sake. It's only the second period and I'm winning 12-2. Breakfasts come and go, Rene, but Hartford, the Whale, they only beat Vancouver maybe once or twice in a lifetime." |
10-11-2007, 02:28 PM | #27 |
Head Coach
Join Date: Mar 2003
Location: Hometown of Canada
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
|
|