ASP.NET Webforms C#中没有出现Jquery窗口 [英] Jquery windows doesn't appears in ASP.NET Webforms C#

查看:62
本文介绍了ASP.NET Webforms C#中没有出现Jquery窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,请您帮我解决这个问题,如果这不是正确的帖子,请对不起。

Hello, could you please help me with this and sorry if this is not the correct thread.

我正在开发一个ASP.NET WebForms项目并需要从其中一个webforms执行CRUD操作,客户想要在每次用户想要对数据库执行操作时或者当用户想要
退出webForm时显示模式弹出确认对话框,所以我决定使用jQuery创建模态弹出确认对话框,问题是:我需要六个确认窗口(CRUD +搜索+关闭窗口),我不会重复相同的javascript代码六次确认窗口
但不同消息所以我'创建了这个函数,接收标题,消息和按钮作为参数

I'm working on an ASP.NET WebForms project and need to perform CRUD operations from one of the webforms, the client wants to show a modal popup confirmation dialog every time a user wants to performs an operation over the database or just when the user wants to exit the webForm, so I' decided to use jQuery to create the modal popup confirmation dialog, the problem is: I need six confirmation windows(CRUD+search+close window) and I won't repeat the same javascript code six times for a confirmation window but different message so I' created this function that receives the title, the message and the button as parameters

var _confirm = false;
         function Confirm(str, strtitle, button) {
             //e.preventDefault();
             if (!strtitle) strtitle = 'Mensaje de error';
             
             $("#dialog").dialog({
                 autoOpen: true,
                 draggable: false,
                 resizable: false,
                 modal: true,
                 title: strtitle,
                 width: 350,
                 height: 180,
                 show: "slide",
                 hide: "puff",

                 buttons: {
                     "No": function () {
                         jQuery(this).dialog("close");
                     },

                     "Yes": function () {
                         jQuery(this).dialog("close");
                         //__doPostBack(button, '')
                         _confirm = true;
                         button.click();
                     }
                 },

                 close: function () {
                     jQuery(this).remove();
                 }
             });
             return _confirm
             //$('#dialog').show();
             //$('#dialog').html(str);
         }

ASP.NET按钮是

the ASP.NET button is

<asp:button id="Button2" onclick="btnDGV_Click" onclientclick="Confirm('Desea eliminar el registro', 'Confirmacion', this);" runat="server" text="Eliminar Registro">
</asp:button>

并且服务器端的方法btnDGV_Click将执行操作,但在这种情况下,它仅显示确认消息的消息action

and the method btnDGV_Click on the server side will perform the action, but in this case it only shows a message that confirms the action

protected void btnDGV_Click(object sender, EventArgs e)
        {
            ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Registro eliminado exitosamente !!!')", true);
        }


我的问题是jQuery模态窗口出现并在眨眼间消失,突然出现来自服务器端的消息,请你告诉我我在哪里问题?我很确定它必须与jQuery有关,但我无法
设法找到失败的结果。

my problem is that the jQuery modal windows appears and disappears on a blink of an eye and all of a sudden the message from the server side appears, could you please tell me where is my problem? I'm pretty sure it must be related to the jQuery but I couldn't managed to find the failure

pabletoreto

pabletoreto

推荐答案

请在ASP.NET论坛(http://forums.asp.net)上发布与ASP.NET相关的问题。
Please post questions related to ASP.NET in the ASP.NET forums (http://forums.asp.net ).


这篇关于ASP.NET Webforms C#中没有出现Jquery窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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