.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

Multible search criteria with empty field option

Posted By:      Posted Date: September 08, 2010    Points: 0   Category :ASP.Net
I have a gridview with two textboxes (first name & last name) and a linkbutton to search results inside the gridview.I have made select parameters as well and the search works if i write in both textboxes. However, if I leave one textbox blank, i don't get any results.------------------------------First Name: <asp:TextBox ID="txtSearch_FName" Width="100px" runat="server"></asp:TextBox>&nbsp;&nbsp;&nbsp;Last Name: <asp:TextBox ID="txtSearch_LName" Width="100px" runat="server"></asp:TextBox> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<asp:LinkButton ID="LinkButton1" Text="Find" runat="server" OnClientClick="return check();" /><asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="Searching" CellPadding="4" PageSize="15" GridLines="Vertical" onrowcreated="GridView1_RowCreated" Width="100%"><PagerSettings Mode="NumericFirstLast" /><HeaderStyle BackColor="#666666" /><AlternatingRowStyle BackColor="#f4f4f4" /><FooterStyle BackColor="#666666" />  &

View Complete Post

More Related Resource Links

search option



i've created a gridview and connected to the database programatically. now i want to insert a textbox above the header field of the name field. if i enter the name in the textbox it should display that only.. e.g i have three header name,pwd,sex i want to create the textbox above the name header. now i enter the name jhon in the textbox then the gridview should display

only the jhon information

please can u provide me a code...

Adv Search not returning calcuated field

I have a custom column associated with one of my content types, which I've set up as a Managed Property under Central Administration, and added to the Properties filter on my Adv Search page.  When I select this property in Adv Search, and specify a value that I now exists (on several documents), I get no results.  Non-calculated custom properties that I've set up work fine. Any ideas if there is some special config/requirement for search to return results based on caclulated column values? I set this up as follows: 1. Created the custom column on the content type 2. Created a managed property that maps to the crawled column "ows_MyCalculatedField" (in the mapped properties page this column showed up under Crawled Properties) 3. I reset the index and then ran a full crawl 4. I updated the Adv Search screen web part and added the column to the web part XML that defines what properties appear in the Properties picker list (the property shows up fine and I can select it and run a search) However, when i run the search for any value in the field, I get no results.  And I know there are documents that have the values I entered. Thanks

Search field question

hi guysin my database i have one table that has basic patient information (id,name,dob etc, visit date etc)i would like for the user to be able to search for a patient based on his unique personal id number and return the fields i specify (name,lastname) in the gridview. my problem in that one patient may have multiple visit dates. i would like the gridview to return the following as an exampleName     Lastname   Visit dateJoe         Johnson      10/05/10Joe         Johnson      13/08/10joe         Johnson       20/09/10from that the user will be able to click on the visit date that he wants to see the details aboutmy problem in that since the user ID is a unique field in my table i dont know how to create multiple visit dates. i think i should put the visit date in a different table and create a relationship but then i dont know how to present details from 2 tables in one gridviewthank you

search option in gridview

I am creating small application.  I want to keep textbox and gridview. If i type any alphabets in text box like customers name  if i type a it should display customers name with starting a in gridview. plz help methanq.

Looking for suggestions or ideas how to setup to capture search criteria and present to user if they

Requirements call for the ability to save search values so that they can select them at later times to return the results without having to re-enter the values. They have the ability to search on 4 different types of data (Date, Time and Lat/Long), so they would like to capture what was entered and ONLY if they chose to save those values, it will be saved and next time they login, if they are searching, they can pick an old search and submit it again.   Im thinking that i add a checkbox next to each button, if they check it, it saves the data into a table with there values and username. Next time they login and go tothe search page, if there are any records for them in the table, i present them with a link that displays all the values stored and if they select one, it will run the search again and present them with the results.. does that sound like the right way to handle this request? 

How can I get search to work for a Custom Document Library with a few third-party field types?

Hi, Using WSS 3.0 with SQL Server 2008 for Workgroups I have created a Custom Document Library (2,462 files - copied from folder into Explorer view and then renamed using Batch Update in web services i.e. "BaseName" field) - basically it uses three fields that are of "Filtered Lookup" (a field type from a third party). The document library is included in the search (i.e. Advanced Settings), but it displays none of the files - bascially not included in search at all with all testing I have done. I created a new Document Library called "Test" and uploaded a document and it is included in the search. Is there any way I can debug this. Is there a log file? Is there something in the Search Database that might help? Your help would be really appreciated as this is my last issue - and its soooo important to the deliverable. Thanks. John.

search field

hi, I want to have a search field in mvc2 asp.net that with click on search button redirects to page with address: "xyz/search/?name=&amp; FolderNum="  But get this error: A potentially dangerous Request.Path value was detected from the client (?).

Only show text from database if field is not empty

 Hoping someone can help. I am using ASP.NET VB and i am wondering how to only show text from database if data exists. I tried this but it does not work.Any help would be greatly appreciated.I am new to .NET, in the past i have always used classic asp. 1 <td valign="top" style="border-right: 2px solid #031992"> 2 (<%# Eval("VenderPhone1") %>) <%# Eval("VenderPhone2") %>- <%#Eval("VenderPhone3")%> 3 4 <% If String.IsNullOrEmpty(Trim("VenderAlt1").ToString) Then%> 5 <br />(<%#Eval("VenderAlt1")%>) <%# Eval("VenderAlt2") %>- <%#Eval("VenderAlt3")%> 6 <% End If%> 7 <% If String.IsNullOrEmpty(Trim("VenderFax1").ToString) Then%> 8 <br />(<%# Eval("VenderFax1") %>) <%# Eval("VenderFax2") %>- <%#Eval("VenderFax3")%> 9 <% End If%> 10 11 </td> 12   

Why Search Option is not working correctly in the People Search Box?


I have SharePoint Server 2010 Enterprise based intra.
I have added People search box.

Why I click the Search Options, it opens the fields top of the webpart below the search box.
So basically 2 webpart looks like they are top of each others.


QueryExtender Control - Variable field name to search against


FrownI have been alerted to the Query Extender control through previous posts, but I am still seeking the final part of my desired solution.

NB the following is written in conceptual English (programming specification) format, rather than actual asp code.

While I fully understand that I can use the QueryExtender control to pass a parameter from one web page to another, I do not see, and maybe this is not even possible, how I can pass a parameter of which field I want to select on.

Ideally I would like to be able to implement a query which is

SELECT tiles where 'Passed Variable Name' contains 'Passed Test Value'

such as would then generate, for example -

SELECT titles where 'Series Available' contains 'A'


SELECT titles where 'Authors' contains 'Wyndham'

but I just can't work out how I can implement the varying search field.

Is what I am seeking for possible? OR

Am I going to be forced to implement an approach such as the following?

SELECT Calling Web Page

CASE "Series" 

SELECT titles where 'Series Available' contains 'passed variable'

CASE "Authors"

Advanced Search in date field in sharepoint 2010



I have a question about advanced search that field a Date,

When searching the date field the sharepoint can not find any document and writes:

"No results found appropriate."

When going to standart search the sharepoint find documents also in date search .

in central administration in metadata properties- the  Data of the field is set.

What could be the problem?

How is the HitHighlightedSummary field derived in the search results?


Can anybody tell me exactly how this field is derived in the search results?

I have a custom list with various fields. One field is an HTML field which typically contains a large amount of HTML content. This field has been mapped to a managed property and the list is being cawled.

When a search is executed with a keyword, sometimes the HitHighlightedSummary returned from search contains the keyword and sometimes it does not. The only thing that appears to be different between the list items is the position of the keyword within the HTML content. The keyword appears early in the content for the list items that return the keyword in the HitHighlightedSummary but it appears well down in the content when it is not included in the HitHighlightedSummary. When the keyword is not included, HitHighlightedSummary seems to contain a combination of data from a number of fields.

Is it possible that HitHighlightedSummary only considers the first N characters/bytes of fields?


Created BY Field in site manager.aspx is empty



if i browse to this page it lists all the libraries and list created in my site collection. but there is a field at the right end named

Created By which is empty it doesn't have any data at all.

fields like title,modified by,and type have some data but this Created By which is supposed to have the name of the person who created that item is empty.

is there a way to display the creater name in that field or there is something i have missed...

"secondary" search criteria


I have an asp.net web page that searches an SQL table based on a number of parameters, including city name (which is contained in a field called "City"). The results of this search are returned in a list of records grouped and ordered by city name.

Here's a random example of how the search results would be rendered on the web page:

  • New York:

    • record 1
    • record 2
    • record 3
  • Capetown:

    • record 4
    • record 5
    • record 6

This is working fine. But now I need to also include any records whose location is "nearby" the city. This is determined by 2 fields in the table, Alt_Locale1 and Alt_Locale2. For example, let's say that there's a record 7 which has "New York" as its "Alt_Locale1" value.

The results should look like this:

  • New York:

    • record 1
    • record 2
    • record 3
    • Nearby Results:

      • record 7
  • Capetown:

    • record 4
    • record 5
    • record 6

So, I need to revise my code behind to take the results of a query and check to see if the "City" values in any of the returned records match any values in "Alt_Locale1" and "Alt_Lo

Need To create Stored Procedure for a Search Criteria


Hi all,

I need to create a stored procedure for a search criteria same as the linkedin.com is having with it under job search module. but i don't understand from where should i start. i am not getting any clue for that. please help.....

i am working on SQL Server 2005.

Installing full text search not showing up as an option to install (per advances services installati



Per the following link regarding installation pre-reqs for the adventure works sample databases:


when adding features to an existing sql installation/instance I am not seeing the "Full Text Search" check box when adding features under the Instance Features/Database Engine Services node.

Has anybody else ran into this issue?



Does anybody know anything about converting search criteria to Binary to improve performance?

Does anybody know anything about converting search criteria to Binary to improve performance?
Mr Shaw
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