Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
here i am using html editor using which admin can enter the data in different format. now i need to search for the data of table to which the text entered by user to search matches either as heading or subheadings . how can i retrive dis????
,... plzz help
Posted
Comments
Not clear.
Rina nishi 5-Oct-14 0:16am    
i am using htmleditor in my website to enter the data in different format. now i hav a search query using which i can search the text entered by the user through either title or subtitle of the data... how can i do dis...how can i search through subtitles of data....
Get the data inside the editor in code. Then get the index of your search query inside that data. If index is -1, then it is absent. Otherwise present.
Rina nishi 5-Oct-14 1:40am    
sorry bt didn't get it.... how to index the query... can u give me hint more or link for reference...
Look. In code, you can get the editor text, right? Something like...

string contents = editorID.Text;

I am not sure of the syntax though.

Now, you have to search something in the text. You can do like...

string searchText = "text to search";
int index = contents.IndexOf(searchText);

if(index = -1)
{
// Search Text not present
}
else if(index > 0)
{
// Match found.
}

But I am not sure what you are saying about Heading and Sub Heading...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900