Click here to Skip to main content
15,887,957 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an iframe in my aspx page.

In the iframe attribute when I give src="abc.aspx?Id=10" the page shows the correct values.

How can I pass the id dynamically to the iframe?
Posted
Updated 9-Nov-10 21:31pm
v2
Comments
Dalek Dave 10-Nov-10 3:31am    
Edited for Grammar and Readability.

Hi you can use following function to pass parameter as a Page name with parameter

C#
//Set IFrame page URL
function loadPage(iframeName, sTargetPage) {
    var frmPage = getElement(iframeName);
    frmPage.src = sTargetPage;
}

Example:-
C#
loadPage('ifrmLeft', 'Dashboard/DashboardDetail.aspx?MenuId=530');


Please do let me know, if you have any doubt.
Please provide "Vote":thumbsup: if this would be helpful, and make "Accept Answer" if this would be correct answer.:rose:

Thanks,
Imdadhusen
 
Share this answer
 
Comments
Dalek Dave 10-Nov-10 3:32am    
Good Answer.
am.net 10-Nov-10 3:39am    
Hi, thanks for reply.
In this function i will set the src of the frame... fine!!!
but my problem is, How to read the elemment of the page(src, which set in frame).
Sunasara Imdadhusen 10-Nov-10 5:01am    
Do you want to access element from IFrame in parent page?
Siddhant Naik 11-Apr-16 4:43am    
Nice answer..
Tahnx..
In i frames source page you can simply read element of page by using querystring.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900