从 Microsoft Dynamics AX 中的 WebPart 控制 HTML
我有一个在 Microsoft SharePoint 中运行的网站,该网站使用 Dynamics AX 4.0 中的菜单和其他数据。我在网站中有一个 weblet,可以从 Dynamics AX 获取菜单,该菜单使用 WebMenuWebLet 和 WebVertMenuHTML 类生成要在页面上显示的 HTML。我现在尝试从 weblet 中剥离所有内容,从头开始重建它以适合我的设计,但它仍然输出一些数据。
我在此页面上读到 Dynamics AX 中的 WebPart总是输出一些样板 HTML,而我得到的确实是这个博客中的 HTML 片段。然而,我也得到了更多的 HTML 代码:
<link rel="stylesheet" type="text/css" href="/_layouts/ep/stylesheets/AXEP.css">
这个样式表有很多定义,有些与我自己的定义相冲突,所以我想删除它的链接。删除 AXEP.css 的内容不是一个选项,因为我正在重建一个实时网站,其中旧部分仍在使用该数据,并且我必须在与实时站点使用的同一台 Dynamics AX 服务器上工作。
我可以想象删除 是很困难的。我链接到的博客中提到的标签,但我希望有某种方法可以删除样式表的链接。我已经搜索了 Dynamics AX 中的所有类定义,但没有找到任何对我有帮助的内容,那么我还应该查看其他地方吗?
如果信息含糊,我很抱歉,当谈到这些 Microsoft 解决方案时,我有点迷失了。
I have a website running in Microsoft SharePoint which uses menus and other data from Dynamics AX 4.0. I have a weblet in the website where I fetch a menu from Dynamics AX, which uses the WebMenuWebLet and WebVertMenuHTML classes to generate the HTML to be displayed on the page. I have now tried to strip everything from the weblet to reconstruct it from scratch to fit my design, but it still outputs some data.
I read on this page that the WebParts in Dynamics AX always output some boilerplate HTML, and what I am getting is indeed the HTML snippet in this blog. However, I also get more HTML code:
<link rel="stylesheet" type="text/css" href="/_layouts/ep/stylesheets/AXEP.css">
This stylesheet has a lot of definitions, some conflicting with my own, so I'd like to get rid of the link to it. Deleting the contents of AXEP.css is not an option, as I am reconstructing a live website where the old part is still using that data, and I have to work on the same Dynamics AX server as is being used for the live site.
I can imagine it being difficult to remove the <table> tag mentioned in the blog I linked to, but I am hoping that there is some way for me to remove the link to the stylesheet. I have searched through all the class definitions in Dynamics AX, but found nothing that helped me, so is there any other place I should look?
I'm sorry if the information is vague, I'm kinda lost when it comes to those Microsoft solutions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看 Sharepoint,因为 AX 似乎没有发出此代码。
您很可能应该创建一个新的企业门户样式表,然后创建< a href="http://msdn.microsoft.com/en-us/library/aa867986.aspx" rel="nofollow">新的 Sharepoint 主题。
Look in Sharepoint, since AX does not seem to emit this code.
You should most likely create a new Enterprise Portal style sheet and then create a new Sharepoint theme.
自从提问以来已经很长时间了,我想结束这个问题,所以这就是我所做的:
我注意到仅插入了指向额外 CSS 的
标签在页面上的第一个 WebPart 中。我没有删除它,而是在页面顶部添加了一个额外的 WebPart,它除了输出此样板
标记(以及一些
> 标签,我也不想要)并将其包装在 HTML 注释中:
。现在它仍然插入到页面中,但浏览器会忽略它,因此 CSS 不会影响页面的布局。
这是一个丑陋的黑客,但这是我当时能想到的最好的办法。
It's been a long time since a asked and I'd like to close the question, so here is what I did:
I noticed that the
<link>
tag that points to the extra CSS is only inserted in the first WebPart on the page. Instead of getting rid of it I added an extra WebPart to the top of the page that did nothing but output this boilerplate<link>
tag (along with some<script>
tags that I didn't want either) and wrapped it inside an HTML comment:<!-- -->
. It is still inserted into the page now, but the browser ignores it so the CSS doesn't affect the layout of the page.It is an ugly hack, but it was the best I could come up with at the time.