I have a problem with IFrame

hai

I have an iFrame to display dynamic pages on my page.

<iframe id="divIFrame" scrolling="no" runat ="server" src="Login.aspx" frameborder="0" style="width: 575px; height:323px; padding:0px;z-index:0px;" > </iframe> 

In the code behind, I used one line code to add the 'src' attribute to the iframe.

  divIFrame.Attributes("src") = "..\Pages\Company.aspx" 

it works in IE aand crome but not in Mozilla firefox.It shows an error like this

 Server Error in '/' Application. HTTP Error 400 - Bad Request. Version Information: ASP.NET Development Server 9.0.0.0 

Please, help.

+2
source share
1 answer

You need to use a slash, not a backslash \ in your URL.

  divIFrame.Attributes("src") = "../Pages/Company.aspx" 

Internet Explorer calmly converts slashes for you, masking the problem. Firefox doesn't do it right.

+3
source

Source: https://habr.com/ru/post/1302971/


All Articles