如何关闭在MVC 5中保存后通过局部视图打开的json popUp

时间:2016-06-29 10:25:58

标签: asp.net-mvc

我是MVC的新手。我正在使用MVC 5.how在创建/保存后关闭弹出窗口。 这是我的观看代码: -

var datePicker = UIDatePicker() //your UIDatePicker

//create a gregorian calendar
let calendar = NSCalendar(calendarIdentifier: NSCalendarIdentifierGregorian)!

// set the timezone
calendar.timeZone = NSTimeZone(name: "UTC")!

// create and set the component (for your minimum date value)
let components: NSDateComponents = NSDateComponents()
components.calendar = calendar
components.year = -100

// obtain the minimum NSDate, according to the defined components
//it will result as the difference of the years (components.year) from now (NSDate())
let minDate100YearsAgo: NSDate = calendar.dateByAddingComponents(components, toDate: NSDate(), options: NSCalendarOptions(rawValue: 0))!

//then you add this to the UIDatePicker
datePicker.minimumDate = minDate100YearsAgo

enter image description here

1 个答案:

答案 0 :(得分:0)

假设您使用jQuery.Ui创建对话框,您可以添加"关闭"像这样的按钮:

div.dialog({
    buttons: [
        {   text: 'Close',
            click: function() {
                $(this).dialog('close');
            }
        }
    ]      
});

同样适用于"创建"按钮。只需在“创建”按钮单击处理程序的末尾添加$(this).dialog('close');