Searchable TextBox? - asp.net

I'd like to have two textboxes, one that is large and read-only, with content from the server, and another that is one line and that searches the first text box. The word the user puts in TextBox2 would be highlighted/bolded/whatever in TextBox1.
Example:
TextBox1:
This is an example of the possible contents of my read-only text box. It would go on for a bunch of lines...
TextBox2:
box
Is there any way I could do this? I've thought about using the AutoComplete TextBox from the AjaxControlToolkit and setting the Service Path to wherever I'm getting the contents of TextBox1. But that's not doing exactly what I want, because I'd like to interrupt the suggestions and use them to search TextBox1. Any ideas? I'm pretty new to asp.net and just fishing around for somewhere to get started on this one.

I would recommend a JQuery plugin like this. I don't think it will work with a textbox, but you could try. Do you have to use a textbox for the first one? Could you use a DIV instead, if it doesn't work?
An example of usage:
$('target').highlight('box');

Related

I need to display a pop up table on clicking a button in vb.net. How do i do this without the gridviews just on plain button click?

I need a table to pop up or flash on the users screen when a button is clicked
It is a reference table, users can go back and check the codes while filling a form. This is to be done vb.net. Please help me i need the simplest solution possible
in my opinion:
1) If you don't insist on formatting and you would like to only display table data, you can simply write the data into string, which you will display in a MsgBox dialog. You'll probably will have to take care about partial string lenghts in columns (trim, or complete with spaces to a specific length) and then it will look OK. Bellow is an example of such data (only a test dialog) without any trimming/completeng:
2) For a serious table, you'd have to either use datagrdiveiw (or such) in a separate form, or draw your table using GDI, which would be a rather complicated and eccentric method.

Telerik RadMenu: Save information from last item

I'm dealing with a form split into tabs in a RadMenu. I need to save the information entered on a tab when the user leaves it. I know there's an ItemClick event for RadMenu, but is there a way to capture the information on the previous tab with that event?
I'm using VB.NET, if it matters.
Are you certain that this is RadMenu and not RadTabStrip?
It would make more sense to be the tabstrip.
There is a nice demo that demonstrates this approach with tabstrip:
http://demos.telerik.com/aspnet-ajax/tabstrip/examples/application-scenarios/wizard/defaultcs.aspx

How to insert text into popup using Robot framework?

I have a button on clicking on it it is opening a Popup. The Popup contains below fields like., Textbox, OK and Cancel buttons. I am fine with cancel and Ok buttons. Help me in Giving text to that textbox using Robot Frame work. I am not able to find the Id/Name/Xpath of that particular field.
Assuming that the popup is a proper window and not an alert, you just need to select the window after it pops up. After that, your usual keywords like Input Text will work as expected.
The selenium2library user guide explains how to do this.
Input text is the way to go about this but what the locator is depends on how you are creating this pop-up. Please show us the code you are using to create the pop-up and then we can help you to add a locator to it. Generaly I use jquery locators as they are incredibly powerful so I would recommend looking to that as a way forward.

ASP.NET typing text vs using label

What's the difference between typing some text on a page vs inserting a label and typing some text into that label ?
Any reason why somebody would want to use a label vs just type text on the page ?
The only advantage that I can think of is that a label can be updated easily ( e.g user clicks a button , in the event code for the click action one can write something like label1.Text = "some value" )
Thanks
Labels can be associated with controls using the AssociatedControlID property, allowing the user to click the label to focus the control.
If a label is associated with a checkbox, clicking the label will toggle the checkbox.
You've nailed it. Putting text inside a label control allows you easy programmatic control over that portion of the page, while putting it directly in the HTML requires you to then jump through extra hoops if you want to modify it later.
In addition, you can also programmatically show/hide a label, add css styles, and associate it with an input control (AssociatedControlId property).
You can't easily apply CSS styling to random text on the page.
Edit - Sorry I meant in server side code.
The difference is that typing into a Label causes it to render the HTML from the server side while typing text into the HTML does not.
This is very useful if you want to change the text dynamically or if you need to deal with changing the text for internationalization.
ASP.NET labels should be used to much like HTML labels: to indicate which control this text is related to. ASP.NET also has the LiteralControl, which is just text, and is better suited to your needs.
Typing text directly onto your page is often uncontrollable - It is difficult to control where it will appear, and in what manner. Labels have very predictable features that can be adjusted easily to work with formatting. Furthermore, as your page gets more complicated, having text in labels that is identifiable with IDs makes things significantly easier.

ASP.NET FileUpload - How to change the language of the "Browse..." button description?

I know the very similar question was posted here already (How to change the Text of the browse button in the FileUpload Control (System.Web.UI.WebControls)) and I understand it's not possible to change the description to some custom text, but isn't it at least possible to change it to a different language (e.g. to English)?
I'd like to do it so that my web page is whole in one language (because e.g. "Procházet..." instead of "Browse..." in the middle of English web page looks kind of weird to me).
This is determined at the browser level, unless you moved to something like a flash-based uploader (or <iframe> trickery), you can't customize it. Whatever language/localization the user's browser is in (usually based on the OS setting), that's the language they'll get on the "Browse..." button.
If your page is for consumers likely already in that language, then you're all set, the default behavior works. If people with another language setting come by, well...that's the language they picked, so it should be an intuitive button label, even if it doesn't match.
Although there is direct way to change the Caption of InputFile control,but you can always go for alternative way,
Add InputFile control to you page let's say "fileUpload" and make it Hidden or invisible.
Add new HTMLButton on form with Text Whatever you wanted to give it to your fileupload button (in addition you can also add TextBox too to show uploaded file name when events being gets handle at server side).
Onclick even of above button use below javascript
document.getElementById("fileUpload").click();
It will do the same thing without showing up default InputFile control.
No, it's a matter of client's operating system.

Resources