This sample creates Parent and Child webforms. the child webform is called modally by the parent passing multiple values to the child form. the child form displays the passed values allowing them to be edited and then returns the altered values back to the parent when finished. the child form is modal to only the parent form. to make the child modal to the entire desktop, see the below final note.
Scope: Asp, ASP. NET, C #, CSHARP, VB. NET, Visual Basic, Java
1.Open a new web project in Visual Studio
2. Create two new webform pages named parentwebform and childwebform
3. Open the HTML surface for the parentwebform
4.Locate the Yellow Line
5.Delete all codeExceptTheYellow Line
6.Insert the following HTML below the existing Yellow Line
parent webform
// Alter below line-supply correct URL for child formvar myargs = Window. showmodaldialog ("http: // localhost/modalwin/childwebform. aspx ", myargs, winsettings); If (myargs = NULL) {window. alert ("Nothing returned from child. no changes made to input boxes ")} else {retvala. value = myargs [0]. tostring (); retvalb. value = myargs [1]. tostring (); retvalc. value = myargs [2]. tostring ();}} </SCRIPT>
|
7.In the above Code, locate the line saying // alter below line
8.Supply the correct URL for your child webform
9. open the HTML surface for the childwebform
10. locate the Yellow Line
11. delete all Code blocks T the yellow line
12. Insert the following HTML below the existing yellow line
child webform param: param B: param C: OK
|
13.Set the project startup page to be the parent webform
14.Run the project.
Final note:To make the child modal to the entire desktop, you'll need Add code to the child which uses <body onblur = "This. Focus">.
Frederick volking
Frederick volking