0
votes

hello every one my problem goes like this i have two updatepannels

  <asp:UpdatePanel ID="new_word_panel_UpdatePanel" runat="server" UpdateMode="Conditional">
     <ContentTemplate >    
          <asp:Panel ID='new_word_panel' runat="server">
            <asp:Button ID='new_word_btn' runat="server" Text='give me a new word' Visible='false' OnClick='GenNewWord' />            
          </asp:Panel>
    </ContentTemplate>

 </asp:UpdatePanel>  
 <asp:UpdatePanel ID="UpdatePanel1" runat="server" >
     <ContentTemplate > 
  <asp:Button ID='Button8' runat="server" Text='hide' OnClick='hidegive' />
   </ContentTemplate>
 </asp:UpdatePanel> 

the first updatepanel UpdateMode is set to Conditional so i can update is content from the second updatepanel asp:Button ID='Button8' OnClick='hidegive' event easily by using the Update() method.

this is the eventhandler:

protected void hidegive(object sender, EventArgs e)
    {
        if (new_word_btn.Visible == true)
            new_word_btn.Visible = false;
        else
            new_word_btn.Visible = true;


        **new_word_panel_UpdatePanel.Update();**
    }

my problem is that i cant update the first UpdatePanel from reguler method on my page although i am using the Update() method, i have try to update panel from this method and nothing hapeens:

void PlayerWinEventHandler(object sender,Game.PlayerWinEventArgs e)
    {


        Session["score"] = int.Parse(Session["score"].ToString()) + 10;
        UpdateScore();


        if (new_word_btn.Visible == true)
            new_word_btn.Visible = false;
        else
            new_word_btn.Visible = true;

        new_word_btn.Text = "zibi";
        **new_word_panel_UpdatePanel.Update();**

    }

thanks for your help...

1
Who raises the event PlayerWinEvent? What control on the UI? - nunespascal
another update panel : <asp:UpdatePanel ID="select_letters_UpdatePanel" runat="server" UpdateMode='Conditional'> - David Munsa
he raises this event after calling 3 DB methods - David Munsa

1 Answers

0
votes

Why dont you use Triggers in your first update panel.

  <Triggers>
                      <asp:AsyncPostBackTrigger ControlID="Button8" EventName="Click"/>
                    </Triggers>