In fact, Ajax modalpopupextender is used to update pseudo-new window data, because it is all in a page ,:)
<% @ Page Language = "C #" autoeventwireup = "true" codefile = "A. aspx. cs" inherits = "submodule_carmanage_a" %> </P> <p> <! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> </P> <p> <HTML xmlns = "http://www.w3.org/1999/xhtml"> <br/> <pead runat = "server"> <br/> <title> No title page </title> <br/> <MCE: style type = "text/CSS"> <! -- </P> <p>. modalbackground <br/>{< br/> background-color: # DDD; <br/> filter: alpha (opacity = 70); <br/> opacity: 0.5; <br/>}< br/>. modalpopup <br/>{< br/> background-color: # eafdff; <br/> border-width: 3px; <br/> border-style: solid; <br/> border-color: Gray; <br/> padding: 3px; <br/> width: 250px; <br/>}< br/>. confirmpanel <br/>{< br/> border: 2px solid # CCC; <br/> background-color: # FFF; <br/> padding: 15px; <br/> width: 230px; <br/> Height: 50px; </P> <p >}</P> <p> --> </MCE: style> <style type = "text/CSS" mce_bogus = "1"> <br/>. modalbackground <br/>{< br/> background-color: # DDD; <br/> filter: alpha (opacity = 70); <br/> opacity: 0.5; <br/>}< br/>. modalpopup <br/>{< br/> background-color: # eafdff; <br/> border-width: 3px; <br/> border-style: solid; <br/> border-color: Gray; <br/> padding: 3px; <br/> width: 250px; <br/>}< br/>. confirmpanel <br/>{< br/> border: 2px solid # CCC; <br/> background-color: # FFF; <br/> padding: 15px; <br/> width: 230px; <br/> Height: 50px; </P> <p >}< br/> </style> </P> <p> </pead> <br/> <body> <br/> <form id = "form1" runat = "server"> <br/> <asp: scriptmanager runat = server id = "SCM"> </ASP: scriptmanager> <br/> <div> <br/> <asp: updatepanel id = "up1" runat = Server> <br/> <contenttemplate> <br/> <asp: modalpopupextender targetcontrolid = "hiddenfield1" backgroundcssclass = "modalbackground" popupcontrolid = "pn1" dropshadow = true id = "mpe1" runat = Server> </ASP: modalpopupextender> <br/> <asp: hiddenfield id = "hiddenfield1" runat = server/> <br/> <asp: panel id = "pn1" runat = server Height = "50px" width = "125px" cssclass = "confirmpanel" style = "display: none" mce_style = "display: none "> <br/> <asp: button id =" button2 "runat = server text =" OK "onclick =" button2_click "/> <br/> <asp: textbox id = "textbox1" runat = Server> </ASP: textbox> <br/> <asp: button id = "button3" runat = server text = "cancel"/> <br/> </ASP: Panel> <br/> <asp: gridview id = "gridview1" runat = "server" autogeneratecolumns = "false" <br/> performanceid = "sqlperformance1"> <br/> <columns> <br/> <asp: boundfield datafield = "id_car" headertext = "id_car" insertvisible = "false" <br/> readonly = "true" sortexpression = "id_car"/> <br/> <asp: boundfield datafield = "cartype" headertext = "cartype" <br/> sortexpression = "cartype"/> <br/> <asp: boundfield datafield = "carno" headertext = "carno" sortexpression = "carno"/> <br/> <asp: boundfield datafield = "seats" headertext = "seats" sortexpression = "seats"/> <br/> <asp: boundfield datafield = "state" headertext = "state" sortexpression = "state"/> <br/> <asp: boundfield datafield = "remark1" headertext = "remark1" <br/> sortexpression = "remark1"/> <br/> <asp: templatefield> <br/> <itemtemplate> <br/> <asp: button id = "button4" runat = server text = "edit" commandargument = '<% # eval ("id_car ") %> 'onclick = "button4_click"/> <br/> </itemtemplate> <br/> </ASP: templatefield> <br/> </columns> <br/> </ASP: gridview> <br/> </contenttemplate> <br/> </ASP: updatepanel> </P> <p> <asp: sqldatasource id = "sqldatasource1" runat = "server" <br/> connectionstring = "<% $ connectionstrings: connectionstring %> "<br/> selectcommand =" select * from [carmanage_carinf] "> </ASP: sqldatasource> </P> <p> </div> <br/> </form> <br/> </body> <br/> </ptml> <br/>
Background:
Public partial class submodule_carmanage_a: system. web. UI. page <br/>{< br/> protected void page_load (Object sender, eventargs E) <br/>{</P> <p >}</P> <p> protected void button4_click (Object sender, eventargs E) <br/>{< br/> int id = int. parse (sender as button ). commandargument); <br/> textbox1.text = ID. tostring (); <br/> mpe1.show (); <br/>}< br/> protected void button2_click (Object sender, eventargs E) <br/>{< br/> mpe1.hide (); <br/>}< br/>}