Saturday, March 24, 2012

text search in asp.net

its urgent i want a text search in asp.net with c#

if i enter asp in text box and submit the page it has to get the pages with text syed in that page.

Help will be appriciated

Hi,

I haven't tried this yet but it migh help you:

http://www.dotnetjunkies.com/Tutorial/195E323C-78F3-4884-A5AA-3A1081AC3B35.dcik


i want text search utility for the whole of my website

Hi, Sorry but iam unable to understand this question, you entered a text asp now want pages with syed in that page(which page you want), and with what text. that text should be in the name or inside the content of the page.


1)enter the word which you want to search in your website.

2)diplay the pages where this word occurs in your website pages.


Hi, i do not know if their is some inbuilt facility to do so.What i could have done, is this way,

The project where your webpages are present is a directory . So first find the no. and names of file in that directory and put the name inside a string array.

Now we have the names of all files we have to read.

Create a foreach loop and start reading the file .This will be outermost loop . In the inner loop start reading them and match the each string with your own string .If matches skip the inner loop then save the name of that file inside another string array.Its like we do linear Search,

In the end use javascript code to open your webpage with the names retrieved from the string Array in your code behind.

--------

Its true that giving suggestions is quite easy, but some times they help.

Hope this will help


Thanks BMW,

But i got this url fewdays back and its working .

but anyhow thanks for sending me the url.


syedwna:

1)enter the word which you want to search in your website.

2)diplay the pages where this word occurs in your website pages.

Hi,

Here is a demo for you :http://www.codeproject.com/aspnet/SearchDotnet.asp

Hope this helps.


hiJerome Cui - MSFT ,

i used the application what u gave the url,it was working fine on local host

now when i put the application on live server , i got the error

The remote server returned an error: (500) Internal Server Error.

Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details:System.Net.WebException: The remote server returned an error: (500) Internal Server Error.

[WebException: The remote server returned an error: (500) Internal Server Error.]
System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) +338
System.Net.WebClient.DownloadData(Uri address) +181
System.Net.WebClient.DownloadData(String address) +26

What could be the problem.

0 comments:

Post a Comment