Its often that we need to display some formatted html text in a Web page. Here is what I want to do
There is a description field where user enters his comments.There's anther History field which shows some history about the user edits done. I just want to bold the User comments. Everything else in History Text box can be normal text.
Now I have two options here
Let the User bold his comments by using a third party editor like TINYMCE or CKEDITOR.
Let me bold the text after the user clicks submit button on the Page and render it in History control.
If we use Approach 1, It will be an Issue to show html content in History control which is a plain Text box.
Similarly in approach 2, we can't directly display formatted text in history control and storing htmltags in DB might be an issue.
Now, I am in a confusion which approach is right and how to achieve this.Kindly comment with your expert views and suggestions
Thanks
Related
My code generates a phone call activity in each customer lead, then records the SMS conversation between that customer and the company. The description may contain an URL to an image that the customer finds relevant.
I can put the URL as text in the description property, but I would like to transform it to a hyperlink (something like an <a> tag of html.) That way I can click to open it directly instead of copy pasting the URL first.
How can I achieve this?
The description field on a phone call is just a plain old text field, so you can't add any formatting or hyperlinks there.
You could make a separate field, single line of text, with a type of URL. Then the URL you input should act as a typical hyperlink.
The data types are documented at Create and Edit Fields.
I believe you're asking about being able to have a large text area, within CRM, that is editable, but allows you to enter, or at least click on, hyperlinks.
I see two supported solutions, but both would take a lot of customization.
Create an HTML webresource that loads the text from the field, parses it, looking for hyper links, and then add's the correct <a> tagging in order for the links to be clickable.
Search for a client side wiki markup Text Editor widget of some sort (possibly something like http://goessner.net/articles/wiky/ ?), and then format the hyper links with the correct markup.
None of CRM data types support native full blown html rendering. If you try to use JavaScript to update the value and try to render it as html, it would trigger a save to the database as CRM would see the attribute value as modified.
I need to autocomplete a form's textboxes based on the input of the first text box.
Basically you enter a name in the first text box, that is searched in a SQL table and if found, the remaining text boxes are filled with the relevant information.
I did come across the ajax control toolkit AutoCompleteExtender but that only seems to work for one text box.
How can I auto populate the remaining text boxes? Is there a way to do that with the AutoCompleteExtender?
I have a very simple report which has a Page header, body and footer. In the page header there is a text field which get text from the user input in a windows form. The text in the text box changes based on what user inputs. The issue I am having is, in the report viewer every thing is working i.e. when user inputs a large text, the text box is expanding as needed and every thing looks good. But when I export the same report to pdf it is not rendering the text box height right, in other words the page header is not changing accordingly so body is overlapping with text in the page header.
Since this is my first post I am not able to post any images to show the problem.
Any suggestions on how to fix this issue.
I'm trying to highlight the selected text contents by the user inside the HTML page.I have highlited the text using jquery (dot net). Now I need to save some information to the database that makes me able to highlight the same contents again for future loads of the same page, taking care of all inner elements that the text could have inside.
i.e.,
Have a base HTML files thats same for every user, given the freedom to user to highlight content in provided page, after he highlites, information needs to saved to database against each user, so that when user open the same html file again,(HTML files shown in a panel) he gets the same page with the highlighing he had done earlier.
Please suggest what information should I save to database..
any pointer how would I move ahead..
Thanks in advance your help.
not a dot net expert , but it seems like you are storing content in database, when fetching they need to be highlighted.
the best way is save content as html or write you own highlight tag
and then replace it to blank when highlight not needed , and replace it with
<div style="background-color:red"> to highlight.
Hope you are getting the approch.
And if you are using HTML files , then it is always better to store them in database. String manuplation for every request will be much heavy task to do.
I have a TextArea control in my ASP.NET page which gets populated with a paragraph containing multiple sentences from the database. After this data gets populated in the TextArea control, I need to search for a few words in them and highlight them in different color. The words that I need to highlight are present inside a table in the database.
My question is : How do I highlight the selected words in a TextArea control using C#?
Please help. Thank you.
The HTML <textarea> tag doesn't contain the ability to add any text formatting. If you want to highlight a portion of your text, then you'll need to display it within a <div>, <span> or some other HTML element.
If you need to make the text editable and still highlight portions of it, then you could use a WYSIWYG HTML editor, such as the jHtmlArea Free, Open Source jQuery plugin.
Shameless Plug: jHtmlArea is a jQuery plugin I created a while back to fit a need I had for a light weight, easily extensible WYSIWYG HTML editor.
You can look into the DynaCloud jQuery plugin, or CodeMirror. Both provide some functionality for highlighting text.
http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html
http://codemirror.net/