简体   繁体   中英

How to pass querystring value into iframe src

I have a normal link button where I am getting data through like this

<a href="ViewRemarks.aspx?jobid=<%#DataBinder.Eval(Container.DataItem,"jobid") 
%>" id="btn_remarks" data-toggle="modal" data-target="#exampleModalCenter3" 
class="open-AddBookDialog btn btn-outline-info " ><i class="fa fa-comments" ></i>
</a>

Note: in this button, I am getting data called job id

Then I took one bootstrap modal inside that modal I kept one child page like this

<iframe style="width: 470px; height: 195px;" id="Iframe1" class="embed-responsive embed-responsive-16by9" src="ViewRemarks.aspx?jobid=null"></iframe>

Note: iframe is not showing in stackoverflow don't know why but yes that is an iframe so i kept one a before iframe.

But here I want to pass that particular jobid from that button inside the data table how can I solve this in asp.net or javascript anything is accepted please help.

So use the link target which will load the link in the iframe.

<iframe name="iframe1" id="iframe1" />

and the link

<a href="//example.com?foo=bar" target="iframe1">My LInk</a>

 <iframe name="iframe1" id="iframe1"></iframe> <a href="//example.com?foo=bar" target="iframe1">My LInk</a>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM