Implement dialog effect in WebForm (ASP.NET)

zhaozj2021-02-16  73

Beginology ASP.NET, learn an example of analog dialog effect, there is a TextBox and a button on the main page, click the button to pop up a modal page, enter the text, click OK to return to the main page, and return it back Text value.

Very simple Dongdong, let everyone laugh

main page:

<%

@? Page? Language = "c #"?

%>

<

Script?

Runat

= "Server"

>

???????????????? {???????? {???????? {???????? {???????????? btnopen ??? .Attributes.Add ( "onclick", @ "var strReturn; strReturn = window.showModalDialog ( 'DialogForm.aspx', null, 'status: no; dialogWidth: 250px; dialogHeight: 125px; dialogHide: true; help: NO; Scroll: no '); if? (strreturn?! =? null)? Document.getlementByid (' txtvalue '). value = strreturn; "); ????}

Script> ?? ????

ASP: TextBox> ????

ASP: Button> ??

Form>

Body>

Dialog box page:

<%

@? Page? Language = "c #"?

%>

<

Script?

Runat

= "Server"

>

??????????? jt?? e) ???? {???????? f? (?! ispostback?) ?????? ??? {????????????? btnok.attributes.add ("onclick",? @ "window.ReturnValue? =? document.getElementByid ('txtValue'). value;? window. CLOSE (); "); ????????????? btncancel.attributes.add (" onclick ",? @" Window.close (); "); ???????? ?} ????}

Script> ?? ???? ASP: TEXTBOX> ????

ASP: Button> ????

ASP: Button> ??

Form>

Body>

转载请注明原文地址:https://www.9cbs.com/read-14583.html

New Post(0)