0

わかりましたので、私の問題は、Googleマップを表示するためのiframeがあることです

iframe の src は、場所として挿入されているデータベースから読み取られた住所で googlemaps にヒットするように設定されます

その瞬間、フレームは真っ白で画像も表示されませんが、src パスがブラウザ URL に配置されている場合は正常に動作します。私が持っているテスト URL は「http://maps.google.com/maps/api」です。 /staticmap?markers=27+Landseer+Street,+ベルファスト&size=500x300&sensor=false"

これは、アドレス バーに入力した場合に表示されるように有効です。

私の目的は、3 つのフレームすべてに個別に名前を付けてから、それらに src を設定することです。これまでの私のコードは次のとおりです

VB.NET パブリック クラス System.Web.UI.Page の継承について

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Session("recentAddressmap1") = ""
    Session("recentAddressmap2") = ""
    Session("recentAddressmap3") = ""
    Session("src1") = ""
    Session("src2") = ""
    Session("src3") = ""
    Dim recentCount As Integer
    recentCount = 0
    Dim addresstest As String = "27 Landseer Street"
    Dim words As String() = addresstest.Split(New Char() {" "c})

    ' Use For Each loop over words and display them
    Dim word As String
    Dim newaddress As String = ""
    Dim loopcounter As Integer = 0
    For Each word In words
        If loopcounter = 0 Then
            newaddress = word
            loopcounter = loopcounter + 1
        Else
            newaddress = newaddress & "+" & word
        End If
    Next
    '''''''''''''''''''''''''''''''''''''''''' DO ENTRY RECENT 1 '''''''''''''''''''''''''''''''''''''''''''''''''''
    Session("recentAddressmap1") = newaddress & ",Belfast"
    Session("src1") = "http://maps.google.com/maps/api/staticmap?markers=" & Session("recentAddressmap1") & "&size=500x300&sensor=false"
    'MsgBox(Session("src1"))
    visualAddress1.Attributes.Add("src", Session("src1"))
End Sub

クラス終了

ASPX

<%@ Page Title="About Us" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"
CodeBehind="About.aspx.vb" Inherits="email_tester.About" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
               <iframe width="425" height="350" scrolling="no" marginheight="0" marginwidth="0" id="visualAddress1" runat="server"></iframe>

</asp:Content>
4

1 に答える 1

0

ID + runat=server を iframe に与えてから、VB から src を設定するのはどうですか?

于 2012-07-13T17:11:03.423 に答える