.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

search textbox with search keyword inside?

Posted By:      Posted Date: August 24, 2010    Points: 0   Category :ASP.Net


how to make a search txtbox that includes the search keyword and when the user clicks the search keyword disappears

thanks for the help

View Complete Post

More Related Resource Links

MS SQL Server: Search All Tables, Columns & Rows For Data or Keyword Query

If you need to search your entire database for specific data, this query will come in handy.

So when a client needs a custom report or some sort of custom development using Great Plains, most of the time I will have to track down the data in the system by running this query and find the table(s) it is in.

Simple search TextBox in asp.net

The article Simple search TextBox in asp.net was added by miya2008 on Monday, August 09, 2010.

I create a simple search textbox in asp.net with the help of LIKE operator (SQL)Step 1 :- First we create a table in database:->create table textsearch(id int identity( 1,1),fname varchar(50),lname varchar(50))Step 2:- In aspx page,I use the following

search multiple words into textbox and populate all records in gridview related those keywords


I have a textbox and a gridview which is bound to a table

what I want to achieve is a solution where lets say there are two records - e.g. "1. Book and 2. Red", i want a user to type in those words and the gridview shows the results as followed;

1. Book

2. Red

I have set up the sql data source and everything and my like operator is this...

LIKE '%' + @record + '%'

how can I solve this problem?

sharepoint search pdf files using metadata and also the content inside pdf

I am a novice to sharepoint search can anyone give some ideas on how to integrate search at a subsite level (only to that subsite) which has pdf documents with metadata associated with it the search should also search the content within the pdf and libraries and list metatdata in Moss 2007

gridview filtering using a codebehind (textbox + search button)

i am trying to replicate the following sequence: input text into text box > press search button > search a database using LIKE operator > display using a gridview or listview. this sequence is fairly easy to do using the drag and drop then sqldatasource options, but i am trying to do the same result using a codebehind.  here is my code:   ____________________________________________________________________________________________________________ SqlConnection myConn; myConn = new SqlConnection(@"Data Source=.\SQLEXPRESS; AttachDbFilename=|DataDirectory|\projectDB.mdf; Integrated Security=True;User Instance=True"); myConn.Open(); string strSQL; strSQL = "SELECT * FROM Message";       //strSQL = "SELECT * FROM Message WHERE Message LIKE '" + txtSearch.Text + "'"; SqlDataAdapter da = new SqlDataAdapter(strSQL, myConn); DataSet ds = new DataSet(); da.Fill(ds, "Message"); GridView1.DataSource = ds; GridView1.DataBind(); myConn.Close(); _____________________________________________________________________________________________________________  now, if I use this code inside a page_load event, it does work. if I put it inside a button_click event i get nothing. i am mystified by this.. any help? why can't i use a button to display my gridview1 when i'm using a code behind.  

How can i place windows textbox on taskbar like desktop search

Hi How can i place windows textbox on taskbar like desktop search thanks

Make the AutoCompleteExtender more like the Netflix search textbox


I am using the autocompleteextender control in a project I am working on for a client, but I would like to be able to match words in the middle of the data I am searching. Controls such as the search textbox on sites like Netflix do this. For example, if I go to Netflix and search for 'wolfman' I get results like:

The Wolfman

The Real Wolfman

House of the Wolfman

With the extender I would only get results beginning with 'wolfman'. If my stored procedure in my webservice is written to do search the text as I want, nothing shows in the extender (I'm guessing because so many top results don't begin with the entered text). Is there a way to get the autocompleteextender to behave more like this?


How do I search for part of a keyword?


I am using the sharepoint search and I am not able to search for a part of the keyword.
EX: Word in database - Sample
Search keyword "sam" should return all the documents which have this word in them like "Sample".

But this is not happening. Could you please let me know with some example code for this?

I even saw http://msdn.microsoft.com/en-us/library/ms467796.aspx
for the prefix and nothing much info present.


I want to filter the gridview on textchange in search textbox....


hi friends...
i want to filter the gridview on textchange in search textbox....
if i press "a" the gridview should filled up with record starting with "a". i have some code

SqlDataSource1.SelectCommand = "select * from DeptMaster where DeptName like '" + TextBox1.Text + "%'";
        SqlDataSource1.SelectCommandType = SqlDataSourceCommandType.Text;
        GridView1.DataSource = SqlDataSource1;

its working while leaving the textbox but i want this code should execute on keypress event....

Keyword Search [me] ?


When performing a Keyword Query - in this instance within a Core Results Web Part Fixed Keyword Query - how to specify the current user?

e.g.  rather than


how can you achieve the equivalent of:


Of course I could create a Web part and inherit the from CoreResultsWebPart, but I'm surprised this isn't possible natively?


keyword search doesn't return any results



Can anybody please help me with the whole issue of keywords definition?

Here is what I've got and do:

Sharepoint 2010 server and FAST Search server for Sharepoint 2010

I create site collection "A" using FAST Search center template

I enable SharePoint Server Enterprise Site Collection Features

In FAST Search Keywords section I define a keyword "M

keyword search - anyone got code or know where I can find it, tips ?


I need to search some records for one or more keywords ( user entered) and then display them in order of matching i.e. at the top all 3 keywords, at the bottom, just one keyword found.

Before I do this.... has anyone done it before ?

I was going to go through each sql record and search for the words, presume that best way ?

How to search a bound ListBox from a TextBox



I am just starting out with WPF and so please pardon me if I ask very ignorant questions but I'm finding WPF quite an up-hill struggle! 

I have created a fairly simple app that has a Listbox to the left that is bound to a DataTable to an OLEDB datasource. Above this Listbox there is a Textbox. What I am trying to do is use the Texbox as search/filter on the bound Listbox. Currently I can click inside the Listbox and start typing and it works perfectly well in finding the most appropriate Item with the IsTextSearchEnabled=True. I want to mimic this functionality but in the Textbox. Is this possible? Here is the xmal:

<Window x:Class="Test.WPF.BasicContactSearch1.ContactWindow"
    Title="Contact Window" Height="480" Width="640"
    xmlns:local="clr-namespace:Test.WPF.BasicContactSearch1" Loaded="Window_Loaded">
  <DockPanel Width="auto" Height="auto" Margin="8 8 8 8">
    <Border Height="56" HorizontalAlignment="Stretch" VerticalAlignment="Top" BorderThickness="1" CornerRadius="8" DockPanel.Dock="Top" Backgroun

Weighted Keyword Search


 Hi All,

I am searching for products out of my database:
AND (CONTAINS(P.name, @contains_key) OR CONTAINS(P.description, @contains_key)

Storing search keyword in Session variable


Hello gurus,

I have heard alot about sql injection and how it is normally caused. Mostly sql injection in my opinion is caused through search boxes. Now my question is quite simple. Is it advisable to store the search keyword in a session variable to prevent sql injection? I don't want to expose the keyword through the querystring as it is prone to attacks. So in short there is no harm in using session variables to store the keyword right?


Smart search inside a database.



I am trying to search inside a database in a column named 'Title'.

I tried the fulltext searching but this is just not good enough.

How can I do a smart search for non-english languages inside one column?

Thank you!


Writing a keyword query for Filtering the search items


I am trying to search only the documents created by a an author. Below is the code that i am trying to use for keyword query but i am not getting any results at all.

string strQuery = "contentclass:" + "STS_ListItem_DocumentLibrary" + "author:" + strQueryText

Can anyone help me out here please.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend