Get layer Popup return value in ASP.

Source: Internet
Author: User

1, mainpage.aspx Click the button to take advantage of layer popup, the code is as follows:

<%@ page language= "C #" autoeventwireup= "true" codebehind= "MainPage.aspx.cs" inherits= "demo. MainPage "%><! DOCTYPE html>

protected void Page_Load (object sender, EventArgs e) {      if (!string. IsNullOrEmpty (request.querystring["Formsubmit"))      {          this.divMsg.InnerHtml = "Unit code:" + Hidselectunit.value + "</br> Comparison Date:" + hidCompareDate.Value.Split (', ') [0] + "|" + hidCompareDate.Value.Split (', ') [1] + "</br> Contrast tip: "+ hidCompareTips.Value.Split (', ') [0] +" | "+ hidCompareTips.Value.Split (', ') [1];      }}


Key code:

Layer.open ({
Title: [' Advanced query '],
Type:2,
Content: "Subpage.aspx?" Unitcode= "+ Unitcode,
Area: [' 500px ', ' 520px '],
shade:0.3,
BTN: [' OK ', ' close '],
Yes:function (index) {
var res =window["Layui-layer-iframe" + index].savefunc ();
if (res! = False) {
$ ("#hidSelectUnit"). Val (Res. Selectunit);
$ ("#hidCompareDate"). Val (res.comparedate);
$ ("#hidCompareTips"). Val (res.comparetips);
$ ("#form1"). Submit ();
}
}
});


2, Subpage.aspx is the pop-up box content area, the code is as follows:

<%@ page language= "C #" autoeventwireup= "true" codebehind= "SubPage.aspx.cs" inherits= "demo. Subpage "%><! DOCTYPE html>
3, the effect as shown:

Identify and accept the popup input information and other information, as shown in:





Get layer Popup return value in ASP.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.