Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the steps to add Open Search Feature to an existing ASP.NET MVC Website?

I notices when i go to some sites (include Stackoverflow) by Firefox a little blue circle shows I can add the site to my Search providers . so wanted to know how can add this feature to my MVC project . I Heared an XML file should be added ...

like image 240
ali62b Avatar asked Dec 09 '25 22:12

ali62b


1 Answers

Follow the instructions in this guide.

This is the meat and veg of it though...

The link in your master page:

<link rel="search" type="application/opensearchdescription+xml" href="http://mysite.com/browserplugin.xml" title="My Site Search" />  

The browserplugin.xml file mentioned above should look like this:

<?xml version="1.0"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
    <ShortName>My Site Search</ShortName>
    <Description>My Site Search</Description>
    <Image height="16" width="16" type="image/x-icon">http://mysite.com/favicon.ico</Image>
    <Url type="text/html" method="get" template="http://mysite.com/search/{searchTerms}"/>
</OpenSearchDescription>

Note that you should (obviously) change that urls appropriately according to your website. Specifically the Url in the OpenSearchDescription in order to match your search url.

like image 194
Dan Atkinson Avatar answered Dec 12 '25 14:12

Dan Atkinson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!