Surendra Sharma

Surendra Sharma

Search This Blog

Saturday, July 18, 2015

How to provide internal and external links in rich text editor of Sitecore


It’s a basic but very useful tip that how to provide internal and external links in Sitecore.

If we are providing contents in rich text editor then it’s possible that it may contain some hyperlinks which targeting either external site or internal pages of same site.

How to do that?

Open rich text editor by clicking “Show Editor” link of rich text field.


As indicated in above image there are two toolbox items.

1.    First one is for inserting Internal links for Sitecore items


2.    Another is for external links from External links manager. As shown in image I provided link details for Google.


 Please leave your comments or share this tip if it’s useful for you.

Wednesday, July 15, 2015

Didn’t getting selected value of JQuery populated dropdownlist on server side



I was working on ASP.NET page which contains Country and State dropdown list. I filled country dropdown using JQuery AJAX. Now on selected value of Country I want to fill related states. I told my manager that it’s a simple task and will complete it in 3 hours including testing.

And next one hour I was just trying to get value of selected country in C# ;)

I tried with ddlCountry.selectedvalue but OMG I was not getting selected value.

How to get the dropdown selected value?

As we are filling dropdown list at client side so server side code don’t have any idea about the filled items. So in this situation use Request object as below

string country = Request[ddlCountry.UniqueID];

Now I was able to get the selected country in C# code.

Keep in mind that after getting value if there is another postback, you will not get the same country from Request[ddlCountry.UniqueID]. So during first time itself keep it in Viewstate so that you can use it after several post back as well.

One last thing, I completed this task in 3 hours as I told to my manager :)

Please leave your comments or share this tip if it’s useful for you.

Monday, July 13, 2015

The "GeneratePackage" task failed unexpectedly error



If you are trying to set TDS for your Sitecore ASP.NET project and you are getting error The "GeneratePackage" task failed unexpectedly. then its indication that you have not installed TDS correctly.

The detail error is

The "GeneratePackage" task failed unexpectedly.
System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at HedgehogDevelopment.SitecoreProject.Tasks.GeneratePackage.Execute()
   at Microsoft.Build.BuildEngine.TaskEngine.ExecuteInstantiatedTask(EngineProxy engineProxy, ItemBucket bucket, TaskExecutionMode howToExecuteTask, ITask task, Boolean& taskResult)          C:\Program Files (x86)\MSBuild\HedgehogDevelopment\SitecoreProject\v9.0\HedgehogDevelopment.SitecoreProject.targets 106                6

How to fix it?

Solution:

Open “C:\Program Files (x86)\MSBuild\HedgehogDevelopment\SitecoreProject\v9.0” folder and check it must contain below files



If any files are missing then copy all missing files from another colleague or friend computer where TDS is working and paste into your system on the same mentioned folder.

That’s it. Your TDS package will start to work now :)

Please leave your comments or share this trick if it’s useful for you.