tags:

views:

339

answers:

1

Using

string iframeSrcPage = iframeMain.Attributes["src"];

to get iframe source, always returns the value which set in aspx page itself,
even that value is changed using javascript code,

iframeObject.src = pageURL;

So, how to get an IFrame src attribute value from ASP.Net code behind?

A: 

Try this: ass a hidden input field (with runat="server" attribute) and change it's value to your IFrame's src in the JavaScript. That way, you'll be able to read the field's value server-side.

Traveling Tech Guy
Is there anyway to retrieve it directly using iFrame attribute itself?
Ahmed
Not if you change it on the client-side without perpetuating the value in a server-side control. Did you try my suggestion and it didn't work?
Traveling Tech Guy
No, your suggestion works properly but I wonder if I could retrieve it directly using iFrame attribute?
Ahmed