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.

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

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" rel="nofollow noreferrer noopener" target="iframe1">My LInk</a>


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x