Today, in this article let's concentrate on another SilverLight application, whereby communicating with a WCF Service to perform some operation.

Question:What is Linked and Multicolumn Text?

In simple terms "It enables content to render on browser as per column wise when the text is over flown. So for this we can linkup textbox with other, to make sure it flows into next textbox control when the current textbox is full with the content".

Let's get this implemented practically for a better idea of this.

Step 1 : The complete code of the IService1.cs looks like this.

Code

using System;

using System.Collections.Generic;

using System.Linq;

using System.Runtime.Serialization;

using System.ServiceModel;

using System.ServiceModel.Web;

using System.Text;

Namespace WCF_Linked_Text

{

// NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.

[ServiceContract]

PublicInterfaceIService1

{

[OperationContract]

stringtext1();

[OperationContract]

stringtext2();

}

}

Step 2 : The complete code of the Service1.svc.cs looks like this.

Code

using System;

using System.Collections.Generic;

using System.Linq;

using System.Runtime.Serialization;

using System.ServiceModel;

using System.ServiceModel.Web;

using System.Text;

namespace WCF_Linked_Text

{

// NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together.

publicclassService1 : IService1

{

public string text1()

{

return "RichTextBox 1 Message via WCF ";

}

public string text2()

{

return "RichTextBox 2 Message via WCF ";

}

}

}

Step 3 : The complete code of the Web.Config looks like this.

Code

<?xmlversion="1.0"?>

<configuration>

<system.web>

<compilationdebug="true"targetFramework="4.0" />

</system.web>

<system.serviceModel>

<behaviors>

<serviceBehaviors>

<behavior>

<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->

<serviceMetadatahttpGetEnabled="true"/>

<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->

<serviceDebugincludeExceptionDetailInFaults="false"/>

</behavior>

</serviceBehaviors>

</behaviors>

<serviceHostingEnvironmentmultipleSiteBindingsEnabled="true" />

</system.serviceModel>

<system.webServer>

<modulesrunAllManagedModulesForAllRequests="true"/>

</system.webServer>

</configuration>

Step 4 : The complete code of the Clientaccesspolicy.xml looks like this (to avoid cross domain problem in SilverLight).

Hey
Everyone, It's Vijay. I am SDE mostly up on Microsoft Technologies. If
you are thinking to know what I do mostly when at work. I get a chance to work
upon few Microsoft technologies. All the way along my core tech... Read more