Comments disabled

I disabled the comments because of the huge amounts of spam I’m receiving. So if you have any questions you can contact me trough linked-in.

Sorry for the inconvenience.

Asp.Net: Using a Usercontrol property with ObjectDataSource selectparameter

I was using a ObjectDataSource to generate a listing including paging. The ObjectDataSource used the GetItems method of my usercontrol. See this previous post. This construction works great. But now I needed to do some custom filtering in the GetItems method based on a property of the usercontrol. At first I tried to use the property directly in the GetItems method, this didn’t work the property the property returned NULL. After a small search on the internet I found the following blog post.

The solution is to dynamically add a Selectparameter that will be passed to the GetItems method. You can dynamically add Selectparameters at the OnSelecting event of the asp:ObjectDataSource,  like this:






And in you codebehind:


protected void odsListing_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
{
 e.InputParameters["ListingDataSourceId"] = <em>YourUsercontrolProperty</em>;
}


Now you can use YourUsercontrolProperty in the Select method of your ObjectDataSource.


public Sitecore.Collections.ItemList getItems(string <strong>myProperty</strong>)
{
  // Your selection logica
  // You can use the string <strong>myProperty</strong> for filtering
}


Hope it helps.

Running WCF on IIS 7 (Vista)

I got the following errors when trying to run WCF on Vista:

The remote server returned an unexpected response: (404) Not Found.

HTTP Error 404.2 – Not Found
Description: The page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the Web server.


– Add Mime Type: .svc : application/octet-stream

– run C:WindowsMicrosoft.NETFrameworkv3.0Windows Communication FoundationServiceModelReg.exe -i

http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/ce4c440a-1664-4695-b89c-a4790e2e865f/

Set: IIS Handler Mappings: *.svc extentsion to script

SILVERLIGHT WCF

XAP
Clientconfig:<endpoint address="http://hu.bachelor/HU%20Bachelor%203.Web/WebService.svc"