Home > Web Front-end > JS Tutorial > 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
Release: 2016-05-16 18:30:50
Original
1091 people have browsed it
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
in Default3.aspx "/> 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.
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template