user1010385
user1010385

Reputation: 13

change source iframe ASP.net

How i can Refresh Iframe in ASP.NET, i need every time change source in iframe Page load work see example:

document.getElementById('frame1').setAttribute('src', 'Questionair.aspx');

every time i need go to 'Questionair.aspx' page and execute page load, in my code this source change and page load execute one time thank you

Upvotes: 0

Views: 1779

Answers (1)

Waqas
Waqas

Reputation: 6802

You can reload the source of IFrame by first setting the 'src' attribute and then calling location.reload method:

document.getElementById('frame1').setAttribute('src', 'Questionair.aspx');
document.getElementById('frame1').contentWindow.location.reload(true);

Upvotes: 1

Related Questions