|
Show <div> on postback
I'm sure I have pretty simple question but for some reasons I can't find answer
I have a basic JS function to show an element
function show(obj1) {
var div = document.getElementById(obj1);
div.style.display = 'inline';
}
.....
<a onclick="show('Div')>Show Panel</a>
<div id="Div" runat="server" style="display: none">
<table><tr><td>
...Controls
</td></tr>
<tr><td>
<asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click" />
</td></tr>
</table>
</div>
Displaying the panel is not a problem but how do I keep it shown on a postback (btnSearch_click)?
protected void btnSearch_Click(object sender, EventArgs e)
{
//Do something
//tried
Div.Attributes.Add("display", "inline'");
//and Div.Style("display") = "inline";
//and Div.Visible = true;
}
no matter what I do, it gets hidden.
|