在http请求之前制作真正的闪屏
我需要制作一个 C# 启动屏幕,该屏幕将在调用 default.aspx 之前启动。
当我浏览我的 URL 时,我可以看到 IE 8.0 消息 waiting for http://xxxxx
并出现空白屏幕,并且在一段时间内我的第一页已完全加载。我如何处理\拦截该消息,以便在建立连接之前显示我的启动屏幕?
我尝试过使用 HttpListener 但它似乎不是正确的方法。
I need to make a C# splash screen that will be started before default.aspx is called.
When I browse to my URL, I can see the IE 8.0 message waiting for http://xxxxx
with a blank screen, and in some time my first page is fully loaded. How can I handle\intercept that message, in order to show my splash screen until the connection is established?
I've tried using HttpListener but it doesn't seem to be the right way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在浏览器联系您的网站之前,您无法显示网站的某些内容。
您可以做的是在网站的根目录下创建一个轻量级的起始页面(加载速度很快),然后重定向到一个较重的“真实”页面。
You can't show something of your site before the browser contacts your site.
What you can do is have a lightweight start page (that loads quickly) at the root of your site and then redirect to a heavier "real" page.
您可以关闭输出缓冲来执行您要求的操作,但“等待代码”上的内容不得使用正在加载的任何其他资源。沟通也会变得更加健谈。
aspx-页面:
隐藏代码:
You can turn output buffering off to do something like you ask but the content on the "waiting code" must not be using any of the other resources being loaded. The communication will also become more chatty.
aspx-page:
Code behind: