Showing posts with label clicking. Show all posts
Showing posts with label clicking. Show all posts

Wednesday, March 28, 2012

Content disapears on update of updatepanel inside of another updatepanel! Plz help.

Hi i have a problem, i have a UpdatePanel(UpdatePanel3) with a Panel(contentPanel)inside after clicking on the LinkButton(homeLinkButton)I add a Control(home.ascx) to Panel(contentPanel) in that control i have another UpdatePanel(homeUpdatePanel) and a Button(Button1), when i click on that button the whole content of Panel(contenPanel) disapears, how do i solve it and get a update of the dynamicly added UpdatePanel(homeUpdatePanel) inside of Panel(contentPanel)?

Default.aspx

1<form id="form1" runat="server">2 <asp:ScriptManager ID="ScriptManager1" runat="server" />3 <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">4 <ContentTemplate>5 <table style="width: 584px; height: 248px">6 <tr>7 <td style="width: 162px; height: 175px" valign="top">8 <asp:LinkButton ID="homeLinkButton" runat="server" OnClick="homeLinkButton_Click">Home</asp:LinkButton><br />9 <asp:LinkButton ID="uploadLinkButton" runat="server" OnClick="LinkButton3_Click">Upload</asp:LinkButton>10 <br />11 <asp:LinkButton ID="zoekenLinkButton" runat="server">Zoeken</asp:LinkButton></td>12 <td rowspan="2" valign="top">13 <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">14 <ContentTemplate>15 <asp:Panel ID="contentPanel" runat="server" Height="184px" Width="392px">16  </asp:Panel>17 </ContentTemplate>18 <Triggers>19 <asp:AsyncPostBackTrigger ControlID="homeLinkButton" />20 </Triggers>21 </asp:UpdatePanel>22 </td>23 </tr>24 <tr>25 <td style="width: 162px">26 </td>27 </tr>28 </table>29 </ContentTemplate>30 </asp:UpdatePanel>31 </form>
Default.aspx.vb
12Protected Sub homeLinkButton_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)3Dim clAs Control4 cl = LoadControl("home.ascx")5 contentPanel.Controls.Add(cl)6 UpdatePanel3.Update()7End Sub8
home.ascx
1<%@dotnet.itags.org. Control Language="VB" AutoEventWireup="false" CodeFile="home.ascx.vb" Inherits="home" %>2Dit is dan onze Home pagina die dymanisch wordt opgeladen.<br />3Pagina was geladen op4<asp:Label ID="pageLoadLabel" runat="server"></asp:Label><br />5<asp:UpdatePanel ID="homeUpdatePanel" runat="server" UpdateMode="Conditional">6 <ContentTemplate>7<asp:Label ID="timeLabel" runat="server"></asp:Label>8 </ContentTemplate>9 <Triggers>10 <asp:AsyncPostBackTrigger ControlID="Button1" />11 </Triggers>12</asp:UpdatePanel>13<asp:Button ID="Button1" runat="server" Text="Button" Width="160px" />
home.ascx.vb
1Protected Sub Page_Load(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles Me.Load2 timeLabel.Text = DateTime.Now3 pageLoadLabel.Text = DateTime.Now4End Sub56 Protected Sub Button1_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles Button1.Click7 timeLabel.Text = DateTime.Now8End Sub
Thx, Me

Hi,

Thank you for your post!

I think this is a known issue,It is something about Dynamicaly loading User Controls into UpdatePanel.

You can see the following threads too:

http://forums.asp.net/p/1156704/1906671.aspx#1906671

http://forums.asp.net/t/1108394.aspx

If you have further questions,let me know.

Best Regards,

Monday, March 26, 2012

ConfirmButton and disabled controls

I've noticed that ConfirmButton reacts on clicking on disabled (Enable = false;) buttons.
Sometimes U don't want to see confirm dialog when clicking the button is disabled.
One small modification in .js does the job (one condition when binding onclick handler) but it would by nice to have it the toolkit.

Good point - I'll add a work item for that. Thanks!
Note this is WorkItem 1482.