单击按钮我想使用Jquery弹出gridview [英] On button click I want to pop up a gridview using Jquery

查看:70
本文介绍了单击按钮我想使用Jquery弹出gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,



我是Jquery的新手。我想点击一个按钮打开一个模态弹出窗口。 Gridview将由一些数据填充。如果gridview包含一些数据,那么我希望以模态弹出显示该数据。如果gridview不包含数据,那么我想显示一个消息框,说数据不可用。我可以在加载页面时显示一个对话框,但不能单击按钮。我无法应用适当的CSS,如显示块和没有。



帮我解决问题.....

Hi friends,

I am new to Jquery. I want to open a modal pop up window on click of a button. The Gridview will be filled by some data. if the gridview contains some data, then that data i want to display in modal pop up.If the gridview doesn't contains data, then I want to display a message box saying that 'The Data is not available'. I am able to display a dialog box on load of the page but not on click of a button. I am not able to apply proper CSS like display block and none.

Help me to solve the problem.....

推荐答案

希望我的解释能够解决帮助你。



首先要确保你引用了jquery库:例如



Hi, hope my explanation will help you.

First of all make sure that you have referenced to jquery libraries: for example

<head>
        <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1.min.js"></script>
        <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/jquery-ui.min.js"></script>
        <link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/themes/ui-lightness/jquery-ui.css" rel="stylesheet" type="text/css" />
    </head>







然后在你的页面中声明一些弹出对话框:






Then in your page declare some pop-up dialog:

<div id="CheckMessagesDialog" style="display: none">
</div>
<button id="testBtn">Press me</button>





在页面就绪事件处理程序中添加一些初始化行:





On page ready event handler add few initialization lines:


document ) .ready( function (){
(document).ready(function () {


' #MessagesDialog')。dialog({
autoOpen: false ,modal: true
宽度: 450 ,身高: 400
hide: explode,show: blind
closeOnEscape: true
按钮: {
关闭 function (){
('#MessagesDialog').dialog({ autoOpen: false, modal: true, width: 450, height: 400, hide: "explode", show: "blind", closeOnEscape: true, buttons: { "Close": function () {


这篇关于单击按钮我想使用Jquery弹出gridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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