开发者

I have a problem with IFrame

开发者 https://www.devze.com 2022-12-21 15:34 出处:网络
hai , I have an iFrame for display dynamic pages in my page. <iframe id=\"divIFrame\" scrolling=\"no\" runat =\"server\"src=\"Login.aspx\"frameborder=\"0\"

hai ,

I have an iFrame for display dynamic pages in 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 'src' attribute to the iframe.

 divIFrame.Attributes(开发者_JS百科"src") = "..\Pages\Company.aspx"

it's works in IE aand crome but Not in Mozila 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.


You need to use forward slash / and not backslash \ in your URL.

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

Internet Explorer is quietly converting the slashes for you, masking a problem. Firefox correctly doesn't.

0

精彩评论

暂无评论...
验证码 换一张
取 消