Home  >  Article  >  Web Front-end  >  Implementation of JavaScript pop-up form clicking button to return selected data_javascript skills

Implementation of JavaScript pop-up form clicking button to return selected data_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:30:501072browse
First is the code of the parent page:
Copy the code The code is as follows:


Untitled page
<%-- --%> ;






< ;/div>






About adding The one above (new Data()) is to avoid the problem of automatic caching of the showModalDialog page, which will cause the data to not be refreshed when the page is opened for the second time. This is because if the URL of the showModalDialog page is the same every time, it will automatically display the previously cached page. the data inside.
Then there is the code of the sub-page Default3.aspx:
Copy the code The code is as follows:


Untitled page




















Default3.aspx contains a gridview control. After data binding (bind it yourself, the code will not be posted), you can select the data you need.
Default3.aspx.cs:
[code]
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton b = (LinkButton)e.Row.FindControl("lnkSelect2");
b.Attributes.Add("OnClick", "javascript:getSelected('" e.Row.Cells[1] .Text "');");
}
}
[html]
The and
are used to prevent the third form from popping up after clicking the select button on the subpage.
This is the example. You still have to experience and improve it according to your own needs.
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn