Facebook blue highlight for a multiline ASP.NET textbox - asp.net

I am trying to implement Facebook autocomplete functionality after a user types # for a multiline ASP.Net textbox, including highlighting the selected text (this would only be a part of text inside the textbox).
My question is: is it possible to apply different styles inside a textbox or how does Facebook highlight in blue what the user choose from the completion list? How can I achieve the same result with my textbox? As far as I know one cannot apply different css inside the same textbox.
Please help & encourage me.

is it possible to apply different styles inside a textbox
No.
or how does Facebook highlight in blue what the user choose from the completion list?
contentEditable is your keyword. This is a mechanism implemented in newer browsers to make parts of a document “editable”; and with HTML5 is has gotten standardized.

Related

Add custom dynamic text box in asp.net zero angular

I am working in asp.net zero with angular, wants to add dynamic text box.
I wants to add custom text box in angular asp.net zero. When i click on button then two text box will be show on screen. If i click again on button then show new two text box on the screen. and i can delete it too.
Any one have idea, how to do it.
This is not specific feature on asp.net zero, is angular, the best way i can suggest you do it is using angular reactive form. follow this tutorial and you will have all the features

Link jQuery-UI/Kendo-UI to make live changes to elements in page designer

I apologize if the title was not clear enough. I am working on a project where a user can design a page (something like Wix). I am continuing on a project left in-complete by some developer. The sequence of action is.
The user clicks on a link which adds an element on the page (e.g. textElement, picture, slider...)
There is an edit button for each element. Clicking which opens a dialog box.
On the dialog box there are sliders and color picker drawn using Kendo-UI. Using them the user can change the style settings for the element (e.g Font-Color, BG-Color, Font Size...)
What I want now is to apply/show the changes live on that element. I have the id available for each element. I can bind each of the style selectors and apply the changes live to the text element. But that does not seem the right choice as in future we might add another style selector in the dialog box, and that would mean adding the code for binding this new selector.
What I wanted to know was that is there an alternate or preferably easy way to do this?
Regards
Share some code with the basic idea that you follow, cause it's not getting clear what you did. It sounds like you can use the MVVM framework feature to help you for that.

How to create custom horizontal radio buttons with CSS?

I want to create radio buttons or other type of controls that will act like this:
[_value1_] [value2] [value3]
Value1 is selected, so it looks like pressed button or selected link (bold, no underline) and other elements are active buttons/links. When user select another value - state is changed. I can handle this event manually, question is - what plugin or existing css/js combination should I use to achieve this?
I am pretty sure that this type of controls have a name, but can't think out what is this. I have tried to search for custom style radio buttons, as functionality is the same, but failed. Also I have tried some other names such as switch buttons, but it's not what I want. It's also very similar to tabs, but tabs usually styled as something that require underline div attached. So I am looking for "radio button meet tabs" css/js solution.
Can you help me to name this control, if you know it's name, or find plugin/existing code that can help me to achieve my goal?
The question is not how to create this type of functionality myself, I can do it, but it's rather strange that there are no existing solutions and I want to help people in same situation, also may be existing solutions design can be better than I can invent myself, because I am not a designer.
Answer
This type of controls can be found as "Simplified CSS Tabs" or "CSS Mini Tabs", but they require some additional code to work as expected.
Also, this type of functionality can be found in Google as jQuery UI radio buttons transformed into a button set and Yahoo UI Button Control: Radio Buttons
http://jqueryui.com/demos/button/#radio
works done for ya bud :)

Using RadToolTip with RadComboBox without using ItemTempalte

Is there a way to connect a RadToolTip to each item within a RadComboBox (having a different tool tip come up for each item in the combo box) without having to use the ItemTemplate of the RadComboBox? The reason is because I like the built-in implementation of the combo box styles, etc. and don't want to write it all from scratch within the ItemTemplate. I am trying to have a tool tip come up when I am hovering over an item in my combo box which shows some more information about that item. Basically giving the user a little more information before making their selection.
Updated: I need the tool tip to support HTML or even a RadGrid. It cannot just be a text tool tip.
I'm pretty sure that there is no way to add a RadToolTip to the items without using the Item Template. What about the styling would be too difficult to replicate using the Item Template?

asp.net - How to render html tags in a ListItem text property?

I have a DropDownList control that is populated via server side.
I use a For Each [datarow] loop and create a New ListItem
In the DataRow is a column with the ID 'Title'; this field may contain either <B> or <I> tags. (ex. "[Title] in <i>[Parent Title]</i>")
The problem I am facing is when I [DropDownList].Controls.Add([ListItem]) it renders the text literally... so it displays the <B> or <I> tags literally and doesn't bold/italicize the font.
I have tried looking all over for an answer, can someone please point me in the right direction?
A DropDownList control is rendered as a select element in the hhtml code, and the ListItem controls are rendered as option elements. An option element does not support html formatting in the text. Some browsers may support some styling of the entire option text, but no browser supports styling of part of the text.
If you need html formatting in the dropdown list, you either have to make your own replacement dropdown list control using DHTML, or find someone who has done it already.
You can try adding style attributes to each listitem, but I'm not sure how universally this is supported across different browsers.
ListItem li = new ListItem(dr["Name"], dr["Course"]);
if (bold) li.Attributes.Add("style", "font-weight:bold");
listcontrol.Items.Add(li);
Re-reading your question I noticed you want to mix normal and bold text within a single item in the list. I'm almost certain this isn't supported using the standard dropdown list. I think you'll need to have a look at using a CSS-based control that simulates a dropdown list.
If you need to have the bold and italicized formatting, I'd recommend using an .net Literal control to serve as a placeholder for your drop down list. Then upon postback or databinding, you can iterate through your result set, generate the HTML code manually (since it is not that complex) and then insert the generated HTML into the Literal control.
Indeed this is not possible.
You have a couple of alternatives although they have some minor disadvantages, because they do not exactly behave like a dropdownlist. In most solutions you can only pick an option with the mouse instead of typing a couple of characters. Of course it is possible to program this behaviour but that takes some time and effort.
Alternatives I have found are:
jquery solution from marghoob suleman
jquery solution from sanchez salvador

Resources