Click here to Skip to main content
14,425,979 members
   

ASP.NET

 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder12-Jul-09 23:39
cofounderChris Maunder12-Jul-09 23:39 
PinnedHow to get an answer to your question Pin
Chris Maunder10-Nov-05 17:29
cofounderChris Maunder10-Nov-05 17:29 
QuestionMessage Closed Pin
21-Jan-20 18:29
MemberMember 245846721-Jan-20 18:29 
QuestionMessage Closed Pin
20-Jan-20 22:35
Memberbarxstop920-Jan-20 22:35 
QuestionHow to use FCKeditorV2 instead of FreeTextBox ? Pin
Member 245846714-Jan-20 21:41
MemberMember 245846714-Jan-20 21:41 
I want to use FCKeditorV2 (Figure 2) http://www.mediafire.com/view/pdmvi0aezyqpil5/website2010_10b.jpg/file
instead of FreeTextBox (Figure 1) http://www.mediafire.com/view/oahtm7k3883elow/website2010_10a.jpg/file

The code I have edited
In file ArticleAddEdit.aspx 
line 5: 
original

H311457671H

edit

H1922776762H

 line 79:
 original: 
<FTB:FreeTextBox id="txtBody"
TabIndex="3"
toolbarlayout="FontFacesMenu,FontSizesMenu,FontForeColorsMenu,FontForeColorPicker,FontBackColorsMenu,FontBackColorPicker|Bold,Italic,Underline,Strikethrough,RemoveFormat|JustifyLeft,JustifyRight,JustifyCenter,JustifyFull;BulletedList,NumberedList,Indent,Outdent;CreateLink,Unlink|InsertTable,EditTable,InsertImageFromGallery"
runat="Server"
Width="585px" Height="200px"
/>

edit:
 <FCKeditorV2:FCKeditor id="txtBody" ToolbarSet="MyToolbar" Width="600" Height="300" BasePath="~/FCKeditor/" runat="server" />

But when I change the code the following error message: http://www.mediafire.com/view/zpze8g7k7o3wm4a/website2010_10c.jpg/file

Line 40: txtTitle.Text = obj.Title;
Line 41: txtExcerpt.Text = obj.Excerpt;
Line 42: txtBody.Text = obj.Body;
Line 43: if (obj.Priority == 1)
Line 44: chkPriority.Checked = true;

For the original code
In file In file ArticleAddEdit.aspx

H725001498H

<asp:Content ID="Content1" ContentPlaceHolderID="PageContent" Runat="Server">

<uc:Title runat="server" ResourceKey='' Text='cập nhật bài việt' />

<table width="595" border="0" align="center" cellpadding="0" cellspacing="0">
<tr style="padding-top:5pt;">
<td colspan="2" align="center">
<asp:Label runat="server" ID="lblMsg" Font-Bold="true" ForeColor="blue"></asp:Label>
</td>
</tr>
<tr>
<td width="75%" >
<asp:ValidationSummary runat="server" ID="valChangePasswordSummary" ShowMessageBox="true" ShowSummary="false" />
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><%=ResourceManager.GetString("ArticleCategory") %>:</td>
</tr>
<tr>
<td style="padding-top:3pt;">
<webapp4U:ddlArticleCategory ID="dlArticleCategory" runat="server" CssClass="Textbox" />
<asp:RangeValidator runat="server" ControlToValidate="dlArticleCategory" ID="rvl1"
Type="Integer" MinimumValue="2" MaximumValue="1000" Display="dynamic"
ErrorMessage="Category not null" />
</td>
</tr>
<tr>
<td style="padding-top:10pt;"><%=ResourceManager.GetString("Title") %>:</td>
</tr>
<tr>
<td style="padding-top:3pt;">
<asp:TextBox ID="txtTitle" TabIndex="1" Font-Bold="true" runat="server" Width="380" MaxLength="500"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtTitle" runat="server" ErrorMessage="Title not null" Display="None" />
</td>
</tr>
<tr>
<td style="padding-top:10pt;"><%=ResourceManager.GetString("Article_Trichdan") %>:</td>
</tr>
<tr style="padding-top:3pt;">
<td>
<asp:TextBox ID="txtExcerpt" TabIndex="2" TextMode="MultiLine" Rows="5" runat="server" Width="380" MaxLength="3000"></asp:TextBox>
</td>
</tr>
</table>
</td>
<td valign="top" width="90" style="padding-top:20pt;">
<table border="0" cellpadding="0" width="90" >
<tr>
<td style="padding-top:5pt;" height="90" width="100%" valign="top" align="center">
<img name="ImageItem" id="ImageItem" runat="server" border="1" src="~/WebMaster/Images/Picture.jpg" width="80"/>
<input type="hidden" runat="server" id="HiddenImageName" name="HiddenImageName" value="" />
<input type="hidden" runat="server" id="HiddenImageWidth" name="HiddenImageWidth" value="-1" />
<input type="hidden" runat="server" id="HiddenImageHeight" name="HiddenImageHeight" value="-1" />
</td>
</tr>
<tr>
<td>
<input type="button" class="btupload" value=" Upload Picture" onclick='window.open("UploadFile.aspx?ActUpload=article","khunghinh","width=420,height=200,menubar=no,scrollbars=yes")' />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td><br /></td>
</tr>
<tr style="padding-top:8pt; padding-bottom:3pt;">
<td colspan="2" ><%=ResourceManager.GetString("Article_Body") %> :</td>
</tr>
<tr>
<td colspan="2" style="font-size:0.7em">
<FTB:FreeTextBox id="txtBody"
TabIndex="3"
toolbarlayout="FontFacesMenu,FontSizesMenu,FontForeColorsMenu,FontForeColorPicker,FontBackColorsMenu,FontBackColorPicker|Bold,Italic,Underline,Strikethrough,RemoveFormat|JustifyLeft,JustifyRight,JustifyCenter,JustifyFull;BulletedList,NumberedList,Indent,Outdent;CreateLink,Unlink|InsertTable,EditTable,InsertImageFromGallery"
runat="Server"
Width="585px" Height="200px"
/>
</td>
</tr>
<tr>
<td colspan="2" align="right" style="padding-top:7pt; padding-right:3pt; padding-bottom:20pt;">
<asp:CheckBox runat="server" ID="chkPriority" Text="" TextAlign=Left />
Tin nổi bật(Hiển thị trên cùng)
<asp:Button runat="server" TabIndex="4" ID="btSave" OnClick="btSave_Click" Text=" Save " CssClass="textbox" />
</td>
</tr>
</table>

<br /><br /><br /><br />

</asp:Content>

In file In file ArticleAddEdit.aspx.cs

namespace webapp4U.UI
{
public partial class ArticleAddEdit : System.Web.UI.Page
{
private int ArticleID = -1;
private int CateID = -1;

protected void Page_Load(object sender, EventArgs e)
{
// lay ArticleID khi chinh sua
ArticleID = Globals.GetIntFromQueryString("ArticleID");
CateID = Globals.GetIntFromQueryString("CateID");
if (Request.QueryString["Action"] == "Edit")
{
btSave.CommandArgument = "Edit";
btSave.Text = " Update ";

if (!IsPostBack)
{
Load_GetItemByArticleID(ArticleID);
}
}
}

protected void Load_GetItemByArticleID(int ArticleID)
{
webapp4U.BOL.Article obj = webapp4U.BOL.Article.GetArticleByArticleID(ArticleID);
txtTitle.Text = obj.Title;
txtExcerpt.Text = obj.Excerpt;
txtBody.Text = obj.Body;
if (obj.Priority == 1)
chkPriority.Checked = true;

if(obj.ImageURL.Length>3)
ImageItem.Src = Globals.ApplicationPath + "/UserUpload/Articles/" + obj.ImageURL;

if (obj.ImageWidth > obj.ImageHeight)
ImageItem.Width = 80;
else
ImageItem.Height = 80;

dlArticleCategory.SelectedValue = obj.ArticleCateID.ToString();

HiddenImageName.Value = obj.ImageURL;
HiddenImageWidth.Value = obj.ImageWidth.ToString();
HiddenImageHeight.Value = obj.ImageHeight.ToString();
}

protected void btSave_Click(object sender, EventArgs e)
{
webapp4U.BOL.Article obj = new webapp4U.BOL.Article();
obj.ArticleID = ArticleID;
obj.Title = txtTitle.Text.Trim();
obj.Excerpt = txtExcerpt.Text.Trim().Replace(Environment.NewLine, "<br>");
obj.Body = txtBody.Text;
obj.PostDate = DateTime.Now;
obj.Priority = 0;
if (chkPriority.Checked)
obj.Priority = 1;
obj.ImageURL = HiddenImageName.Value.Trim();
obj.ImageWidth = Convert.ToInt32(HiddenImageWidth.Value.Trim());
obj.ImageHeight = Convert.ToInt32(HiddenImageHeight.Value.Trim());
obj.Authors = " ";
obj.ArticleCateID = Globals.ConvertToInt32(dlArticleCategory.SelectedItem.Value);

if (btSave.CommandArgument == "Edit")
{
obj.TotalViews = 0;
webapp4U.BOL.Article.Update(obj);
//Response.Redirect("ArticleDetail.aspx?ArticleID=" + ArticleID);
}
else
{
webapp4U.BOL.Article.Insert(obj);

//txtBody.Text = "";
//txtTitle.Text = "";
//txtExcerpt.Text = "";
}

Response.Redirect("Default.aspx?CateID=" + CateID);
lblMsg.Text = "Cập nhật thông tin thành công!";

}
}
}

or see the attached file: http://www.mediafire.com/file/pzydjnj8zp7jd41/website2010_10.rar/file
Reference links
https://expressmagazine.net/development/1558/huong-dan-dua-fck-editor-vao-web-aspnet
https://docs-old.ckeditor.com/FCKeditor_2.x/Developers_Guide/Integration/ASP.NET

modified 15-Jan-20 2:54am.

SuggestionRe: How to use FCKeditorV2 instead of FreeTextBox ? Pin
Richard Deeming15-Jan-20 1:51
communityengineerRichard Deeming15-Jan-20 1:51 
GeneralRe: How to use FCKeditorV2 instead of FreeTextBox ? Pin
jkirkerx15-Jan-20 11:24
professionaljkirkerx15-Jan-20 11:24 
GeneralRe: How to use FCKeditorV2 instead of FreeTextBox ? Pin
Member 245846715-Jan-20 16:17
MemberMember 245846715-Jan-20 16:17 
GeneralRe: How to use FCKeditorV2 instead of FreeTextBox ? Pin
jkirkerx16-Jan-20 8:26
professionaljkirkerx16-Jan-20 8:26 
GeneralRe: How to use FCKeditorV2 instead of FreeTextBox ? Pin
Member 245846716-Jan-20 22:04
MemberMember 245846716-Jan-20 22:04 
GeneralRe: How to use FCKeditorV2 instead of FreeTextBox ? Pin
jkirkerx17-Jan-20 7:55
professionaljkirkerx17-Jan-20 7:55 
GeneralRe: How to use FCKeditorV2 instead of FreeTextBox ? Pin
Richard Deeming16-Jan-20 2:33
communityengineerRichard Deeming16-Jan-20 2:33 
JokeRe: How to use FCKeditorV2 instead of FreeTextBox ? Pin
ZurdoDev16-Jan-20 4:55
mveZurdoDev16-Jan-20 4:55 
GeneralRe: How to use FCKeditorV2 instead of FreeTextBox ? Pin
jkirkerx16-Jan-20 8:34
professionaljkirkerx16-Jan-20 8:34 
Question.Net Core 2.2.4 - Getting IHostingEnvironment in Program.cs Main Pin
jkirkerx14-Jan-20 11:24
professionaljkirkerx14-Jan-20 11:24 
QuestionHtmlagilitypack -- I'm stuck Pin
Member 175325011-Jan-20 6:40
MemberMember 175325011-Jan-20 6:40 
QuestionHow do I fix System.Net.Mail.SmtException: 'Cannot get IIS pickup directory' error? Pin
Member 1140330410-Jan-20 10:19
MemberMember 1140330410-Jan-20 10:19 
AnswerRe: How do I fix System.Net.Mail.SmtException: 'Cannot get IIS pickup directory' error? Pin
Richard MacCutchan10-Jan-20 12:37
communityengineerRichard MacCutchan10-Jan-20 12:37 
AnswerRe: How do I fix System.Net.Mail.SmtException: 'Cannot get IIS pickup directory' error? Pin
ZurdoDev11-Jan-20 10:03
mveZurdoDev11-Jan-20 10:03 
QuestionHow do I fix 'object' does not contain a definition for 'Value'? Pin
Member 1140330410-Jan-20 9:27
MemberMember 1140330410-Jan-20 9:27 
AnswerRe: How do I fix 'object' does not contain a definition for 'Value'? Pin
ZurdoDev10-Jan-20 10:09
mveZurdoDev10-Jan-20 10:09 
QuestionWhy can't I login to the web even though the User and password are correct ? Pin
Member 24584679-Jan-20 22:43
MemberMember 24584679-Jan-20 22:43 
AnswerRe: Why can't I login to the web even though the User and password are correct ? Pin
ZurdoDev10-Jan-20 2:00
mveZurdoDev10-Jan-20 2:00 
GeneralRe: Why can't I login to the web even though the User and password are correct ? Pin
Member 245846714-Jan-20 17:19
MemberMember 245846714-Jan-20 17:19 
GeneralRe: Why can't I login to the web even though the User and password are correct ? Pin
ZurdoDev14-Jan-20 17:52
mveZurdoDev14-Jan-20 17:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.