Strange _ dopostback window. showmodaldialog

Source: Internet
Author: User

I solved the problem by entering data in the pop-up window. After saving, the upper parent window can be refreshed. I wrote JavaScript on the ASP page.CodePut the <SCRIPT>
Function showitem ()
{
Window. showmodaldialog ('a2. aspx ', null, 'dialogwidth: 600px; dialogheight: 500px; dialogleft: 300px; dialogtop: 400px; resizable: Yes; Status: no ');

_ Dopostback ('refresh ','')
Return true;

}
</SCRIPT>
Refresh is a linkbutton. Click to execute a databind ()

There is no problem with the code. I have read many examples, many of which are written in this way. But _ dopostback ('refresh', '') is not executed. It is really strange. I have no time to study why ??

Later I saw an example,
Transfer arguments between modal page and invoker page in Asp.net 1.1
Http://www.codeproject.com/useritems/modalpageinaspnet.asp
It is to place this javscript on the server side code and register it through registerstartupscript.
Place the following code in the parent window Click Event
Protected void add_click (Object sender, eventargs E)
{
String strscript = "<SCRIPT> \ n" +
"Var strreturn = Window. showmodaldialog ('a2. aspx ', 'desc', 'dialogwidth: 423px; dialogheight = 355px'); \ n" +
"_ Dopostback ('refresh', strreturn);" +
"</SCRIPT> ";
If (! This. isclientscriptblockregistered ("opendialogscript "))
This. registerstartupscript ("opendialog", strscript );

}

We found that _ dopostback ('refresh', '') can be executed.

I don't know why. I just need to use it and I don't have time to study it. If you have any experts, please advise.

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.