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