Modal popup dialog window in ASP. Net transfers multiple parameters

Source: Internet
Author: User
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

Related Article

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.