View Single Post
  #6 (permalink)  
Old August 25th, 2008, 02:19 PM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Not really. All I really see is this:

imgStatus(i).OnClientClick = "javascript:window.open('Review.aspx');"

Basically this says: let each button, regardless of its location, open the page Review.aspx (I assume that's the "page 2" you're talking about.

I don't see any code that tries to determine what button was clicked. That is, I don't see a Click handler, I don't see you recreate controls on post back, I don't see you use CommandName and CommandArgument properties and so on, so all I can assume is that you want to open Review.aspx with the ID if the button. In that case, this should work:

imgStatus(i).OnClientClick = String.Format("javascript:window.open('Review.aspx ?Id={0}');", i.ToString())

If that's not what you want, please be more explicit. Try to avoid implicit terms as Page 2, but try to describe stuff like PostBack on the same page versus browsing client side to a new page like Review.aspx. Please add as much relevant data as you see fit.

What I also don't see is what you mean with "lets me get information related to the last img button in the page1 table." How do you know? What enables you to determine what the last button is? Don't all your buttons do exactly the same? (Open Review.aspx)? And how do you uniquely identify a row / button? TSRNumber seems like a good candidate for a primary key, but you don't pass it in the query string to the next page.

Maybe the answer lies in this:

Session.Add("TSRNumber", txtTsrNumber(i).Text)

Are you, on page two, getting data based on Session("TSRNumber")?

Cheers,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.