如何从文本框动态编辑我的.aspx页面的一部分 [英] How to edit a section of my .aspx page dynamically from a textbox

查看:55
本文介绍了如何从文本框动态编辑我的.aspx页面的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我正在使用与博客文章有关的CMS。

我总是为新博客帖子创建一个新页面,以便它可以通过SEO获取并且也很容易参考。



<! - 文章部分 - > 

文章内容来自这里

<! - 文章结束 - >





一切正常,但我如何根据文章区域进行编辑。

我想在<! - Article Section - >上加载内容。进入文本框并将更改写入页面。

我被困在这里...请分享一些想法。谢谢

解决方案

使用asp.net的RichTextBoxEditor


使用TextEditor控件将页面内容编辑为Html,然后将其保存到页面并使用文字控件将其替换为.aspx页面。



<! -  .aspx- - > 
<! - 文章部分 - >
< asp:literal id = ltHTMLBody runat = server xmlns:asp = #unknown > < / asp:literal >
<! - 文章结束 - >
<! - .cs - >
ltHTMLBody.Text = 编辑后的html内容;



参考



https://msdn.microsoft.com/en-us/library/system.web.ui.literalcontrol(v = VS。 110).aspx [ ^ ]

http://stackoverflow.com/questions/5508666/dynamically-add-html-to-asp-net-page [ ^ ]

以编程方式将HTML页面内容添加到ASPX页面 [ ^ ]

Hi guys, am working on a CMS which has to do with blog posts.
I always create a new page for a new blog post so that it can be fetched by SEO and also easy reference.

<!-- Article Section -->

ARTICLE CONTENTS COMES IN HERE
 
<!-- Article End -->



Everything is working fine but how do i edit based on the article area.
I want to load the contents on the <!-- Article Section --> into a textbox and write changes to the page.
Am stuck here... pls share some ideas. Thanks

解决方案

Use RichTextBoxEditor of asp.net


Use a TextEditor control to edit the content of the page as Html, then Save it to a page and replace it to the .aspx page using the literal control.

<!-- .aspx-->
<!-- Article Section -->
<asp:literal id="ltHTMLBody" runat="server" xmlns:asp="#unknown"></asp:literal>  
<!-- Article End -->
<!-- .cs -->
ltHTMLBody.Text = "Your html content after edit";  


Ref.

https://msdn.microsoft.com/en-us/library/system.web.ui.literalcontrol(v=vs.110).aspx[^]
http://stackoverflow.com/questions/5508666/dynamically-add-html-to-asp-net-page[^]
Add HTML Page Contents to ASPX Page Programmatically[^]


这篇关于如何从文本框动态编辑我的.aspx页面的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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