Last Reply on Feb 15, 2012 01:51 AM By svibuk

Views: 381   Replies: 11  Answers: 0


svibuk

258 Points
Novice
Joined: Jan 27, 2012 03:42 AM
Replies: 280
on Feb 13, 2012 04:10 AM

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

    <ContentTemplate>

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

      <Columns>

      <asp:TemplateField>

        <ItemTemplate>

        

        </ItemTemplate>

        <HeaderTemplate>

        <span onmouseup="MouseUp(this);">Test</span>

        </HeaderTemplate>

      </asp:TemplateField>

      </Columns>

    </asp:GridView>

    <asp:Button ID="b1" runat="server" OnClick="b1_Click" Text="" />

    </ContentTemplate>

    <Triggers>

    <asp:AsyncPostBackTrigger ControlID="b1" />

    </Triggers>

</asp:UpdatePanel>





protected void btnpb_Click(object sender, EventArgs e)

    {
    try

    {
// executiing a sql query for getting a condition depending on which teh control will be visible true/ fasle

if (reader["status"]=="A")
      div1.Visible = true;
else if (reader["status"]=="B")
  {     dropdown1.visible = true
populatedropdown();
}
else
{
   textbox1.Visible = true;
}


  

    }

    catch

    {

    }

    }

Javascript

<script type="text/javascript">

 

    function MouseUp(e) {
// this script will be executed wen the grid header cell is clicked
    document.getElementById('<b1').click();

    }

</script>


i have the above code

issues faced
1)the time to populate & display the drop-down takes much longer time
2) when the grid header cell is clicked once depending on the condition a control will be visible
   if i again click another header cell wthout  making the display control visible false the javascript is not getting executed
3)it works fine in FF  but in IE if i dont give alert in script the button event doesnot get fired



You are viewing reply posted by: svibuk on Feb 15, 2012 01:51 AM. Show All

svibuk

258 Points
Novice
Joined: Jan 27, 2012 03:42 AM
Replies: 280
0
Permanent Link on Feb 15, 2012 01:51 AM

ok i am trying in  adiiferent system

but is the baove one  a error??


© 2012 www.aspforums.net All rights reserved. Powered by Excelasoft Solutions.  Excelasoft Solutions

Disclaimer: This site is started with intent to serve the ASP.Net Community by providing forums (question-answer) site where people can help each other. The content posted here is free for public and is the content of its poster. The site does not provide any warranties for the posted content. If you feel any content is violating any terms please contact.