asp.net中的页面加载问题。 [英] Problem on page load in asp.net.

查看:49
本文介绍了asp.net中的页面加载问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,

我正在使用asp.net。我确实绑定了谷歌地图与登录页面的div在加载页面时工作正常。但是当我在文本框中键入用户名并输入Enter按钮时谷歌地图没有显示我页面上的问题。



// Html代码



// Java脚本



Dear all,
i am using asp.net. i did bind google map with in div of my login page its working fine when load the page. but when i type the user name to the text box and enter the Enter button that time google map not showing what is the problem on my page.

//Html Code

//Java script

<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js">
    </script>







< script type =text / javascript>

函数初始化ialize(){

var mapProp = {

center:new google.maps.LatLng(20.5937,78.9629),

zoom:9,

mapTypeId:google.maps.MapTypeId.ROADMAP

};

var map = new google.maps.Map(document.getElementById( map),mapProp);

}

google.maps.event.addDomListener(window,'load',initialize);

< ; / script>



// LoginBox






<script type="text/javascript">
function initialize() {
var mapProp = {
center: new google.maps.LatLng(20.5937, 78.9629),
zoom: 9,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map"), mapProp);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>

//LoginBox

<body background="skyBackground.jpg" >
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>




<asp:UpdatePanel ID="upPanel" runat="server">
                   <ContentTemplate>







<div id="lalUser" style="margin-left: 2%; margin-top: 16px; position: absolute; color: darkblue;">
                            <asp:Label ID="lblUser" runat="server" Text="UserName"></asp:Label>
                        </div>



< asp:TextBox ID = txtUserName1runat =serverWidth =100%Height =100%OnTextChanged =txtUserName1_TextChanged

Style =border:3px solid#63FF00;>



< asp:TextBox ID =txtPassword1runat =serverWidth =100%Height =100%OnTextChanged =txtPassword1_TextChanged

TextMode =密码Style =border:3px solid#63FF00;>

//加载地图


<asp:TextBox ID="txtUserName1" runat="server" Width="100%" Height="100%" OnTextChanged="txtUserName1_TextChanged"
Style="border: 3px solid #63FF00;" >

<asp:TextBox ID="txtPassword1" runat="server" Width="100%" Height="100%" OnTextChanged="txtPassword1_TextChanged"
TextMode="Password" Style="border: 3px solid #63FF00;" >
//load Map

<div id="map" class="loadmap">
                    </div>





< / ContentTemplate>

< / asp:UpdatePanel>



问候,

Karthik



我尝试了什么:



i试图加载谷歌地图。



</ContentTemplate>
</asp:UpdatePanel>

Regards,
Karthik

What I have tried:

i tried to load the google map.

推荐答案

将地图div放在更新面板之外。



ie



这个:



Place the map div outside the Update Panel.

ie

Place this:

<div id="map" class="loadmap"> </div>





之后(下方):





after (below) this:

</ContentTemplate>
</asp:UpdatePanel>


这篇关于asp.net中的页面加载问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆