Rami 的个人资料You must enter a title b...照片日志列表更多 工具 帮助

日志


11月4日

Make your DotNetNuke Module Searchable

Hi,
If you were from those who using DotNetNuke content management system, and you have your own customized module, and wondering how to make these modules searchable, Do the following:

1- Go to your Controller class in your module (or any name you naming the class, the class which handle database requests, usually called [moduleName]Controller), and make it implements ISearchable Interface
VB:
Implements Entities.Modules.ISearchable
C#:
: Entities.Modules.ISearchable

2- Implement GetSearchItems function
VB:
Public Function GetSearchItems(ByVal ModInfo As Entities.Modules.ModuleInfo) _ As Services.Search.SearchItemInfoCollection Implements Entities.Modules.ISearchable.GetSearchItems ' Get the Surveys for this Module instance
Dim colSurveys As List(Of SurveyInfo) = GetSurveys(ModInfo.ModuleID)
Dim SearchItemCollection As New SearchItemInfoCollection
Dim SurveyInfo As SurveyInfo
For Each SurveyInfo In colSurveys
Dim SearchItem As SearchItemInfo SearchItem = New SearchItemInfo _
(ModInfo.ModuleTitle & " - " & SurveyInfo.Question, _ SurveyInfo.Question, _ SurveyInfo.CreatedByUser, _ SurveyInfo.CreatedDate, ModInfo.ModuleID, _ SurveyInfo.SurveyId, _ SurveyInfo.Question) SearchItemCollection.Add(SearchItem) Next
Return SearchItemCollection
End Function

C#:
public SearchItemInfoCollection GetSearchItems(DotNetNuke.Entities.Modules.ModuleInfo ModInfo)
{
// Get the Surveys for this Module instance
List<SurveyInfo> colSurveys = GetSurveys(ModInfo.ModuleID);
SearchItemInfoCollection SearchItemCollection = new SearchItemInfoCollection();
foreach (SurveyInfo SurveyInfo in colSurveys)
{
 SearchItemInfo SearchItem; SearchItem = new SearchItemInfo (ModInfo.ModuleTitle + " - " + SurveyInfo.Question, SurveyInfo.Question, SurveyInfo.CreatedByUser, SurveyInfo.CreatedDate, ModInfo.ModuleID, Convert.ToString(SurveyInfo.SurveyId), SurveyInfo.Question); SearchItemCollection.Add(SearchItem);
}
return SearchItemCollection;
}

Now these search items will be saved in DNN database to perform search operation on them

3- Go to your module definition page and under supported Features you can see 'searchable' is checked, which mean it has been activated

Thank you

11月3日

Unable to start debugging on the web server. The type initializer for 'System.Net.DigestClinet' threw an exception.

If you have troubled with this exception when trying to start debugging your web application that hosted in IIS, try on of the following:

·         Check if there is any DLL in bin directory called Security.dll, and rename it using its own project

·         Check IIS ASP.NET Version, should be 2.0….

·         Check web.config for

o   <configuration>
  <system.net>
    <authenticationModules>
      <add type="System.Net.DigestClient" />
    </authenticationModules>
  </system.net>
</configuration>

o   and see if something looks odd (like some incorrect values for Version for the System.Net.DigestClient authentication module.

References:

http://social.msdn.microsoft.com/forums/en-US/vsdebug/thread/9d30fcfd-c872-478c-817e-52e184eb5e55/

http://social.msdn.microsoft.com/forums/en-US/vsdebug/thread/a79fb2ce-8ac6-4092-831b-9858aef72102/