2009-11-13 10 views
1

div의 innerhtml을 설정하는 asp.net에서 개발 된 응용 프로그램이 있습니다. 나는 googlemap을 보여줄 html 문자열을 만들고 있습니다. 그것은 잘 작동합니다. 하지만 내 div를 업데이트 패널에 넣었을 때. 그것은 div에서 googlemap을 보여주지 않습니다.updatepanel div innerHTML 문제



  </td> 
     </tr> 
     <tr> 
      <td colspan="4"> 
       <asp:UpdatePanel ID="UpdatePanel2" runat="server"> 
        <ContentTemplate> 
         <div id="map_canvas" runat="server" style="width: 100%; height: 1500px; margin-bottom: 2px; 
          text-align: center;"> 
          <asp:Panel ID="Panel1" runat="server"> 
           <%--Place holder to fill with javascript by server side code--%> 
           <asp:Literal ID="js" runat="server"></asp:Literal> 
           <%--Place for google to show your MAP--%> 
           <div id="Div1" style="width: 100%; height: 728px; margin-bottom: 2px;"> 
           </div> 
           <br /> 
          </asp:Panel> 
         </div> 
        </ContentTemplate> 
        <Triggers> 
         <asp:AsyncPostBackTrigger ControlID="btnShow" EventName="Click" /> 
        </Triggers> 
       </asp:UpdatePanel> 
      </td> 
     </tr> 

여기 내 버튼을 클릭 이벤트입니다 : 여기 내 영문 파일의 코드입니다.

protected void btnShow_Click(object sender, EventArgs e) 
{ 
    // works fine without update panel.  
    map_canvas.InnerHtml = showMapWithPoints(); 
} 

답변

0

당신이 할 때 .....이 살펴 보셔야 될 수있다

map_canvas.InnerHtml = showMapWithPoints(); 

당신은을 포함하여 모든 것을 덮어 쓰는 모든 서버 측 컨트롤, 해당 div 내에서.

'js'및 'div1'컨트롤과 같이 사용할 수있는 컨트롤이 필요합니까?