Hi,
Yes, I have to admit my explanation was confusing.
1. All the functions are in Class Catalogue.
2. Yes, class catalogue is derived from Inherits System.Web.UI.Page.
The class is in catalogue.aspx.vb. It has the code for catalogue.aspx.
3. In my aspx page (HTML code) I have 2 div's:
A) DIV id="Products_Grid"
DIV Products_Grid includes PRODUCTS datagrid which shows N records.
The DataGrid has 3 database fields:
1 - [Image01]
2 - [Title]
3 - [Price]
B) DIV id="Product_Detail"
In DIV Product_Detail I have:
1 - One ASP:Image - [Image01] database field by default. Full Size.
2 - Three ASP:ImageButtons - 3 thumbnail images using the fields:
[Image01], [Image02], [Image03]
3 - Four ASP:Labels - [Title], [Description], [Price],
Code:
4. My functions
A) Build_Grid()
Builds the PRODUCTS datagrid, binds it to data...
B) Change_Product()
When a record in datagrid is pressed it changes all the ASP:Image,
ASP:ImageButtons and ASP:Labels in DIV Product_Detail.
Like a Master-Detail in the same page.
C) Change_Photo()
When an ASP:ImageButton is pressed it gets its value and change the
URL of full size image displayed in ASP:Image in DIV Product_Detail.
This is where I have the problem!
Change_Photo() receives the field to use from the ASP:ImageButton.
I am using e.CommandName.
Q: But what record is being displayed? What is its productid?
A: It is the same as last record pressed in the datagrid.
So my implementation is:
[QUOTE]
Change_Product() is called THEN:[/QUOTE]
Global variable CurrentProductID = ProductID of row pressed in datagrid.
Change Product_Detail Labels and Images values using this record value.
[QUOTE]
Change_Photo() is called THEN[/QUOTE]
Get new Thumbnail to show in ASP:Image (full size) from e.CommmandName
Get CurrentProductID
Change ASP:Image "Photo" using the 2 values.
Well, this might be confusing but it's nothing more then a master-detail
page in some page and in the detail part I have 3 thumbnails with a full
size feature for them.
Everything is working but when I click the image buttons it's like the
global variable CurrentProductID is not available. I have no idea why.
Thanks,
Miguel
[QUOTE]
Hi Miguel,
I'm still confused. Sorry. First, what exactly do you mean by "region?"
In
Visual Studio.Net, a region is simply an organizational tool for use in
development, and has nothing to do with how an app works. In an ASP.Net
page, I have no idea what the word is supposed to represent.
Second, as I mentioned before, I saw some of your code, which defined a
class called "catalogue." Here is a reproduction of the code you posted
initially:
Now, the Page_Load Sub leads me to believe that this class is somehow
supposed to be derived from System.Web.UI.Page, but there is no
"Inherits"
statement that indicates that it does. So, part of my confusion extends
from
that.
After the ellipse, you state:
I'm not at all sure of what this class has to do with your Page, if
anything. The variable (field) "productid" is a public field of the
"catalogue" class. So, since I don't know what's going on with regards to
that class, I can't figure out what exactly is going wrong.
I don't know where you "have" this image button. If it is a member of the
"catalogue" class, what again does it have to do with an ASP.Net Page
class,
which you have talked about, but doesn't seem to appear anywhere in your
code?
--
HTH,
Kevin Spencer
Microsoft MVP
.Net Developer
Ambiguity has a certain quality to it.
[/QUOTE]
[/QUOTE]