简体   繁体   English

如何在post back ASP.NET上设置div标签

[英]How to set the div tag visible on post back ASP.NET

I have a textbox that is used for searching. 我有一个用于搜索的文本框。 upon clicking the ok button and posting back, the function is called, and gets matching results by using sql query in the aspx.cs file 单击确定按钮并回发后,调用该函数,并通过在aspx.cs文件中使用sql查询获得匹配结果

this information will be displayed in the div tag and set visible. 此信息将显示在div标签中并设置为可见。 initially div tag will not be visible. 最初div标签将不可见。 after the button posts back, then the div tag will be set visible. 按钮回发后,div标签将被设置为可见。

You could use a panel: 您可以使用面板:

<asp:Panel id="results" runat="server" Visible="false">
    ...
</asp:Panel>

and then: 接着:

results.Visible = true;

or a div: 或者div:

<div id="results" runat="server" Visible="false">
    ...
</div>

and then: 接着:

results.Visible = true;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM