如何在C#Web应用程序中以格式显示标签中的Word文件 [英] how to display word file in label with format in C# web applications

查看:72
本文介绍了如何在C#Web应用程序中以格式显示标签中的Word文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

hi
我们在标签中显示Word文档,但显示时没有换行符或格式不正确.
我想以文本格式的标签显示单词文件,即逐行格式

hi
we are displaying word document in label ,but it is displaying like without line break or not in format.
I want to display word file in label with text format i.e line by line format

推荐答案

标签不了解文本格式,因此您无法显示单词文件在文字中.
您可以使用Word互操作在代码中嵌入Word文档.
A label does not understand text formatting and as a result you cannot display a word file in text.
You can use the Word inter-op to embed a word doc in your code.


好吧,因为据说标签控件不是在Web应用程序上显示Word文档文件的正确控件. .因此,要在Web应用程序上查看或编辑Word文档,您可能必须使用编辑器"控件.您可以尝试 RTE(Rich Text Editor)ASP.NET Control [用于ASP.NET AJAX的RadEditor [
Well, as it has been said label control is not the right control to display word document file on web application. So to view or edit word document over on web application,you may have to use Editor control. You can try RTE (Rich Text Editor) ASP.NET Control[^], else you have to go with commercial once,RadEditor for ASP.NET AJAX[^]

I hope this helps you well.


奇怪的想法是使用Label控件并松开所有格式.考虑RichTextBox;您可以根据需要将其设置为只读.


我没有注意到问题是Web应用程序,其中RichTextBox不可用. Word文件可以转换为(几乎)等效的HTML代码.在大多数情况下,可以(几乎)进行足够的翻译而不会损失格式.如果不需要Word格式,则使用Word是没有意义的.

—SA
Strange idea to use Label control and loose all formatting. Consider RichTextBox; you can make it read-only if you want.


I did not noticed the question is Web application, where RichTextBox is not available. A Word file could be translated into (almost) equivalent HTML code. In most cases, adequate translation is possible (almost) without losses in formatting. If Word formatting is not needed, using Word is pointless.

—SA


这篇关于如何在C#Web应用程序中以格式显示标签中的Word文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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