NET popup page window selects the return value

  • 2020-12-16 05:55:23
  • OfStack

In the page to be displayed in the dialog box < head > < /head > Add" < base target="_self" / > ".
Handle postbacks that pop up new pages

Main Function description:

Click a button in the web page to pop up a page window, select the value of the popup page window, close the window, and the interface will get the value
 
// right B Interface selection value processing  

<input type="button" id="btnClose" value=" Confirm and close the window " onclick="closeWin()" /> 

function closeWin() { 

// the B The value of the interface is passed A Interface to  
window.returnValue = totalCount; 
window.close(); 
} 
//A The interface needs to select values  
function showUnitDialog2(id) { 
var rdm = Math.random(); 

// Open the B interface  
var result = window.showModalDialog("GoodsStocketacke.aspx?id=" + id + "&t=" + rdm, " Inventory details ", "dialogWidth=800px;dialogHeight=500px;center=1"); 

// accept B The value of the interface  

if (result) { 
$("#txtRealCount").val(result); 
$("#txtRealCount").attr("readonly", "true"); 
$("#tbUnit tr:eq(1) td:eq(3)").html(result); 
initButton(); 
} 
} 

Related articles: