Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Created Unassigned: html editor extender not firing [27609]

$
0
0
I am using HtmlEditorExtender of Ajax in my application for Text Box control. Problem I am facing is when i insert some texts in TextBox after using some Editor controls like Bold,Italic etc and save it to my DB, it stores the Texts along with html tags of HtmlEditorExtender and even while retrieving it back from DB to my GridView it displays as same (along with html tags) i tried to save Text using HttpUtility.HtmlDecode(TxtComments.Text); but it isnt working. So please try to help me to sort out this prblm.

aspx code:

<asp:TextBox ID="TxtComments" runat="server" BorderColor="#666666"
BorderWidth="1px" Font-Names="Calibri" Font-Size="Small" ForeColor="#034599"
Height="106px" TextMode="MultiLine" Width="584px"></asp:TextBox>

<asp:HtmlEditorExtender ID="TxtComment_HtmlEditorExtender" runat="server"
Enabled="True" SanitizerProvider="False" TargetControlID="TxtComments">
<Toolbar>
<asp:Undo />
<asp:Redo />
<asp:Bold />
<asp:Italic />
<asp:Underline />
<asp:Indent />
<asp:Outdent />
</Toolbar>
</asp:HtmlEditorExtender>

cs code:

protected void BtnSave_Click(object sender, EventArgs e)
{
DTO objc = new DTO();

***objc.Comments = HttpUtility.HtmlDecode(TxtComments.Text);***
}

protected void Page_Load(object sender, EventArgs e)
{
DTO objc = new DTO();

if (!IsPostBack)
{
objc.Comments = Server.HtmlDecode(TxtComments.Text);
}
}

protected void gvData_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
DTO objc = new DTO();

Label lblComments = (Label)gvData.Rows[e.RowIndex].FindControl("lblComments");
TextBox txtComments = (TextBox)gvData.Rows[e.RowIndex].FindControl("TxtComments");

objc.Comments = Server.HtmlEncode(txtComments.Text);
}

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>