[英]Page refresh does not load the search results on customized coreresultswebpart sharepoint 2010
I have inherited the coreresultswebpart in a custom webpart that I am building in sharepoint 2010. The reason for this is because there are some properties that I want to set by default, without any manual entry. 我已经在sharepoint 2010中构建的自定义Webpart中继承了coreresultswebpart。其原因是因为有一些属性是我想默认设置的,没有任何手动输入。
The webpart is working fine except, when the webpart is loaded in the page, it does not immediately show the results (search result exists for the default configurations). 该Web部件工作正常,除了在页面中加载该Web部件时,该Web部件不会立即显示结果(对于默认配置,搜索结果存在)。 But when I hit the enter key on the adress bar, the results are loaded.
但是,当我按下地址栏上的Enter键时,结果将被加载。 The results are also loaded when I am in edit mode.
当我处于编辑模式时,也会加载结果。 However, when I click OK in the editorpart, the results vanish and the webpart tells me to refresh page, at which point, the same cycle repeats.
但是,当我在editorpart中单击OK时,结果消失了,并且webpart告诉我刷新页面,这时,重复相同的循环。
What am I missing? 我想念什么?
Here is a code snippet of where I am making the change: 这是我进行更改的代码段:
protected override void OnLoad(EventArgs e)
{
CssRegistration.Register("/_layouts/WPLatestBlogFeed/LatestBlogFeed_CustomStyle.css");
base.OnLoad(e);
if (firstLoad)
{
firstLoad = false;
CustomizeWebPart();
}
}
try to override ConfigureDataSourceProperties Method. 尝试重写ConfigureDataSourceProperties方法。
protected override void ConfigureDataSourceProperties()
{
// run the base code
base.ConfigureDataSourceProperties();
CssRegistration.Register("/_layouts/WPLatestBlogFeed/LatestBlogFeed_CustomStyle.css");
base.OnLoad(e);
if (firstLoad)
{
firstLoad = false;
CustomizeWebPart();
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.