为RUNAT ="服务器"要求具有由ASP.NET构建CSS样式HTML标签?

编程入门 行业动态 更新时间:2024-10-25 03:24:29
本文介绍了为RUNAT ="服务器"要求具有由ASP.NET构建CSS样式HTML标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我得到这个div标签谁在使用一些像这样的方法在CSS背景图片的被设置。

I got this div tag who's background image's being set in the CSS using some method like this..

内联CSS: -

.id0, .mySprite:hover div { background-image: url(<%=GetImage()%>); background-repeat: no-repeat; width: 728px; height: 243px; }

HTML: -

HTML:-

<div class="id0"></div>

现在,我需要重新设置 =服务器在这个div标签或不?怎么把它不给任何错误,但不知道可能是我需要怎么把图片的路径的是从code牵强的背后...图像不是在this用户控件。

Now do I need to set runat="server" in this div tag or not? Coz it's not giving no error but was wondering may be I need to coz the image's path's being fetched from code behind...the image's not appearing in this user control.

推荐答案

好了,

  • 是不需要的的Runat =服务器的说法。 CSS的加载/反正在客户端上有关(在brwoser)。
  • 对不起,哥们,但.css文件不被ASP.NET评估 - 所以基本上,在URL,浏览器得到的是&LT;%=的getImage()%GT; ,这显然浏览器不能做任何事情。
  • The "Runat=Server" is not needed at all. The CSS is loaded/associated on the client (in the brwoser) anyway.
  • Sorry, dude, but .CSS files are not evaluated by ASP.NET - so basically, the "url" that the browser gets is <%=GetImage()%>, which obviously the browser can not do anything with.

结果:不工作。的可以的无法工作。

Result: Does not work. Can not work.

更多推荐

为RUNAT =&QUOT;服务器&QUOT;要求具有由ASP.NET构建CSS样式HTML标签?

本文发布于:2023-06-08 03:54:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/576151.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:样式   标签   服务器   QUOT   RUNAT

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!