Murray Brown
asked on
ASP.net Include a frame in a GridView
Hi
I got the following off Google maps to embed a street view into my ASP.net site
How would I update the code further down which puts images in a GridView to rather include this frame
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?
f=q&source=embed&h l=en&g eocode=&am p;q=47+Ath oll-Oaklan ds+Road,+J ohannesbur g+2076,+So uth+Africa &aq=&a mp;sll=-26 .135848,28 .069382&am p;sspn=0.0 1098,0.024 784&ie =UTF8& hq=&hn ear=47+Ath oll-Oaklan ds+Rd,+Bir nam,+Johan nesburg,+C ity+of+Joh annesburg+ Metropolit an+Municip ality,+Gau teng+2196, +South+Afr ica&ll =-26.13584 8,28.06938 2&spn= 0.01098,0. 024784& ;t=m&z =14&la yer=c& cbll=-26.1 36924,28.0 67259& panoid=r9Z iJXaettPfl 6ub-zk41Q& amp;cbp=12 ,15.89,,0, 0.81&o utput=svem bed"></ifr ame><br /><small><a href="https://maps.google.com/maps?f=q&source=embed&hl=en&geocode=&q=47+Atholl-Oaklands+Road,+Johannesburg+2076,+South+Africa&aq=&sll=-26.135848,28.069382&sspn=0.01098,0.024784&ie=UTF8&hq=&hnear=47+Atholl-Oaklands+Rd,+Birnam,+Johannesburg,+City+of+Johannesburg+Metropolitan+Municipality,+Gauteng+2196,+South+Africa&ll=-26.135848,28.069382&spn=0.01098,0.024784&t=m&z=14&layer=c&cbll=-26.136924,28.067259&panoid=r9ZiJXaettPfl6ub-zk41Q&cbp=12,15.89,,0,0.81" style="color:#0000FF;text- align:left ">View Larger Map</a></small>
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Page.DataBind()
End Sub
Protected Sub btnSort_Click(sender As Object, e As EventArgs) Handles btnSort.Click
Call SortGridView()
End Sub
Sub SortGridView()
Try
GridView1.DataSource = Nothing
Dim dt As New DataTable()
dt = GetData()
Dim dv As DataView = dt.DefaultView
dv.Sort = "Title"
GridView1.DataSource = dv
GridView1.DataBind()
Catch ex As Exception
End Try
End Sub
Function GetData() As DataTable
' This method creates a DataTable with four rows. Each row has the
' following schema:
' PictureID int
' PictureURL string
' Title string
' DateAdded datetime
Dim dt As New DataTable()
' define the table's schema
dt.Columns.Add(New DataColumn("PictureID", GetType(Integer)))
dt.Columns.Add(New DataColumn("PictureURL", GetType(String)))
dt.Columns.Add(New DataColumn("Title", GetType(String)))
dt.Columns.Add(New DataColumn("DateAdded", GetType(DateTime)))
' Create the four records
Dim dr As DataRow = dt.NewRow()
dr("PictureID") = 1
dr("PictureURL") = ResolveUrl("~/Resources/Cr aighall_Ha nds_On_Ret reat.jpg")
dr("Title") = "zBlue Hills"
dr("DateAdded") = New DateTime(2005, 1, 15)
dt.Rows.Add(dr)
dr = dt.NewRow()
dr("PictureID") = 2
dr("PictureURL") = ResolveUrl("~/Resources/Cr aighall_Pa rk_Abbey_G uest_House .jpg")
dr("Title") = "Sunset"
dr("DateAdded") = New DateTime(2005, 1, 21)
dt.Rows.Add(dr)
dr = dt.NewRow()
dr("PictureID") = 3
dr("PictureURL") = _
ResolveUrl("~/Resources/Me lrose_Melr ose_Place_ Guest_Lodg e.jpg")
dr("Title") = "Water Lilies"
dr("DateAdded") = New DateTime(2005, 2, 1)
dt.Rows.Add(dr)
dr = dt.NewRow()
dr("PictureID") = 4
dr("PictureURL") = ResolveUrl("~/Resources/Me lrose_The_ Peech_Hote l.jpg")
dr("Title") = "Winter"
dr("DateAdded") = New DateTime(2005, 2, 18)
dt.Rows.Add(dr)
Return dt
End Function
I got the following off Google maps to embed a street view into my ASP.net site
How would I update the code further down which puts images in a GridView to rather include this frame
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?
f=q&source=embed&h
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Page.DataBind()
End Sub
Protected Sub btnSort_Click(sender As Object, e As EventArgs) Handles btnSort.Click
Call SortGridView()
End Sub
Sub SortGridView()
Try
GridView1.DataSource = Nothing
Dim dt As New DataTable()
dt = GetData()
Dim dv As DataView = dt.DefaultView
dv.Sort = "Title"
GridView1.DataSource = dv
GridView1.DataBind()
Catch ex As Exception
End Try
End Sub
Function GetData() As DataTable
' This method creates a DataTable with four rows. Each row has the
' following schema:
' PictureID int
' PictureURL string
' Title string
' DateAdded datetime
Dim dt As New DataTable()
' define the table's schema
dt.Columns.Add(New DataColumn("PictureID", GetType(Integer)))
dt.Columns.Add(New DataColumn("PictureURL", GetType(String)))
dt.Columns.Add(New DataColumn("Title", GetType(String)))
dt.Columns.Add(New DataColumn("DateAdded", GetType(DateTime)))
' Create the four records
Dim dr As DataRow = dt.NewRow()
dr("PictureID") = 1
dr("PictureURL") = ResolveUrl("~/Resources/Cr
dr("Title") = "zBlue Hills"
dr("DateAdded") = New DateTime(2005, 1, 15)
dt.Rows.Add(dr)
dr = dt.NewRow()
dr("PictureID") = 2
dr("PictureURL") = ResolveUrl("~/Resources/Cr
dr("Title") = "Sunset"
dr("DateAdded") = New DateTime(2005, 1, 21)
dt.Rows.Add(dr)
dr = dt.NewRow()
dr("PictureID") = 3
dr("PictureURL") = _
ResolveUrl("~/Resources/Me
dr("Title") = "Water Lilies"
dr("DateAdded") = New DateTime(2005, 2, 1)
dt.Rows.Add(dr)
dr = dt.NewRow()
dr("PictureID") = 4
dr("PictureURL") = ResolveUrl("~/Resources/Me
dr("Title") = "Winter"
dr("DateAdded") = New DateTime(2005, 2, 18)
dt.Rows.Add(dr)
Return dt
End Function
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER