0
asp.net 웹 form.In 관리 패널에 HTML 편집기를 추가하는 데 몇 가지 문제점이 있습니다. 멋진 사용자 인터페이스를 만들기 위해 텍스트 영역에 HTML 편집기를 추가하고 싶습니다. 나는 .aspx 있습니다. 같은 :ASP.NET HTML 편집기
<%@ Page Title="" Language="C#" MasterPageFile="~/admin/IncubatorAdmin.master"
AutoEventWireup="true" CodeFile="AddFAQ.aspx.cs" Inherits="admin_AddFAQ" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<section id="main" class="column">
<article class="module width_full">
<header><h3>Post FAQ </h3></header>
<div class="module_content">
<fieldset style="width: 60%; float: left; margin-right: 3%;">
<label>Content</label>
<asp:TextBox ID="txtContent" TextMode="MultiLine" Columns="50" Rows="20" runat="server"/>
</fieldset>
<asp:Label ID="ResultLabel" runat="server" Text=""></asp:Label>
<div class="clear"></div>
</div>
<footer>
<div class="submit_link">
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click"
Text="Publish FAQ" class="alt_btn" />
</div>
</footer>
</article><!-- end of post new article -->
</section>
및 C# 코드 :
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
public partial class admin_AddFAQ : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
return;
String cs = ConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString;
using (MySqlConnection cn = new MySqlConnection(cs))
{
MySqlCommand command = new MySqlCommand(StoredProcedures.select_faq, cn);
command.CommandType = CommandType.StoredProcedure;
int fid = 1;
command.Parameters.AddWithValue("fid", fid);
command.Parameters["fid"].Direction = ParameterDirection.Input;
cn.Open();
MySqlDataReader reader = command.ExecuteReader();
while (reader.Read())
{
txtContent.Text = (String)reader[1];
}
reader.Close();
cn.Close();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
String cs = ConfigurationManager.ConnectionStrings["myConnectionString"].ConnectionString;
using (MySqlConnection cn = new MySqlConnection(cs))
{
MySqlCommand command = new MySqlCommand(StoredProcedures.update_faq, cn);
command.CommandType = CommandType.StoredProcedure;
int fid = 1;
command.Parameters.AddWithValue("fid", fid);
command.Parameters["fid"].Direction = ParameterDirection.Input;
command.Parameters.AddWithValue("fcontent", txtContent.Text);
command.Parameters["fcontent"].Direction = ParameterDirection.Input;
cn.Open();
if (command.ExecuteNonQuery() > 0)
{
ResultLabel.Text = "";
ResultLabel.Text = "FAQ page successfully updated";
}
cn.Close();
}
}
} 어떻게해야합니까 변경
.ASPX, C# 및 Web.config의에? http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/HtmlEditorExtender/HTMLEditorExtender.aspx
어, 무슨 문제가있는 시도 – JimMSDN
음, textarea의 내용에 html 편집기를 추가하는 방법과 web.config 파일에서 수행 할 변경 사항을 모르겠습니다. – developer