如何在ajax模型弹出窗口中验证数据? [英] How to validate the data in ajax model popup window?

查看:76
本文介绍了如何在ajax模型弹出窗口中验证数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何验证ajax模型弹出窗口中的数据???当我在验证数据后弹出来验证文本框时,弹出窗口正在关闭...焦点不在文本框中...我可以限制任何人可以帮助我plz

How to validate the data in ajax model popup window???when I was traying to validate the text box in pop up after validating the data the pop up is closing ...the focus is not in text box ..how can I restrict dis any one can help me plz

推荐答案

这是弹出窗口中的保存按钮代码

This is the save button code in pop up window
protected void btnSave_Click(object sender, EventArgs e)
    {
        string category = txtCategory.Text;
        if (category == "")
        {
            Message.Text = "Category name cannot be empty";

        }
        else
        {
            string value = addSkillBLL.CheckCategory(txtCategory.Text);
            if (value != "")
            {
                Message.Text = "Category Name already exists";
                txtCategory.Focus();

            }
            else
            {
                addSkillBLL.InsertCategory(txtCategory.Text);
                BindCategories();
                ddlCategory.SelectedIndex = ddlCategory.Items.Count - 1;
                Message.Text = "Category Name added sucessfully";
                Reset();
            }
        }
    }


你好。



首先使用AjaxControlToolkit添加命名空间。



; (如果你正在使用C#)



这里我们打算在弹出窗口执行某些任务后保持弹出窗口打开。要实现这一点,请编写一个代码以保持弹出窗口打开。





Hello.

First you add a namespace.

using AjaxControlToolkit; (If you are using C#)

Here we intend to keep the popup open even after performing some task on the popup window. To achieve this, write a code to remain the popup open.


private void button1_Click(object sender, System.EventArgs e)
{
   // Your code
   ModalPopupExtender.Show();
  
}





完成任务后,您可以使用ModalPopupExtender.Close();


希望这对你有帮助。



Once you task is achieved you can close it using ModalPopupExtender.Close();

Hope this will help you.


如果我使用ModelpopupExtender.show()方法,那么弹出式刷新
If I use ModelpopupExtender.show() method thn the pop up refreshing


这篇关于如何在ajax模型弹出窗口中验证数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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