I have a list of items which is a bit too large for a dropdownlist and I'd like to add a search textbox which based on the input will drop down a list of matching items.
So if you put in John the list below would display any items that start with John.
How to go about doing that?
The feature you are referring to is commonly labeled "AutoComplete".
If you are not at all familiar with how to do this, I would suggest following a tutorial or leveraging a pre-existing solution.
There is an example using the ASP.NET AJAX Control Toolkit available at:
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AutoComplete/AutoComplete.aspx
The basic idea is that when input is changed, JavaScript will send an asynchronous HTTP request to the server and find out what the auto-complete items should be, then it will fill the drop down options with the returned values.
Well what you want to look at is the autocomplete libraries that are available.
In your case, ASP.NET AJAX control toolkit has this functionality.
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AutoComplete/AutoComplete.aspx
There are other options such as :
http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/autocompleteclientside/defaultcs.aspx. This is from telerik and not free though.
http://harvesthq.github.com/chosen/ - quite new and looks promising, but not ASP.NET specific.
Related
I've got a site with WebPart containing custom fields.
http://wsscg.blob.core.windows.net/resources/forum/front/aa432.PNG .
My goal is following: I want to add a button below this form and after click, data from it goes to a custom list.
So far I've managed to add a button and a code inline with Sharepoint Designer. It adds some data (like 1,2,3,4,5) to the list that I want. But the problem (probably last) is how to retrieve data from the form.
I would highly appreciate any help.
I recommend you to search here: http://sharepointjavascript.wordpress.com/
I've found there many useful client-side gotchas.
Site seems down today, but take a look at cached version of dynamic js sp form:
http://webcache.googleusercontent.com/search?q=cache:j97GDCJkwsYJ:sharepointjavascript.wordpress.com/2012/01/19/dynamic-forms-for-sharepoint/+&cd=2&hl=en&ct=clnk&gl=en
where getFieldValue function used.
Hope that can help.
I want to list a group of similar templates(which contains photos,texts and hyperlinks in a certain layout) on my web page.
So I'd like to know some technologies which can provide me the ability to develop my own template so that I can feed this template with paths of photos, text and hyperlinks and the template will arrange the layout.
I am thinking of using Customer Control + Repeater to do this job.
But I think there could be some other really brilliant technologies which can do the same thing in a easier way.
I'd love to see the name of technologies and code to demonstrate how to use it.
With ASP.NET, repeater is fair choice, you can easily build your any kind of template. And you can use server side tags too.
If you are willing to bind your data at client side, there are lot of client side technologies available to bind Json data, such as Jquery template, Knockout.js etc. (you can also explore other client side data binding technologies such as backbone.js, ember.js, batman.js)
Here is the list of technologies and examples.
another good read about Javascript framework:
http://blog.stevensanderson.com/2012/08/01/rich-javascript-applications-the-seven-frameworks-throne-of-js-2012/
I'm trying to create a very basic web site creator in C#. I already created the templates but have no idea how to get them in the program so the user can pick one and customize it. Is there a certain library I should look into? I've bee told this can be easily created in php but I'd rather not go down that route.
If using .NET you can use WebControl controls to display a preview of your templates and make the user decide which one he wants.
Or a list of templates and single WebControl that parse and display the HTML of the current selected list item (template) and then make the user select.
To edit, just a bunch of controls (one for each template placeholder) that updates the view of the WebControl.
In the top link you found how to do it.
P.S. Templates can be stored on XML, Plain Text, DB or any other mean.
Either store the templates as files on the web-side and use them as templates, or store them in a DB. Unless your app is not web-based, in which case the same advice pretty much applies.
I want to provide an autocomplete option for a text in my web applciation . I have the master data in the SQL server database table. I beowsed in google and found how to use autocomplte. all the examples use web service to do this. I cannot create a web service to impltement this. Is it possible to implement autocomplete by looking up values from database in code behind ? If so any one can provide any sample links for reference ?
Thanks in advance,
Jebli
It depends on the volume of data. There are 2 options:
send it to the client pre-emptively (perhaps as json or html) in the page source
let the client query it based on their input
The second is common if the data-volume is non-trivial, as you can query when (for example) they've entered 3 characters; very useful for names and other long lists.
Re the web-service; this doesn't have to be a full/complex web-service; just a simple route or ashx (for example) that returns the filtered data.
The jquery autocomplete plugin supports both scenarios, although this is now partly obsoleted by jquery ui plugin.
Is it possible to implement autocomplete by looking up values from database in code behind
Well, that is at the server - so you're essentially talking about the same "web service" that you say you can't do... I also think you should separate out the 2 functions (create page vs provide auto-complete results) into separate files (/pages/whatever).
A simple way would be to make a new aspx page that takes the autocomplete query as querystring parameters, looks up the result in a database and returns the response as XML og JSON.
I have a textbox and a button in one page.I want to enter a word in the textbox and click the button. After clicking the button I want to display the name of the web pages containing the word entered in the textbox. So please tell me how to do it? I am using C#.
So you want to create a search engine internal to your website. There are a couple of different options
You can use something like google custom search which requires no coding and uses the google technology which I think we all agree does a pretty good job compared to other search engines. More information at http://www.google.com/cse/
Or you can implement it in .net which I will try to give some pointers about below.
A search engine in general exists out of (some of) the following parts:
a index which is searched against
a query system which allows searches to be specified and results shown
a way to get documents into the index like a crawler or some event thats handled when the documents are created/published/updated.
These are non trivial things to create especially if you want a rich feature set like stemming (returning documents containing plural forms of search terms), highlighting results, indexing different document formats like pdf, rtf, html etc... so you want to use something already made for this purpose. This would only leave the task of connecting and orchestrating the different parts, writing the flow control logic.
You could use Lucene.net a opensource project with a lot of features. http://usoniandream.blogspot.com/2007/10/tutorial-implementing-lucenenet-search.html explains how to get started with it.
The other option is Microsoft indexing service which comes with windows but I would advice against it since it's difficult to tweak to work like you want and the results are sub-optimal in my opinion.
You are going to need some sort of backing store, and full text indexing. To the best of my knowledge, C# alone is not enough.