Solved

C# ASp.net  InputFormTextBox Html issue

Posted on 2014-09-15
1
560 Views
Last Modified: 2014-09-25
Hi,
I used following code to create  InputFormTextBox, When i copy from excel sheet some records it will automatically creating
unnessary codes. See below

<P>
<TABLE style="WIDTH: 48pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=64 border=0>
<COLGROUP>
<COL style="WIDTH: 48pt" width=64>
<TBODY>
<TR style="HEIGHT: 17.25pt" height=23>
<TD style="BORDER-TOP: #f0f0f0; HEIGHT: 17.25pt; BORDER-RIGHT: #f0f0f0; WIDTH: 48pt; BORDER-BOTTOM: #f0f0f0; BORDER-LEFT: #f0f0f0; BACKGROUND-COLOR: transparent" height=23 width=64><FONT face=Calibri>Test<FONT class=font5><SUP>2</SUP></FONT></FONT></TD></TR></TBODY></TABLE></P>


I need only copying and paste to InputFormTextBox ,Please some one show me how to do.I already Ask user to enter
starting point £ and end of sentance £,throught that im removing HTML code,But its time consuming,so any one show me any better way or how to avoid this issue
Expected Results

Test<SUP>2</SUP>

Open in new window


Seebelow my C# code How to creating InputFormTextBox

private InputFormTextBox richTextEditor

     richTextEditor = new InputFormTextBox();
            richTextEditor.RichText = true;
            richTextEditor.RichTextMode = SPRichTextMode.FullHtml;
            richTextEditor.TextMode = TextBoxMode.MultiLine;
           

            richTextEditor.Width = System.Web.UI.WebControls.Unit.Percentage(100);  
            richTextEditor.Rows = 10;
           
            richTextEditor.Enabled = true;
            richTextEditor.Visible = true;
            //Panel1.Controls.Add(richTextEditor);
            Panel_Disclaimer.Controls.Add(richTextEditor);
0
Comment
Question by:ukerandi
1 Comment
 
LVL 12

Accepted Solution

by:
Jitendra Patil earned 500 total points
ID: 40332051
hi ukerandi,

first of all, let me tell you i am not a sharepoint guy, but i will try my best to solve your issue, as i have little knowledge of SP.

as per your code you are providing the SPRichTextMode.FullHtml;  which means it will  Display enhanced rich text, including pictures, tables, and hyperlinks.

you can try with Compatible mode which says  it will Display plain text, or display rich text with bold, italic, or text alignment

for your reference you can check the below link
SPRichTextMode enumeration

as you are using a RichTextbox editor with fullhtml mode it will automatically generate an HMTL for what ever text you provide in it,
copy and pasting from Excel includes Table, due to which it includes the above HTML code for particular record.

Hope this helps.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Note:  There are two main ways to deploy InfoPath forms:  Server-side and directly through the SharePoint site.  Deploying a server-side InfoPath form means the form is approved by the Administrator, thus allowing greater functionality in the form. …
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now