using grid in update panel

Last Reply on Feb 02, 2012 03:42 AM By Mudassar

Posted on Feb 01, 2012 12:27 AM

 

 

i have above code

but the  div.Visible = true;
    textbox1.Visible = true; are not visible

secondaly the b1 click event happens only once

if i again click the script does not get executed

function MouseUp(e)
{
document.getElementById('b1').click();
}


  protected void btnpb_Click(object sender, EventArgs e)
      {

        try
        {


    div.Visible = true;
    textbox1.Visible = true;
}
}


<asp:UpdatePanel ID="Panel1" runat="server">

      <ContentTemplate>

  <asp:GridView ID="grid1" runat="server" >

 

  </asp:GridView>

  <Triggers>
    <asp:AsyncPostBackTrigger ControlID="b1" EventName="Click" />
  </Triggers>
  </asp:UpdatePanel>
  <br />
   
  <asp:Button ID="b1" runat="server" Text="" />

 

Results 1 - 5 of 13 123
Posted on Feb 01, 2012 12:27 AM

Put your Button inside updatepanel and put a breakpoint in the event and check


Posted on Feb 01, 2012 12:31 AM Modified on on Feb 01, 2012 12:40 AM

do u mean remove the triggers & put the b1 inside update panel?

 

i tried the same

Type 'System.Web.UI.UpdatePanel' does not have a public property named 'Button'.


Posted on Feb 01, 2012 12:43 AM

Just put button inside updatepanel. Keep trigger as is


Posted on Feb 01, 2012 12:48 AM

if i put in  <asp:UpdatePanel ID="UpdatePanel2" runat="server">
          <ContentTemplate>
           

b1

  </ContentTemplate>>

if i put it oustide  <ContentTemplate>  but in UpdatePanel i get below eroor

'System.Web.UI.UpdatePanel' does not have a public property named 'Button'.


Posted on Feb 01, 2012 12:52 AM

You need to put all controls in ContentTemplate, thus put button too in ContentTemplate

I agree, here is the link: https://www.e-iceblue.com/Introduce/spire-office-for-net-free.html