I am following the Webmatrix tutorial to add search to my site using the web helper install; however, the magnifying glass does not show in the search box, but the search works fine.
So, I quickly used a new template to check if my site had an error; but, the same happened in the template.
Does anyone have any ideas why please? Or, how I can get the icon to show?
Should there be an icon in the images folder? In the tutorial it all looks fine.
This is uni work and I am running out of time, and the site looks naff with no icon in the search box.
<div>
<h1>Bing Search</h1>
<p>Search displays results by opening a new browser window that shows the Bing home page with search results.</p>
Search the ASP.NET site: <br/>
@Bing.SearchBox()
</div>
</body>
</html>
I have now tried to add the advanced search box as per the tutorial and I am getting the below error. Could the magnifying glass not showing and this be related?
Update - I have been to another PC and installed Webmatrix and all the supporting software including the web helper.
At that PC too, the magnifying glass in the Bing search box did not show - at least I now know that the issue is not my PC!
Can anybody please help me with this: It takes 2 minutes to create a site from a template, create a .cshtml Search page and drop in the three lines of code:
Requests for the image referenced by the Helper results in a 404 not found error. So what you can do is go here: http://www.bing.com/fd/s/a/h9.png and save the portion of the sprite that you need locally, then
use jQuery to add it to the rendered searchbox:
Please excuse me; the course that I am doing is Computing in Business; so, most of my time is spent on other topics, then I have to switch back to learning to programme in next no-time.
I have tried the J query script in different sections of the search page and I have placed the icon in the images folder and named it bing - yet it still does not appear.
Although, I have Googled for answers all I can come up with is that the script may need declaring. Should I add something like:
<script>
$(function(){
$('input[type=image]').attr('src', '/images/bing.png');
});
</script>
}
<!DOCTYPE html>
<html>
<head>
<title>Bing Search Box</title>
</head>
<body>
<div>
<h1>Bing Search</h1>
<p>Search displays results by opening a new browser window that shows the Bing home page with search results.</p>
Search the ASP.NET site: <br/>
@Bing.SearchBox()
DaniB
Member
24 Points
81 Posts
Bing Magnifying Glass Icon Is Not Showing in Search Box
Apr 20, 2012 08:28 PM|LINK
Hello Everyone.
I am following the Webmatrix tutorial to add search to my site using the web helper install; however, the magnifying glass does not show in the search box, but the search works fine.
So, I quickly used a new template to check if my site had an error; but, the same happened in the template.
Does anyone have any ideas why please? Or, how I can get the icon to show?
Should there be an icon in the images folder? In the tutorial it all looks fine.
This is uni work and I am running out of time, and the site looks naff with no icon in the search box.
Below is the link and code that I am using.
Please help. Thanks.
http://www.asp.net/web-pages/tutorials/email-and-search/12-adding-search-to-your-web-site
___________________________________________
@{
Bing.SiteUrl = "www.asp.net";
Bing.SiteTitle = "ASP.NET Custom Search";
}
<!DOCTYPE html>
<html>
<head>
<title>Bing Search Box</title>
</head>
<body>
<div>
<h1>Bing Search</h1>
<p>Search displays results by opening a new browser window that shows the Bing home page with search results.</p>
Search the ASP.NET site: <br/>
@Bing.SearchBox()
</div>
</body>
</html>
DaniB
Member
24 Points
81 Posts
Re: Bing Magnifying Glass Icon Is Not Showing in Search Box
Apr 20, 2012 10:44 PM|LINK
I have now tried to add the advanced search box as per the tutorial and I am getting the below error. Could the magnifying glass not showing and this be related?
The code that I am using is:
<div>@Bing.AdvancedSearchBox(
siteName: "Contoso Hotel",
boxWidth: 250,
resultWidth: 600,
resultHeight: 700,
themeColor: "Green",
locale: "en-US")
</div>
___________________________________________________________________
Compiler Error Message: CS0117: 'Microsoft.Web.Helpers.Bing' does not contain a definition for 'AdvancedSearchBox'
Source Error:
Line 20: >br> Line 21: <div> Line 22: @Bing.AdvancedSearchBox( Line 23: siteName: "Contoso Hotel", Line 24: boxWidth: 250,Source File: c:\Users\User\Documents\Phot_Gal_24_4\Photo Gallery\Search.cshtml Line: 22
DaniB
Member
24 Points
81 Posts
Re: Bing Magnifying Glass Icon Is Not Showing in Search Box
Apr 21, 2012 05:04 PM|LINK
Hello.
Update - I have been to another PC and installed Webmatrix and all the supporting software including the web helper.
At that PC too, the magnifying glass in the Bing search box did not show - at least I now know that the issue is not my PC!
Can anybody please help me with this: It takes 2 minutes to create a site from a template, create a .cshtml Search page and drop in the three lines of code:
__________________________________
@{Bing.SiteUrl = "www.asp.net";
Bing.SiteTitle = "ASP.NET Custom Search";
}
@Bing.SearchBox()
_______________________________________
Does the site need to be published to show the magnifying glass in the search box PLEASE? Do you get the same issue.
Thanks.
D.
Mikesdotnett...
All-Star
154927 Points
19867 Posts
Moderator
MVP
Re: Bing Magnifying Glass Icon Is Not Showing in Search Box
Apr 21, 2012 08:59 PM|LINK
Requests for the image referenced by the Helper results in a 404 not found error. So what you can do is go here: http://www.bing.com/fd/s/a/h9.png and save the portion of the sprite that you need locally, then use jQuery to add it to the rendered searchbox:
<script> $(function(){ $('input[type=image]').attr('src', '/images/bing.png'); }); </script>Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter
DaniB
Member
24 Points
81 Posts
Re: Bing Magnifying Glass Icon Is Not Showing in Search Box
Apr 21, 2012 09:14 PM|LINK
Thank you, SO MUCH Mike.
I will try now.
DaniB
Member
24 Points
81 Posts
Re: Bing Magnifying Glass Icon Is Not Showing in Search Box
Apr 21, 2012 09:46 PM|LINK
Thanks Mike.
Please excuse me; the course that I am doing is Computing in Business; so, most of my time is spent on other topics, then I have to switch back to learning to programme in next no-time.
I have tried the J query script in different sections of the search page and I have placed the icon in the images folder and named it bing - yet it still does not appear.
Although, I have Googled for answers all I can come up with is that the script may need declaring. Should I add something like:
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.8/jquery-ui.min.js"type="text/javascript"></script>__________________________
Here is the page:
@{
Bing.SiteUrl = "www.asp.net";
Bing.SiteTitle = "ASP.NET Custom Search";
<script>
$(function(){
$('input[type=image]').attr('src', '/images/bing.png');
});
</script>
}
<!DOCTYPE html>
<html>
<head>
<title>Bing Search Box</title>
</head>
<body>
<div>
<h1>Bing Search</h1>
<p>Search displays results by opening a new browser window that shows the Bing home page with search results.</p>
Search the ASP.NET site: <br/>
@Bing.SearchBox()
</body>
</html>
________________________________
Thanks again.