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?
Try this: add a
hiddeninput field (withrunat="server"attribute) and change its value to your IFrame’ssrcin the JavaScript. That way, you’ll be able to read the field’s value server-side.