Created
March 15, 2022 22:39
-
-
Save dsolovay/814fd3191869be2b73b282589d1a8e6b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ Page %> | |
<%@ Import namespace="Sitecore.ContentSearch" %> | |
<%@ Import namespace="Sitecore.ContentSearch.SearchTypes" %> | |
<html> | |
<body> | |
<form runat=server> | |
<!-- <asp:textbox runat=server id=tb1 /> --> | |
<asp:button runat=server text=Click onclick=DoSearch /> | |
<script runat=server> | |
public void DoSearch(object sender, EventArgs e) { | |
using (var context = ContentSearchManager.GetIndex("sitecore_master_index").CreateSearchContext()) | |
{ | |
IQueryable<SearchResultItem> searchQuery = context.GetQueryable<SearchResultItem>().Where(item => item.Name == "Sitecore"); | |
grid.DataSource=searchQuery.ToArray(); | |
grid.DataBind(); | |
} | |
} | |
</script> | |
<br /><br /> | |
<asp:GridView id=grid runat=server /> | |
</form> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment