单击链接按钮后如何在同一页面中显示gridview [英] How to show a gridview in a same page after clicking a link button

查看:64
本文介绍了单击链接按钮后如何在同一页面中显示gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hai,





我有一个链接按钮。如果我点击链接按钮,我想显示gridview详细信息同一页本身.Plz帮我。下面是代码



Hai,


I am having a link button.If I click the link button i want to show the gridview details in the same page itself.Plz help me.Below is the code

<table>
                  <tr>
                  <td>
                <a href="Incidentgv.aspx">Open Incidents</a>
                  </td>
                  </tr>
                  <tr>
                  <td>Open Problems</td>
                  </tr>
                  </table>





如果我点击上面的打开事件链接按钮,gridview应显示在同一页面本身。 />


提前致谢



If I click the above "Open Incidents" Link button gridview should be display in the same page itself.

Thanks in advance

推荐答案

因为你有 href =Incidentgv.aspx ,因此点击时它将始终重定向到该页面。



要限制它,您必须删除此属性并处理单击事件该链接。



还有一件事,这是一个HTML锚标记,所以你不能去服务器点击事件,在这种情况下你必须填充客户端的 GridView 。你可以在谷歌搜索一些例子。



但是,我建议你带一个 asp:LinkBut​​ton 和在其服务器点击事件中填充 GridView ,这很容易。
As you are having href="Incidentgv.aspx", so it will always redirect to that page when click.

To restrict that, you have to delete this attribute and handle click event of that Link.

One more thing, this is a HTML anchor tag, so you can't go to server click event, in that case you have to populate the GridView in client side. You can search for some examples in Google.

But, I would suggest you take a asp:LinkButton and populate the GridView in its Server Click event, which is easy.


让网格内置相同页面上有打开事件链接,然后默认隐藏它,然后在链接点击事件时显示它。
Have the grid inside the same page with the link "Open Incidents" and then just hide it by default and then show it upon link click event.


这篇关于单击链接按钮后如何在同一页面中显示gridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆