UpdatePanel
안에 또 UpdatePanel
이 있고 내부 UpdatePanel에 버튼이있는 경우이 버튼을 클릭 할 때 내선 UpdatePanel
만 새로 고침하면됩니다. 어떻게?다른 UpdatePanel 내에서 UpdatePanel 만 새로 고침
4
A
답변
3
innerupdate 패널에서 updatemode를 조건부로 설정하고 outerupdatepanel childrenastriggers 속성을 false로 설정합니다. 내부 업데이트 패널에서 포스트 백 트리거를 추가하고 포스트 백을 발생시킬 버튼에 설정합니다. 이
<asp:UpdatePanel ID="parentup" runat="server" ChildrenAsTriggers="false">
<ContentTemplate>
<asp:UpdatePanel ID="chidlup" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:Button ID="btn" runat="server" />
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="btn" />
</Triggers>
</asp:UpdatePanel>
</ContentTemplate>
</asp:UpdatePanel>
4
@Waqar Janjua 같은 뭔가 권리입니다.
그러나 ChildrenAsTriggers를 false로 설정할 필요는 없으며 때로는 사실로 두는 것이 더 편리합니다.
두 업데이트 패널에서 모두 속성을 UpdateMode = "조건부" (기본값으로 ChildrenAsTriggers를 그대로 유지)으로 설정하십시오. 다음의 : Janjua 말했듯이 당신의 버튼에 트리거를 추가하려면 UpdateMode를이 조건없는 경우
이<Triggers>
<asp:AsyncPostBackTrigger ControlID="btn" />
</Triggers>
각 updatepanel가 업데이트됩니다. 여기 Source
<asp:ScriptManager ID="script1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="up1" runat="server">
<ContentTemplate>
<asp:Label ID="lblTime" runat="server" ForeColor="Red"></asp:Label>
<asp:Button ID="buttonOuter" runat="server" OnClick="buttonOuter_Click" Text="What is the time?" />
<asp:UpdatePanel ID="up2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="lblTime2" runat="server" ForeColor="Blue"></asp:Label>
<asp:Button ID="buttonInner" runat="server" OnClick="buttonInner_Click" Text="What is the time?" />
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="buttonOuter" EventName="Click"/>
</Triggers>
</asp:UpdatePanel>
입니다 그리고 여기 code behinde
입니다 :
0
이 코드는 당신을 도와줍니다 UP1은 외부 UpdatePanel이며, UP2는 내부, 그리고 당신이를 방지하려면
protected void Page_Load(object sender, EventArgs e)
{
}
protected void buttonInner_Click(object sender, EventArgs e)
{
up2.Update();
lblTime2.Text = DateTime.Now.Second.ToString();
}
protected void buttonOuter_Click(object sender, EventArgs e)
{
lblTime.Text = DateTime.Now.Second.ToString();
}
0
내부 버튼으로 업데이트 할 바깥 쪽 :
UP1.UpdateMode="Conditional"
UP1.ChildrenAsTriggers= "False"
또한 당신은 나에게
<asp:UpdatePanel ID="UP1" runat="server" ....>
<ContentTemplate>
....
</ContentTemplate>
<Triggers>
<asp:Trigger ControlID="btn" EventName="Click"/>
</Triggers>
</asp:UpdatePanel>
관련 문제
- 1. Asp.net updatePanel 새로 고침
- 2. 새로 고침 UpdatePanel
- 3. GridView UpdatePanel 새로 고침
- 4. 페이지로드 후 ASP.Net UpdatePanel 새로 고침
- 5. LinkButton이 UpdatePanel 내에서 더블 클릭하는 것을 방지합니다.
- 6. ASP.NET UpdatePanel : 새로 고침 할 때마다 클라이언트 스크립트를 실행하는 방법
- 7. "파일 다운로드"대화 상자 다음에 UpdatePanel 새로 고침
- 8. ICallbackEventHandler Vs. UpdatePanel
- 9. multiple updatepanel
- 10. UpdatePanel -이 동적으로 UpdatePanel 문제를 만든
- 11. UpdatePanel Question
- 12. 다른 사용자의 웹 페이지 UpdatePanel
- 13. ASP.NET 다른 클라이언트에서 UpdatePanel 업데이트
- 14. UpdatePanel 트리거
- 15. GridView UpdatePanel & Linkbutton 문제
- 16. 왜 asp : UpdatePanel 이미지를 새로 고치지 않습니까?
- 17. page UpdatePanel 내에서 여러 번로드 이벤트 발생
- 18. jquery 및 updatepanel?
- 19. Updatepanel 및 jqgrid
- 20. 면도기에서 "UpdatePanel"(mvc 3)
- 21. 마스터 페이지의 UpdatePanel
- 22. ASP.NET의 updatepanel : 조건부 고장
- 23. UpdatePanel 내가 자바 스크립트를 통해 업데이트 패널을 새로 고치려고 클라이언트
- 24. 된 UpdatePanel 문제 나 버그에
- 25. ASP.NET UpdatePanel 컨트롤
- 26. UpdatePanel 컨트롤 및 페이지 상단으로 이동
- 27. ASP.NET UpdatePanel 포스트 백
- 28. AJAX updatepanel, MVC 3.0에서의 타이머 기능
- 29. UpdatePanel 조건부 updatemode가 작동하지 않음
- 30. 업데이트 데이터 목록은 UpdatePanel
THX (다음 코드 등) UP1의 트리거로 그 작업을 щࣉ =를 추가하지 말아야 – aref