使用服务器名称访问网页时的UI问题。 [英] UI issue when accessing webpage using Server Name.

查看:108
本文介绍了使用服务器名称访问网页时的UI问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,



我在最近几天遇到了非常奇怪的问题。我使用VS2010在ASP.net上的网站上开发并将其托管在一个Window 2003服务器(IIS 6.0)上。

我的网站是简单的数据驱动应用程序,并在后台呈现基于数据的一些控件使用AJAX(没什么好看的)。



现在我的问题是,当我使用IP访问我的网站时(如http://xx.xxx.xx.xx/Mysite/default.aspx),它工作正常,并使用完美的UI和CSS渲染所有控件。

但是当我使用服务器名称(如http://SERVERNAME/Mysite/default.aspx)访问同一网站时,页面UI变形并且不能正确渲染控件。



我试图比较浴室中呈现的HTML但是找不到任何区别。我认为控制渲染机制可能有些不同所以我在代码中也进行了一些调整,但仍然没有运气。



有谁可以帮我提供一些导致排除这个?

解决方案

我给你一个我经常拿的小费。



1 .use firefox浏览器并下载firebug。你会发现问题出在哪里?

2.IE 7 +,按f12



我猜您的网址与您的资源不符。


大家好,





我发现解决方案。



将此添加到您的< head>将解决问题:



< meta http-equiv =X-UA-Compatiblecontent =IE = edge>< / meta>

Dear All,

I am encountering with very weird issue for Last few days. I’ve developed on Web Site in ASP.net using VS2010 and hosted it on one Window 2003 server (IIS 6.0).
My website is simple data driven application and renders some controls based the Data in background using AJAX (nothing fancy about it).

Now my issue is that when I access my website by using IP (like http://xx.xxx.xx.xx/Mysite/default.aspx), it works fine and render all the controls with perfect UI and CSS.
But when I access the same website using server name (like http://SERVERNAME/Mysite/default.aspx) then the page UI get distorted and doesn’t render the controls correctly.

I tried to compare the rendered HTML in bath cases but could not find any difference. I thought there might be some difference in control rendering mechanism so I did some tweaking in my code too, but still no luck.

Can anyone please help me to provide some lead to sort this out?

解决方案

I give you a tip that i usually take .

1.use firefox browser and download firebug .you will find where the problem is ?
2.IE 7+,press f12

I guess that your url don't match your resources .


Hi All,


I found the solution.

Adding this to your <head> will solve the issue:

<meta http-equiv="X-UA-Compatible" content="IE=edge"></meta>


这篇关于使用服务器名称访问网页时的UI问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆