• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 831
  • Last Modified:

Reference a variable in class code behind ASPX with the vb source code

Hi All

I am trying to retrieve an ID number being passed from another aspx page and place that value within an image url in order to retrieve the respective images. I have declared a variable within the class code as follows:

the url I am trying to retrieve theid from look like this:
http://localhost:3667/CasaInvestments/ListingDetails2.aspx?PID={DE8822E6-9CEA-4CF2-80ED-56D108B30DBC}

_________________________________

the variable declaration looks like this:

    Public Property PropertyID() As String
        Get
            Return CType(ViewState("propertyid"), String)
        End Get
        Set(ByVal value As String)
            ViewState("propertyid") = value
        End Set
    End Property

    Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs) _
            Handles Me.Init
        Me.PropertyID = Request.QueryString("PID")
    End Sub

_____________

and the img src currently looks like this:

<asp:Image ID="Image1" runat="server" Height="270px" Width="410px" ImageUrl="image2.aspx?CID=0&PID="

_____________

i need to be able to reference that id and place it within the image url

Thanks for your help

I am using visual studio aspx. thanks
0
acancel
Asked:
acancel
  • 2
  • 2
1 Solution
 
laotzi2000Commented:
In your Page_Load,

Image1.ImageUrl = "image2.aspx?CID=0&PID=" & PropertyID
0
 
acancelAuthor Commented:
This may be a dumb question, but where Page_Load...sorry, am new to ASP
0
 
laotzi2000Commented:
It's the event handler when your page loads. It's in the code behind.

Double click on your page and you will go to it.
0
 
acancelAuthor Commented:
never mind, figured it out...wow this stuff is absolutely awesome...thanks for the help
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now