Knowledge base feed Knowledge base feed http://www.sitefinity.com/support/kb.aspx http://backend.userland.com/rss How to enable the Files provider for Images and Documents module in Sitefinity 3.7 SP3 <p>Sitefinity team received a lot of requests to implement a provider, which allows items in Images and Documents module to be stored on the File system. </p> <p>This is implemented out of the box in the latest service release. Here is how to enable it:</p> <p>1. Open your <strong>Sitefinity 3.7 SP3 web.config</strong> file.</p> <p>2. Add the following properties to the <strong>Libraries </strong>provider:</p> <p> </p> <div class="reCodeBlock" style="border: 1px solid #7f9db9; overflow-y: auto;"> <div style="background-color: #ffffff;"><span><span style="margin-left: 0px ! important;"><code style="color: #000000;">&lt;Libraries</code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;</code><span style="margin-left: 3px ! important; background-color: #f79646;"><code style="color: #000000;">streamingProviderName=</code><code style="color: blue;">"Files"</code></span></span></div> <div style="background-color: #ffffff;"><span><code>&nbsp;</code><span style="margin-left: 3px ! important; background-color: #f79646;"><code style="color: #000000;">streamingIsEnabled=</code><code style="color: blue;">"True"</code></span></span></div> <div style="background-color: #f8f8f8;"><span><code>&nbsp;</code><span style="margin-left: 3px ! important;"><code style="color: #000000;">...</code></span></span></div> </div> <p></p> <p>By setting <strong>streamingProviderName </strong>to <em>Files</em>, all items uploaded to Images and Documents module will be stored in <em>App_Data\Files\&lt;Provider Name&gt;</em>. This means if you have several Libraries providers, each provider will have its items in separate directories. </p> <p>If you want to go back with the database storage, the provider name should be changed to <strong>Nolics</strong>. If the property is missing, Sitefinity uses Nolics as default streaming provider. </p> <p></p> <p>A short note on the streaming setting - when streamingIsEnabled, Sitefinity is using its own streaming implementation. This setting must be ON, when the streamingProviderName is set to Files. </p> http://www.sitefinity.com/support/kb/sitefinity-3-x/how-to-enable-the-files-provider-for-images-and-documents-module-in-sitefinity-3-7-sp3.aspx Georgi Chokov http://www.sitefinity.com/support/kb/sitefinity-3-x/how-to-enable-the-files-provider-for-images-and-documents-module-in-sitefinity-3-7-sp3.aspx f871ca0d-5ec2-422f-8af5-0034b90a104e Mon, 15 Mar 2010 17:53:44 GMT How to reuse Sitefinity editor dialogs As you all may have noticed we use custom dialogs such as the Link Manager, Image Manager, and Documents Manager in Sitefinity rich text editor. These custom dialogs let you insert links from your website site map or add images and documents from your libraries. When you develop custom modules or controls you may wish to add those to your editor in order to reuse this functionality. This article will lead you through the steps you need to take to achieve this. <div><br /> </div> <div>First you need to add the commands to your editor tools file:</div> <div> <div class="reCodeBlock" style="border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f9db9; border-right-color: #7f9db9; border-bottom-color: #7f9db9; border-left-color: #7f9db9; overflow-y: auto; "> <div style="background-color: #ffffff; "><span><span style="margin-left: 0px !important; "><code style="color: #000000; ">&lt;</code><code style="color: #006699; font-weight: bold; ">tools</code> <code style="color: #808080; ">name</code><code style="color: #000000; ">=</code><code style="color: blue; ">"InsertToolbar"</code> <code style="color: #808080; ">dockable</code><code style="color: #000000; ">=</code><code style="color: blue; ">"false"</code><code style="color: #000000; ">&gt;</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>  </code><span style="margin-left: 6px !important; "><code style="color: #000000; ">&lt;</code><code style="color: #006699; font-weight: bold; ">tool</code> <code style="color: #808080; ">name</code><code style="color: #000000; ">=</code><code style="color: blue; ">"LibraryImageManager"</code> <code style="color: #808080; ">text</code><code style="color: #000000; ">=</code><code style="color: blue; ">"Insert an image"</code><code style="color: #000000; ">/&gt;</code></span></span></div> <div style="background-color: #ffffff; "><span><code>  </code><span style="margin-left: 6px !important; "><code style="color: #000000; ">&lt;</code><code style="color: #006699; font-weight: bold; ">tool</code> <code style="color: #808080; ">name</code><code style="color: #000000; ">=</code><code style="color: blue; ">"LibraryDocumentManager"</code> <code style="color: #808080; ">text</code><code style="color: #000000; ">=</code><code style="color: blue; ">"Insert a document"</code><code style="color: #000000; ">/&gt;</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>  </code><span style="margin-left: 6px !important; "><code style="color: #000000; ">&lt;</code><code style="color: #006699; font-weight: bold; ">tool</code> <code style="color: #808080; ">name</code><code style="color: #000000; ">=</code><code style="color: blue; ">"LinkManager"</code> <code style="color: #808080; ">text</code><code style="color: #000000; ">=</code><code style="color: blue; ">"Insert a link"</code> <code style="color: #808080; ">shortcut</code><code style="color: #000000; ">=</code><code style="color: blue; ">"CTRL+K"</code><code style="color: #000000; ">/&gt;</code></span></span></div> <div style="background-color: #ffffff; "><span><code>  </code><span style="margin-left: 6px !important; "><code style="color: #000000; ">...</code></span></span></div> <div style="background-color: #f8f8f8; "><span><span style="margin-left: 0px !important; "><code style="color: #000000; ">&lt;/</code><code style="color: #006699; font-weight: bold; ">tools</code><code style="color: #000000; ">&gt;</code></span></span></div> </div> <br /> </div> <div>Then you need to the control template containing your markup and add the following JavaScript code so that your editor is able to utilize the commands you have just added:</div> <div> <div class="reCodeBlock" style="border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #7f9db9; border-right-color: #7f9db9; border-bottom-color: #7f9db9; border-left-color: #7f9db9; overflow-y: auto; "> <div style="background-color: #ffffff; "><span><code>     </code><span style="margin-left: 15px !important; "><code style="color: #000000; ">&lt;telerik:RadCodeBlock ID=</code><code style="color: blue; ">"RadCodeBlock1"</code> <code style="color: #000000; ">runat=</code><code style="color: blue; ">"server"</code><code style="color: #000000; ">&gt;</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #000000; ">&lt;script type=</code><code style="color: blue; ">"text/javascript"</code><code style="color: #000000; ">&gt;</code></span></span></div> <div style="background-color: #ffffff; "><span><span style="margin-left: 0px !important; "><code style="color: #000000; ">&lt;!--</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>    </code><span style="margin-left: 12px !important; "><code style="color: #000000; ">Telerik.Web.UI.Editor.CommandList[</code><code style="color: blue; ">"LibraryImageManager"</code><code style="color: #000000; ">] = </code><code style="color: #006699; font-weight: bold; ">function</code><code style="color: #000000; ">(commandName, editor, args) {</code></span></span></div> <div style="background-color: #ffffff; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">editorArgs = editor.getSelectedElement();</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #006699; font-weight: bold; ">if</code> <code style="color: #000000; ">(!editorArgs.nodeName || </code><code style="color: #006699; font-weight: bold; ">typeof</code> <code style="color: #000000; ">(editorArgs.nodeName) == </code><code style="color: blue; ">"undefined"</code> <code style="color: #000000; ">|| editorArgs.nodeName != </code><code style="color: blue; ">"A"</code><code style="color: #000000; ">)</code></span></span></div> <div style="background-color: #ffffff; "><span><code>            </code><span style="margin-left: 36px !important; "><code style="color: #000000; ">editorArgs = editor.getSelection();</code></span></span></div> <div style="background-color: #f8f8f8; "><span><span style="margin-left: 0px !important; "> </span></span></div> <div style="background-color: #ffffff; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">myCallbackFunction = </code><code style="color: #006699; font-weight: bold; ">function</code><code style="color: #000000; ">(sender, args) {</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>            </code><span style="margin-left: 36px !important; "><code style="color: #006699; font-weight: bold; ">if</code> <code style="color: #000000; ">(</code><code style="color: #006699; font-weight: bold; ">typeof</code> <code style="color: #000000; ">(editorArgs.nodeName) != </code><code style="color: blue; ">"undefined"</code> <code style="color: #000000; ">&amp;&amp; editorArgs.nodeName == </code><code style="color: blue; ">"IMG"</code><code style="color: #000000; ">)</code></span></span></div> <div style="background-color: #ffffff; "><span><code>                </code><span style="margin-left: 48px !important; "><code style="color: #000000; ">args.parentNode.replaceChild(editorArgs, args);</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>            </code><span style="margin-left: 36px !important; "><code style="color: #006699; font-weight: bold; ">else</code> <code style="color: #000000; ">{</code></span></span></div> <div style="background-color: #ffffff; "><span><code>                </code><span style="margin-left: 48px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">cloned = args.cloneNode(</code><code style="color: #006699; font-weight: bold; ">true</code><code style="color: #000000; ">);</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>                </code><span style="margin-left: 48px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">div = args.ownerDocument.createElement(</code><code style="color: blue; ">"DIV"</code><code style="color: #000000; ">);</code></span></span></div> <div style="background-color: #ffffff; "><span><code>                </code><span style="margin-left: 48px !important; "><code style="color: #000000; ">div.appendChild(cloned);</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>                </code><span style="margin-left: 48px !important; "><code style="color: #000000; ">editorArgs.pasteHtml(div.innerHTML);</code></span></span></div> <div style="background-color: #ffffff; "><span><code>            </code><span style="margin-left: 36px !important; "><code style="color: #000000; ">}</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #000000; ">}</code></span></span></div> <div style="background-color: #ffffff; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">path = </code><code style="color: blue; ">'&lt;%= ((Telerik.Cms.Web.CmsPageBase)Page).ResolveCmsUrl("~/Sitefinity/UserControls/Dialogs/ImageEditorDialog.aspx") %&gt;'</code><code style="color: #000000; ">;</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #000000; ">editor.showExternalDialog(</code></span></span></div> <div style="background-color: #ffffff; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">path,</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">editorArgs,</code></span></span></div> <div style="background-color: #ffffff; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">750,</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">515,</code></span></span></div> <div style="background-color: #ffffff; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">myCallbackFunction,</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #006699; font-weight: bold; ">null</code><code style="color: #000000; ">,</code></span></span></div> <div style="background-color: #ffffff; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: blue; ">'ImageLibraryDialog'</code><code style="color: #000000; ">,</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #006699; font-weight: bold; ">true</code><code style="color: #000000; ">,</code></span></span></div> <div style="background-color: #ffffff; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #006699; font-weight: bold; ">false</code><code style="color: #000000; ">,</code></span></span></div> <div style="background-color: #ffffff; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #006699; font-weight: bold; ">true</code><code style="color: #000000; ">)</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>    </code><span style="margin-left: 12px !important; "><code style="color: #000000; ">};</code></span></span></div> <div style="background-color: #ffffff; "><span><span style="margin-left: 0px !important; "> </span></span></div> <div style="background-color: #f8f8f8; "><span><code>    </code><span style="margin-left: 12px !important; "><code style="color: #000000; ">Telerik.Web.UI.Editor.CommandList[</code><code style="color: blue; ">"LibraryDocumentManager"</code><code style="color: #000000; ">] = </code><code style="color: #006699; font-weight: bold; ">function</code><code style="color: #000000; ">(commandName, editor, args) {</code></span></span></div> <div style="background-color: #ffffff; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">editorArgs = editor.getSelectedElement();</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #006699; font-weight: bold; ">if</code> <code style="color: #000000; ">(!editorArgs.nodeName || </code><code style="color: #006699; font-weight: bold; ">typeof</code> <code style="color: #000000; ">(editorArgs.nodeName) == </code><code style="color: blue; ">"undefined"</code> <code style="color: #000000; ">|| editorArgs.nodeName != </code><code style="color: blue; ">"A"</code><code style="color: #000000; ">)</code></span></span></div> <div style="background-color: #ffffff; "><span><code>            </code><span style="margin-left: 36px !important; "><code style="color: #000000; ">editorArgs = editor.getSelection();</code></span></span></div> <div style="background-color: #f8f8f8; "><span><span style="margin-left: 0px !important; "> </span></span></div> <div style="background-color: #ffffff; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">myCallbackFunction = </code><code style="color: #006699; font-weight: bold; ">function</code><code style="color: #000000; ">(sender, args) {</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>            </code><span style="margin-left: 36px !important; "><code style="color: #006699; font-weight: bold; ">if</code> <code style="color: #000000; ">(</code><code style="color: #006699; font-weight: bold; ">typeof</code> <code style="color: #000000; ">(editorArgs.nodeName) != </code><code style="color: blue; ">"undefined"</code> <code style="color: #000000; ">&amp;&amp; editorArgs.nodeName == </code><code style="color: blue; ">"A"</code><code style="color: #000000; ">)</code></span></span></div> <div style="background-color: #ffffff; "><span><code>                </code><span style="margin-left: 48px !important; "><code style="color: #000000; ">args.parentNode.replaceChild(editorArgs, args);</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>            </code><span style="margin-left: 36px !important; "><code style="color: #006699; font-weight: bold; ">else</code> <code style="color: #000000; ">{</code></span></span></div> <div style="background-color: #ffffff; "><span><code>                </code><span style="margin-left: 48px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">cloned = args.cloneNode(</code><code style="color: #006699; font-weight: bold; ">true</code><code style="color: #000000; ">);</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>                </code><span style="margin-left: 48px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">div = args.ownerDocument.createElement(</code><code style="color: blue; ">"DIV"</code><code style="color: #000000; ">);</code></span></span></div> <div style="background-color: #ffffff; "><span><code>                </code><span style="margin-left: 48px !important; "><code style="color: #000000; ">div.appendChild(cloned);</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>                </code><span style="margin-left: 48px !important; "><code style="color: #000000; ">editorArgs.pasteHtml(div.innerHTML);</code></span></span></div> <div style="background-color: #ffffff; "><span><code>            </code><span style="margin-left: 36px !important; "><code style="color: #000000; ">}</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #000000; ">}</code></span></span></div> <div style="background-color: #ffffff; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">path = </code><code style="color: blue; ">'&lt;%= ((Telerik.Cms.Web.CmsPageBase)Page).ResolveCmsUrl("~/Sitefinity/UserControls/Dialogs/DocumentEditorDialog.aspx") %&gt;'</code><code style="color: #000000; ">;</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #000000; ">editor.showExternalDialog(</code></span></span></div> <div style="background-color: #ffffff; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">path,</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">editorArgs,</code></span></span></div> <div style="background-color: #ffffff; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">750,</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">515,</code></span></span></div> <div style="background-color: #ffffff; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">myCallbackFunction,</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #006699; font-weight: bold; ">null</code><code style="color: #000000; ">,</code></span></span></div> <div style="background-color: #ffffff; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: blue; ">'ImageLibraryDialog'</code><code style="color: #000000; ">,</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #006699; font-weight: bold; ">false</code><code style="color: #000000; ">,</code></span></span></div> <div style="background-color: #ffffff; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #006699; font-weight: bold; ">false</code><code style="color: #000000; ">,</code></span></span></div> <div style="background-color: #ffffff; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #006699; font-weight: bold; ">true</code><code style="color: #000000; ">)</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>    </code><span style="margin-left: 12px !important; "><code style="color: #000000; ">};</code></span></span></div> <div style="background-color: #ffffff; "><span><span style="margin-left: 0px !important; "> </span></span></div> <div style="background-color: #f8f8f8; "><span><code>    </code><span style="margin-left: 12px !important; "><code style="color: #000000; ">Telerik.Web.UI.Editor.CommandList[</code><code style="color: blue; ">"LinkManager"</code><code style="color: #000000; ">] = </code><code style="color: #006699; font-weight: bold; ">function</code><code style="color: #000000; ">(commandName, editor, args) {</code></span></span></div> <div style="background-color: #ffffff; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">editorArgs = editor.getSelectedElement();</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #006699; font-weight: bold; ">if</code> <code style="color: #000000; ">(!editorArgs.nodeName || </code><code style="color: #006699; font-weight: bold; ">typeof</code> <code style="color: #000000; ">(editorArgs.nodeName) == </code><code style="color: blue; ">"undefined"</code> <code style="color: #000000; ">|| editorArgs.nodeName != </code><code style="color: blue; ">"A"</code><code style="color: #000000; ">) {</code></span></span></div> <div style="background-color: #ffffff; "><span><code>            </code><span style="margin-left: 36px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">sel = editor.getSelection();</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>            </code><span style="margin-left: 36px !important; "><code style="color: #000000; ">editorArgs = sel;</code></span></span></div> <div style="background-color: #ffffff; "><span><code>            </code><span style="margin-left: 36px !important; "><code style="color: #000000; ">editorArgs.Html = sel.getHtml();</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>            </code><span style="margin-left: 36px !important; "><code style="color: #000000; ">editorArgs.Text = sel.getText();</code></span></span></div> <div style="background-color: #ffffff; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #000000; ">}</code></span></span></div> <div style="background-color: #f8f8f8; "><span><span style="margin-left: 0px !important; "> </span></span></div> <div style="background-color: #ffffff; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">myCallbackFunction = </code><code style="color: #006699; font-weight: bold; ">function</code><code style="color: #000000; ">(sender, args) {</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>            </code><span style="margin-left: 36px !important; "><code style="color: #006699; font-weight: bold; ">if</code> <code style="color: #000000; ">(</code><code style="color: #006699; font-weight: bold; ">typeof</code> <code style="color: #000000; ">(editorArgs.nodeName) != </code><code style="color: blue; ">"undefined"</code> <code style="color: #000000; ">&amp;&amp; editorArgs.nodeName == </code><code style="color: blue; ">"A"</code><code style="color: #000000; ">)</code></span></span></div> <div style="background-color: #ffffff; "><span><code>                </code><span style="margin-left: 48px !important; "><code style="color: #000000; ">args.parentNode.replaceChild(editorArgs, args);</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>            </code><span style="margin-left: 36px !important; "><code style="color: #006699; font-weight: bold; ">else</code> <code style="color: #000000; ">{</code></span></span></div> <div style="background-color: #ffffff; "><span><code>                </code><span style="margin-left: 48px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">cloned = args.cloneNode(</code><code style="color: #006699; font-weight: bold; ">true</code><code style="color: #000000; ">);</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>                </code><span style="margin-left: 48px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">div = args.ownerDocument.createElement(</code><code style="color: blue; ">"DIV"</code><code style="color: #000000; ">);</code></span></span></div> <div style="background-color: #ffffff; "><span><code>                </code><span style="margin-left: 48px !important; "><code style="color: #000000; ">div.appendChild(cloned);</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>                </code><span style="margin-left: 48px !important; "><code style="color: #000000; ">editorArgs.pasteHtml(div.innerHTML);</code></span></span></div> <div style="background-color: #ffffff; "><span><code>            </code><span style="margin-left: 36px !important; "><code style="color: #000000; ">}</code></span></span></div> <div style="background-color: #f8f8f8; "><span><span style="margin-left: 0px !important; "> </span></span></div> <div style="background-color: #ffffff; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #000000; ">}</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">path = </code><code style="color: blue; ">'&lt;%= ((Telerik.Cms.Web.CmsPageBase)Page).ResolveCmsUrl("~/Sitefinity/UserControls/Dialogs/LinksDialog.aspx") %&gt;'</code><code style="color: #000000; ">;</code></span></span></div> <div style="background-color: #ffffff; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #000000; ">editor.showExternalDialog(</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">path,</code></span></span></div> <div style="background-color: #ffffff; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">editorArgs,</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">750,</code></span></span></div> <div style="background-color: #ffffff; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">515,</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">myCallbackFunction,</code></span></span></div> <div style="background-color: #ffffff; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #006699; font-weight: bold; ">null</code><code style="color: #000000; ">,</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: blue; ">'ImageLibraryDialog'</code><code style="color: #000000; ">,</code></span></span></div> <div style="background-color: #ffffff; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #006699; font-weight: bold; ">false</code><code style="color: #000000; ">,</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,</code></span></span></div> <div style="background-color: #ffffff; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #006699; font-weight: bold; ">false</code><code style="color: #000000; ">,</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #006699; font-weight: bold; ">true</code><code style="color: #000000; ">)</code></span></span></div> <div style="background-color: #ffffff; "><span><code>    </code><span style="margin-left: 12px !important; "><code style="color: #000000; ">};</code></span></span></div> <div style="background-color: #f8f8f8; "><span><span style="margin-left: 0px !important; "> </span></span></div> <div style="background-color: #ffffff; "><span><code>    </code><span style="margin-left: 12px !important; "><code style="color: #000000; ">Telerik.Web.UI.Editor.CommandList[</code><code style="color: blue; ">"SetLinkProperties"</code><code style="color: #000000; ">] = </code><code style="color: #006699; font-weight: bold; ">function</code><code style="color: #000000; ">(commandName, editor, args) {</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">editorArgs = editor.getSelectedElement();</code></span></span></div> <div style="background-color: #ffffff; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #006699; font-weight: bold; ">if</code> <code style="color: #000000; ">(!editorArgs.nodeName || </code><code style="color: #006699; font-weight: bold; ">typeof</code> <code style="color: #000000; ">(editorArgs.nodeName) == </code><code style="color: blue; ">"undefined"</code> <code style="color: #000000; ">|| editorArgs.nodeName != </code><code style="color: blue; ">"A"</code><code style="color: #000000; ">)</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>            </code><span style="margin-left: 36px !important; "><code style="color: #000000; ">editorArgs = editor.getSelection();</code></span></span></div> <div style="background-color: #ffffff; "><span><span style="margin-left: 0px !important; "> </span></span></div> <div style="background-color: #f8f8f8; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">myCallbackFunction = </code><code style="color: #006699; font-weight: bold; ">function</code><code style="color: #000000; ">(sender, args) {</code></span></span></div> <div style="background-color: #ffffff; "><span><code>            </code><span style="margin-left: 36px !important; "><code style="color: #006699; font-weight: bold; ">if</code> <code style="color: #000000; ">(</code><code style="color: #006699; font-weight: bold; ">typeof</code> <code style="color: #000000; ">(editorArgs.nodeName) != </code><code style="color: blue; ">"undefined"</code> <code style="color: #000000; ">&amp;&amp; editorArgs.nodeName == </code><code style="color: blue; ">"A"</code><code style="color: #000000; ">)</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>                </code><span style="margin-left: 48px !important; "><code style="color: #000000; ">args.parentNode.replaceChild(editorArgs, args);</code></span></span></div> <div style="background-color: #ffffff; "><span><code>            </code><span style="margin-left: 36px !important; "><code style="color: #006699; font-weight: bold; ">else</code> <code style="color: #000000; ">{</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>                </code><span style="margin-left: 48px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">cloned = args.cloneNode(</code><code style="color: #006699; font-weight: bold; ">true</code><code style="color: #000000; ">);</code></span></span></div> <div style="background-color: #ffffff; "><span><code>                </code><span style="margin-left: 48px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">div = args.ownerDocument.createElement(</code><code style="color: blue; ">"DIV"</code><code style="color: #000000; ">);</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>                </code><span style="margin-left: 48px !important; "><code style="color: #000000; ">div.appendChild(cloned);</code></span></span></div> <div style="background-color: #ffffff; "><span><code>                </code><span style="margin-left: 48px !important; "><code style="color: #000000; ">editorArgs.pasteHtml(div.innerHTML);</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>            </code><span style="margin-left: 36px !important; "><code style="color: #000000; ">}</code></span></span></div> <div style="background-color: #ffffff; "><span><span style="margin-left: 0px !important; "> </span></span></div> <div style="background-color: #f8f8f8; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #000000; ">}</code></span></span></div> <div style="background-color: #ffffff; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">path = </code><code style="color: blue; ">'&lt;%= ((Telerik.Cms.Web.CmsPageBase)Page).ResolveCmsUrl("~/Sitefinity/UserControls/Dialogs/LinksDialog.aspx") %&gt;'</code><code style="color: #000000; ">;</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #000000; ">editor.showExternalDialog(</code></span></span></div> <div style="background-color: #ffffff; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">path,</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">editorArgs,</code></span></span></div> <div style="background-color: #ffffff; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">750,</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">515,</code></span></span></div> <div style="background-color: #ffffff; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">myCallbackFunction,</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #006699; font-weight: bold; ">null</code><code style="color: #000000; ">,</code></span></span></div> <div style="background-color: #ffffff; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: blue; ">'ImageLibraryDialog'</code><code style="color: #000000; ">,</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #006699; font-weight: bold; ">false</code><code style="color: #000000; ">,</code></span></span></div> <div style="background-color: #ffffff; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #000000; ">Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #006699; font-weight: bold; ">false</code><code style="color: #000000; ">,</code></span></span></div> <div style="background-color: #ffffff; "><span><code>   </code><span style="margin-left: 9px !important; "><code style="color: #006699; font-weight: bold; ">true</code><code style="color: #000000; ">)</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>    </code><span style="margin-left: 12px !important; "><code style="color: #000000; ">};</code></span></span></div> <div style="background-color: #ffffff; "><span><span style="margin-left: 0px !important; "> </span></span></div> <div style="background-color: #f8f8f8; "><span><code>    </code><span style="margin-left: 12px !important; "><code style="color: #000000; ">RadEditorCommandList[</code><code style="color: blue; ">"IncreaseSize"</code><code style="color: #000000; ">] = </code><code style="color: #006699; font-weight: bold; ">function</code><code style="color: #000000; ">(commandName, editor, oTool) {</code></span></span></div> <div style="background-color: #ffffff; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">currentWidth = editor.get_element().style.width; </code><code style="color: #008200; ">//get the width of Telerik RadEditor</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">currentHeight = editor.get_element().style.height; </code><code style="color: #008200; ">//get the heigh of Telerik RadEditor</code></span></span></div> <div style="background-color: #ffffff; "><span><span style="margin-left: 0px !important; "> </span></span></div> <div style="background-color: #f8f8f8; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #000000; ">editor.SetSize(currentWidth, currentHeight + 30); </code><code style="color: #008200; ">//set the height size of the editor to increase with 30px</code></span></span></div> <div style="background-color: #ffffff; "><span><code>    </code><span style="margin-left: 12px !important; "><code style="color: #000000; ">};</code></span></span></div> <div style="background-color: #f8f8f8; "><span><span style="margin-left: 0px !important; "> </span></span></div> <div style="background-color: #ffffff; "><span><code>    </code><span style="margin-left: 12px !important; "><code style="color: #000000; ">RadEditorCommandList[</code><code style="color: blue; ">"DecreaseSize"</code><code style="color: #000000; ">] = </code><code style="color: #006699; font-weight: bold; ">function</code><code style="color: #000000; ">(commandName, editor, oTool) {</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">currentWidth = editor.get_element().style.width;</code></span></span></div> <div style="background-color: #ffffff; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">currentHeight = editor.get_element().style.height;</code></span></span></div> <div style="background-color: #f8f8f8; "><span><span style="margin-left: 0px !important; "> </span></span></div> <div style="background-color: #ffffff; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #000000; ">editor.SetSize(currentWidth, currentHeight - 30); </code><code style="color: #008200; ">//set the height size of the editor to decrease with 30px</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>    </code><span style="margin-left: 12px !important; "><code style="color: #000000; ">};</code></span></span></div> <div style="background-color: #ffffff; "><span><code>    </code><span style="margin-left: 12px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">oldFunction = Telerik.Web.UI.Editor.CommandList[</code><code style="color: blue; ">"ToggleScreenMode"</code><code style="color: #000000; ">]; </code><code style="color: #008200; ">//save the original Paste function</code></span></span></div> <div style="background-color: #f8f8f8; "><span><span style="margin-left: 0px !important; "> </span></span></div> <div style="background-color: #ffffff; "><span><code>    </code><span style="margin-left: 12px !important; "><code style="color: #000000; ">Telerik.Web.UI.Editor.CommandList[</code><code style="color: blue; ">"ToggleScreenMode"</code><code style="color: #000000; ">] = </code><code style="color: #006699; font-weight: bold; ">function</code><code style="color: #000000; ">(commandName, editor, args) {</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #000000; ">oldFunction(commandName, editor, args);</code></span></span></div> <div style="background-color: #ffffff; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">bd = document.getElementsByTagName(</code><code style="color: blue; ">"body"</code><code style="color: #000000; ">)[0];</code></span></span></div> <div style="background-color: #f8f8f8; "><span><span style="margin-left: 0px !important; "> </span></span></div> <div style="background-color: #ffffff; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #006699; font-weight: bold; ">if</code> <code style="color: #000000; ">(/fullScreenMode/.test(bd.className)) {</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>            </code><span style="margin-left: 36px !important; "><code style="color: #006699; font-weight: bold; ">var</code> <code style="color: #000000; ">rep = bd.className.match(</code><code style="color: blue; ">' '</code> <code style="color: #000000; ">+ </code><code style="color: blue; ">'fullScreenMode'</code><code style="color: #000000; ">) ? </code><code style="color: blue; ">' '</code> <code style="color: #000000; ">+ </code><code style="color: blue; ">'fullScreenMode'</code> <code style="color: #000000; ">: </code><code style="color: blue; ">'fullScreenMode'</code><code style="color: #000000; ">;</code></span></span></div> <div style="background-color: #ffffff; "><span><code>            </code><span style="margin-left: 36px !important; "><code style="color: #000000; ">bd.className = bd.className.replace(rep, </code><code style="color: blue; ">''</code><code style="color: #000000; ">);</code></span></span></div> <div style="background-color: #f8f8f8; "><span><span style="margin-left: 0px !important; "> </span></span></div> <div style="background-color: #ffffff; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #000000; ">} </code><code style="color: #006699; font-weight: bold; ">else</code> <code style="color: #000000; ">{</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>            </code><span style="margin-left: 36px !important; "><code style="color: #000000; ">bd.className += bd.className ? </code><code style="color: blue; ">' '</code> <code style="color: #000000; ">+ </code><code style="color: blue; ">'fullScreenMode'</code> <code style="color: #000000; ">: </code><code style="color: blue; ">'fullScreenMode'</code><code style="color: #000000; ">;</code></span></span></div> <div style="background-color: #ffffff; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #000000; ">}</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>    </code><span style="margin-left: 12px !important; "><code style="color: #000000; ">}</code></span></span></div> <div style="background-color: #ffffff; "><span><span style="margin-left: 0px !important; "><code style="color: #000000; ">--&gt;</code></span></span></div> <div style="background-color: #f8f8f8; "><span><code>        </code><span style="margin-left: 24px !important; "><code style="color: #000000; ">&lt;/script&gt;</code></span></span></div> <div style="background-color: #ffffff; "><span><code>    </code><span style="margin-left: 12px !important; "><code style="color: #000000; ">&lt;/telerik:RadCodeBlock&gt;</code></span></span></div> </div> <br /> </div> <div>This JavaScirpt code can be found in any of the external templates for creating or editing new content items or in the control template for the Generic Content control.</div> <div><br /> </div> <div>For more information on creating custom dialogs for the editor you can take a look at the following article: <a href="http://www.telerik.com/help/aspnet-ajax/addcustomdialogs.html" title="How to create custom dialogs for the RadEdior">RadEditor: Add Custom Dialogs</a> </div> <div><br /> </div> http://www.sitefinity.com/support/kb/sitefinity-3-x/how-to-reuse-sitefinity-editor-dialogs.aspx Radoslav Georgiev http://www.sitefinity.com/support/kb/sitefinity-3-x/how-to-reuse-sitefinity-editor-dialogs.aspx 5a4b57e4-a101-4d27-a9b5-34fd078c1a0d Fri, 12 Feb 2010 11:58:11 GMT Detail mode of declaratively added controls throws Error 404 Not found The problem can be reproduced in 3.x versions when you use declaratively added ContentView based controls as NewsView, EventsView, ContentView, BlogPosts. The problem can be reproduced when you register the control in a template and try to navigate to the full content of an item. <p>&nbsp;</p> <p>Control/Page template</p> <div style="border: 1px solid #7f9db9; overflow: auto; background-color: white; line-height: 100% ! important; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; width: 99%; border-collapse: collapse; background-color: #ffffff;"> <col style="border-bottom: 1px solid #f7f7f7; font-family: courier new; font-size: 11px; padding-left: 10px; white-space: nowrap;" /> <tbody> <tr> <td><span style="font-size: 11px;"></span><span style="color: blue;">&lt;</span><span style="font-size: 11px;">%@&nbsp;Register&nbsp;</span><span style="color: red;">TagPrefix</span><span style="font-size: 11px;">=</span><span style="color: blue;">"sf"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">Namespace</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Telerik.News.WebControls"</span><span style="font-size: 11px;">&nbsp;&nbsp;</span><span style="color: red;">Assembly</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Telerik.News"</span><span style="font-size: 11px;">&nbsp;%</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;"><span style="color: blue;">&lt;</span><span style="font-size: 11px;">sf:NewsView&nbsp;</span><span style="color: red;">runat</span><span style="font-size: 11px;">=</span><span style="color: blue;">"server"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">ID</span><span style="font-size: 11px;">=</span><span style="color: blue;">"NewsView1"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">BehaviorMode</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Auto"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">ProviderName</span><span style="font-size: 11px;">=</span><span style="color: blue;">"News"</span><span style="font-size: 11px;">&gt;</span><span style="color: blue;">&lt;/</span><span style="font-size: 11px;">sf:NewsView</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> </tbody> </table> </div> <p></p> <p>&nbsp;</p> The problem lies in the UrlRewriterService that we use. Actually, all links are correct and it is hard to figure out what is going wrong. After some debugging, we managed to come up with a simple solution that requires to register Telerik.Web.UrlRewriterService in the code behind of your user control <p>&nbsp;</p> <p>Code Behind</p> <div style="border: 1px solid #7f9db9; overflow: auto; background-color: white; line-height: 100% ! important; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; width: 99%; border-collapse: collapse; background-color: #ffffff;"> <col style="border-bottom: 1px solid #f7f7f7; font-family: courier new; font-size: 11px; padding-left: 10px; white-space: nowrap;" /> <tbody> <tr style="background-color: #c00000;"> <td><span style="font-size: 11px;">[Telerik.Web.UrlRewriterService(</span><span style="color: blue;">"Telerik.Cms.Engine.ContentUrlRewriterService,&nbsp;Telerik.Cms.Engine"</span><span style="font-size: 11px;">)]&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;"><span style="color: blue;">public</span><span style="font-size: 11px;">&nbsp;partial&nbsp;</span><span style="color: blue;">class</span><span style="font-size: 11px;">&nbsp;TelerikSamples_SamppleControl:&nbsp;System.Web.UI.UserControl&nbsp;</span></td> </tr> <tr> <td>{&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">protected</span><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">void</span><span style="font-size: 11px;">&nbsp;Page_Load(</span><span style="color: blue;">object</span><span style="font-size: 11px;">&nbsp;sender,&nbsp;EventArgs&nbsp;e)&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">}&nbsp;</td> </tr> </tbody> </table> </div> <br /> http://www.sitefinity.com/support/kb/sitefinity-3-x/detail-mode-of-declaratively-added-controls-throws-error-404-not-found.aspx Ivan Dimitrov http://www.sitefinity.com/support/kb/sitefinity-3-x/detail-mode-of-declaratively-added-controls-throws-error-404-not-found.aspx 663331c1-9e4f-4759-85e5-b370f351d848 Tue, 26 Jan 2010 14:15:01 GMT RadioButtonList rendered as <ul> When you use RadioButtonList control in your Sitefinity website the button lists are always rendered as &lt;ul&gt; and setting the ReperatDirection="Horizontal" property of the RadioButtonList control does not take effect. This is because we use a custom <a title="ControlAdapter Class" href="http://msdn.microsoft.com/en-us/library/system.web.ui.adapters.controladapter.aspx">control adapter</a> fro rendering the control in Sitefinity. <p>&nbsp;</p> <p>In order to make the RadioButtonList control render the buttons horizontally you have two options: either remove the control adapter or provide custom styles for the RadioButtonList. The first option is not recommendable because removing the control adapter will break the appearance of RadioButton controls in the Sitefnity back-end. This can be done by removing the bellow line from ~/App_Browsers/BrowserFile.browser file:</p> <p> </p> <div style="border: 1px solid #7f9db9; overflow: auto; background-color: white; line-height: 100% ! important; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; width: 99%; border-collapse: collapse; background-color: #ffffff;"> <col style="border-bottom: 1px solid #f7f7f7; font-family: courier new; font-size: 11px; padding-left: 10px; white-space: nowrap;" /> <tbody> <tr> <td><span style="font-size: 11px;">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: blue;">&lt;</span><span style="font-size: 11px;">controlAdapters</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">adapter&nbsp;</span><span style="color: red;">controlType</span><span style="font-size: 11px;">=</span><span style="color: blue;">"System.Web.UI.WebControls.RadioButtonList"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">adapterType</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Telerik.Cms.Web.UI.Adapters.RadioButtonListAdapter"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">/&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;/</span><span style="font-size: 11px;">controlAdapters</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> </tbody> </table> </div> <p></p> <p>The preferred approach is to provide CSS rules in order to render the radio button lists on the same line. First set the CssClass property of the RadioButtonList control:</p> <p> </p> <div style="border: 1px solid #7f9db9; overflow: auto; background-color: white; line-height: 100% ! important; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; width: 99%; border-collapse: collapse; background-color: #ffffff;"> <col style="border-bottom: 1px solid #f7f7f7; font-family: courier new; font-size: 11px; padding-left: 10px; white-space: nowrap;" /> <tbody> <tr> <td><span style="font-size: 11px;">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: blue;">&lt;</span><span style="font-size: 11px;">asp:RadioButtonList&nbsp;</span><span style="color: red;">ID</span><span style="font-size: 11px;">=</span><span style="color: blue;">"RadioButtonList1"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">runat</span><span style="font-size: 11px;">=</span><span style="color: blue;">"server"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">CssClass</span><span style="font-size: 11px;">=</span><span style="color: blue;">"ButtonList"</span><span style="font-size: 11px;">&gt;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;/</span><span style="font-size: 11px;">asp:RadioButtonList</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> </tbody> </table> </div> <p></p> <p>Then use the bellow sample CSS rules to achieve the desired result:</p> <p> </p> <div style="border: 1px solid #7f9db9; overflow: auto; background-color: white; line-height: 100% ! important; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; width: 99%; border-collapse: collapse; background-color: #ffffff;"> <col style="border-bottom: 1px solid #f7f7f7; font-family: courier new; font-size: 11px; padding-left: 10px; white-space: nowrap;" /> <tbody> <tr> <td><span style="font-size: 11px;">.ButtonList&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">{&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red;">list-style-type</span><span style="font-size: 11px;">:</span><span style="color: blue;">none</span><span style="font-size: 11px;">;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red;">width</span><span style="font-size: 11px;">:&nbsp;100%;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red;">float</span><span style="font-size: 11px;">:&nbsp;</span><span style="color: blue;">left</span><span style="font-size: 11px;">;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red;">clear</span><span style="font-size: 11px;">:&nbsp;</span><span style="color: blue;">both</span><span style="font-size: 11px;">;&nbsp;</span></td> </tr> <tr> <td>}&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">.ButtonList&nbsp;li&nbsp;</td> </tr> <tr> <td>{&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red;">float</span><span style="font-size: 11px;">:&nbsp;</span><span style="color: blue;">left</span><span style="font-size: 11px;">;&nbsp;</span></td> </tr> <tr> <td>}&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;</td> </tr> </tbody> </table> </div> <p></p> http://www.sitefinity.com/support/kb/sitefinity-3-x/radiobuttonlist-rendered-as-ul.aspx Radoslav Georgiev http://www.sitefinity.com/support/kb/sitefinity-3-x/radiobuttonlist-rendered-as-ul.aspx 7ac0a3f1-6101-4b64-be3a-d544c76551a2 Thu, 21 Jan 2010 13:11:17 GMT Newsletters module not sending e-mails You have probably experienced this when you have valid SMTP settings for your Newsletters module and have sent/received the test e-mail that the SMTP settings are valid, however when you go to send your news letter it sends several e-mails and then "freezes." There are three major reasons for this and this KB article will help you deal with them. <p>&nbsp;</p> <p>The first reason for the newsletter sending to "freeze" is that the SMTP server has been flooded with too many e-mails at the same time. In order to deal with this issue you can just increase the interval for sending e-mails. This way you can set the newsletter manager to send e-mails every <strong>N milliseconds</strong>. To configure this go to your web.config find the notifications configuration section and edit the sending interval property:</p> <p></p> <div style="border: 1px solid #7f9db9; overflow: auto; background-color: white; line-height: 100% ! important; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; width: 99%; border-collapse: collapse; background-color: #ffffff;"> <col style="border-bottom: 1px solid #f7f7f7; font-family: courier new; font-size: 11px; padding-left: 10px; white-space: nowrap;" /> <tbody> <tr> <td><span style="font-size: 11px;"></span><span style="color: blue;">&lt;</span><span style="font-size: 11px;">notifications&nbsp;</span><span style="color: red;">defaultProvider</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Notifications"</span><span style="font-size: 11px;">&gt;&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">providers</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">clear</span><span style="color: blue;">/&gt;</span><span style="font-size: 11px;">&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">add&nbsp;</span><span style="color: red;">name</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Notifications"</span><span style="font-size: 11px;">&nbsp;&nbsp;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red;">type</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Telerik.Notifications.Data.DefaultProvider,&nbsp;Telerik.Notifications.Data"</span><span style="font-size: 11px;">&nbsp;&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red;">connectionStringName</span><span style="font-size: 11px;">=</span><span style="color: blue;">"DefaultConnection"</span><span style="font-size: 11px;">&nbsp;&nbsp;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red;">EnableSsl</span><span style="font-size: 11px;">=</span><span style="color: blue;">"false"</span><span style="font-size: 11px;">&nbsp;&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red;">MergedFields</span><span style="font-size: 11px;">=</span><span style="color: blue;">"FirstName;LastName"</span><span style="font-size: 11px;">&nbsp;&nbsp;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red; background-color: #ffff00;">SendingInterval</span><span style="font-size: 11px; background-color: #ffff00;">=</span><span style="color: blue; background-color: #ffff00;">"1000"</span><span style="font-size: 11px;">/&gt;&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;/</span><span style="font-size: 11px;">providers</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;</td> </tr> </tbody> </table> </div> <br /> <p></p> <p>The second and third reasons for the newsletter sending to stall are that your subscribers have entered invalid data for first and last name and e-mails. The first and last names for subscribers must consist of English alpha-numeric characters and the requirement for emails is that they are valid. You can customize newsletter subscription control template and use regular expressions to check the validity of data entered. <span class="text" id="ctl13_repeaterMessages_ctl00_lblMessageText"> To do this<strong> </strong>go to <strong>~/Sitefinity/ControlTemplates/Newsletters/SubscriptionFormTemplate.ascx</strong>. If you are using e-mail only mode for the subscription form you should add reg ex validator only to textbox with ID sf1_email. If mode with e-mails and names is used add validators to text controls that are in <strong>emailNamehldr </strong>placeholder. Bellow are sample regular expression validators which will validate the e-mails and first name:</span></p> <p></p> <div style="border: 1px solid #7f9db9; overflow: auto; background-color: white; line-height: 100% ! important; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; width: 99%; border-collapse: collapse; background-color: #ffffff;"> <col style="border-bottom: 1px solid #f7f7f7; font-family: courier new; font-size: 11px; padding-left: 10px; white-space: nowrap;" /> <tbody> <tr> <td><span style="font-size: 11px;"></span><span style="color: blue;">&lt;</span><span style="font-size: 11px;">li</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">asp:Label&nbsp;</span><span style="color: red;">ID</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Label1"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">runat</span><span style="font-size: 11px;">=</span><span style="color: blue;">"server"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">Text</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Email:"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">AssociatedControlID</span><span style="font-size: 11px;">=</span><span style="color: blue;">"sf2_email"</span><span style="font-size: 11px;">&gt;</span><span style="color: blue;">&lt;/</span><span style="font-size: 11px;">asp:Label</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">asp:TextBox&nbsp;</span><span style="color: red;">runat</span><span style="font-size: 11px;">=</span><span style="color: blue;">"server"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">ID</span><span style="font-size: 11px;">=</span><span style="color: blue;">"sf2_email"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">CssClass</span><span style="font-size: 11px;">=</span><span style="color: blue;">"sf_subscribeTxt"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">ValidationGroup</span><span style="font-size: 11px;">=</span><span style="color: blue;">"subscription"</span><span style="font-size: 11px;">&gt;</span><span style="color: blue;">&lt;/</span><span style="font-size: 11px;">asp:TextBox</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">asp:RequiredFieldValidator&nbsp;</span><span style="color: red;">ID</span><span style="font-size: 11px;">=</span><span style="color: blue;">"emailEmptyValidator2"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">runat</span><span style="font-size: 11px;">=</span><span style="color: blue;">"server"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">CssClass</span><span style="font-size: 11px;">=</span><span style="color: blue;">"sf_emailValidation"</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red;">ValidationGroup</span><span style="font-size: 11px;">=</span><span style="color: blue;">"subscription"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">ControlToValidate</span><span style="font-size: 11px;">=</span><span style="color: blue;">"sf2_email"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">Display</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Dynamic"</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red;">EnableViewState</span><span style="font-size: 11px;">=</span><span style="color: blue;">"False"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">SetFocusOnError</span><span style="font-size: 11px;">=</span><span style="color: blue;">"True"</span><span style="font-size: 11px;">&gt;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">strong</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&lt;</span><span style="color: black; font-weight: bold;">asp</span><span style="font-size: 11px;">:Literal&nbsp;</span><span style="color: red;">ID</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Literal7"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">runat</span><span style="font-size: 11px;">=</span><span style="color: blue;">"server"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">Text</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Email&nbsp;cannot&nbsp;be&nbsp;empty!"</span><span style="font-size: 11px;">&gt;</span><span style="color: blue;">&lt;/</span><span style="font-size: 11px;">asp:Literal</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&lt;/</span><span style="color: black; font-weight: bold;">strong</span><span style="font-size: 11px;">&gt;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;/</span><span style="font-size: 11px;">asp:RequiredFieldValidator</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr style="background-color: #ffff00;"> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">asp:RegularExpressionValidator&nbsp;</span><span style="color: red;">ID</span><span style="font-size: 11px;">=</span><span style="color: blue;">"emailREValidator2"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">runat</span><span style="font-size: 11px;">=</span><span style="color: blue;">"server"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">CssClass</span><span style="font-size: 11px;">=</span><span style="color: blue;">"sf_emailValidation"</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr style="background-color: #ffff00;"> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red;">ControlToValidate</span><span style="font-size: 11px;">=</span><span style="color: blue;">"sf2_email"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">Display</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Dynamic"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">EnableViewState</span><span style="font-size: 11px;">=</span><span style="color: blue;">"false"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">SetFocusOnError</span><span style="font-size: 11px;">=</span><span style="color: blue;">"true"</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr style="background-color: #ffff00;"> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red;">ValidationExpression</span><span style="font-size: 11px;">=</span><span style="color: blue;">"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">ValidationGroup</span><span style="font-size: 11px;">=</span><span style="color: blue;">"subscription"</span><span style="font-size: 11px;">&gt;&nbsp;</span></td> </tr> <tr style="background-color: #ffff00;"> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">strong</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&lt;</span><span style="color: black; font-weight: bold;">asp</span><span style="font-size: 11px;">:Literal&nbsp;</span><span style="color: red;">ID</span><span style="font-size: 11px;">=</span><span style="color: blue;">"literal22"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">runat</span><span style="font-size: 11px;">=</span><span style="color: blue;">"server"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">Text</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Wrong&nbsp;email!"</span><span style="font-size: 11px;">&gt;</span><span style="color: blue;">&lt;/</span><span style="font-size: 11px;">asp:Literal</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&lt;/</span><span style="color: black; font-weight: bold;">strong</span><span style="font-size: 11px;">&gt;&nbsp;</span></td> </tr> <tr style="background-color: #ffff00;"> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;/</span><span style="font-size: 11px;">asp:RegularExpressionValidator</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;"><span style="color: blue;">&lt;/</span><span style="font-size: 11px;">li</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td><span style="color: blue;">&lt;</span><span style="font-size: 11px;">li</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">asp:Label&nbsp;</span><span style="color: red;">ID</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Label2"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">runat</span><span style="font-size: 11px;">=</span><span style="color: blue;">"server"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">AssociatedControlID</span><span style="font-size: 11px;">=</span><span style="color: blue;">"sf_firstname"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">Text</span><span style="font-size: 11px;">=</span><span style="color: blue;">"First&nbsp;name:"</span><span style="font-size: 11px;">&gt;</span><span style="color: blue;">&lt;/</span><span style="font-size: 11px;">asp:Label</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">asp:TextBox&nbsp;</span><span style="color: red;">runat</span><span style="font-size: 11px;">=</span><span style="color: blue;">"server"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">CssClass</span><span style="font-size: 11px;">=</span><span style="color: blue;">"sf_subscribeTxt"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">ID</span><span style="font-size: 11px;">=</span><span style="color: blue;">"sf_firstname"</span><span style="font-size: 11px;">&gt;</span><span style="color: blue;">&lt;/</span><span style="font-size: 11px;">asp:TextBox</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr style="background-color: #ffff00;"> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">asp:RegularExpressionValidator&nbsp;</span><span style="color: red;">ID</span><span style="font-size: 11px;">=</span><span style="color: blue;">"firstNameValidator"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">runat</span><span style="font-size: 11px;">=</span><span style="color: blue;">"server"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">CssClass</span><span style="font-size: 11px;">=</span><span style="color: blue;">"sf_emailValidation"</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr style="background-color: #ffff00;"> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red;">ControlToValidate</span><span style="font-size: 11px;">=</span><span style="color: blue;">"sf_firstname"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">Display</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Dynamic"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">EnableViewState</span><span style="font-size: 11px;">=</span><span style="color: blue;">"false"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">SetFocusOnError</span><span style="font-size: 11px;">=</span><span style="color: blue;">"true"</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr style="background-color: #ffff00;"> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red;">ValidationExpression</span><span style="font-size: 11px;">=</span><span style="color: blue;">"^[a-zA-Z0-9]*$"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">ValidationGroup</span><span style="font-size: 11px;">=</span><span style="color: blue;">"subscription"</span><span style="font-size: 11px;">&gt;&nbsp;</span></td> </tr> <tr style="background-color: #ffff00;"> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">strong</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&lt;</span><span style="color: black; font-weight: bold;">asp</span><span style="font-size: 11px;">:Literal&nbsp;</span><span style="color: red;">ID</span><span style="font-size: 11px;">=</span><span style="color: blue;">"literal3"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">runat</span><span style="font-size: 11px;">=</span><span style="color: blue;">"server"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">Text</span><span style="font-size: 11px;">=</span><span style="color: blue;">"First&nbsp;name&nbsp;can&nbsp;contain&nbsp;only&nbsp;Elnglish&nbsp;alphanumeric&nbsp;characters"</span><span style="font-size: 11px;">&gt;</span><span style="color: blue;">&lt;/</span><span style="font-size: 11px;">asp:Literal</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&lt;/</span><span style="color: black; font-weight: bold;">strong</span><span style="font-size: 11px;">&gt;&nbsp;</span></td> </tr> <tr style="background-color: #ffff00;"> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;/</span><span style="font-size: 11px;">asp:RegularExpressionValidator</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td><span style="color: blue;">&lt;/</span><span style="font-size: 11px;">li</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;</td> </tr> </tbody> </table> </div> <br /> <p></p> <p>Once you have made sure that no faulty data will be entered you can check if the current subscribers have faulty date. For those purposes you can validate against the same regular expressions used above. Bellow is a sample how to check e-mail validity of all newsletters subscribers:</p> <div style="border: 1px solid #7f9db9; overflow: auto; background-color: white; line-height: 100% ! important; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; width: 99%; border-collapse: collapse; background-color: #ffffff;"> <col style="border-bottom: 1px solid #f7f7f7; font-family: courier new; font-size: 11px; padding-left: 10px; white-space: nowrap;" /> <tbody> <tr> <td><span style="font-size: 11px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: blue;">string</span><span style="font-size: 11px;">&nbsp;emailStrRegex&nbsp;=&nbsp;@</span><span style="color: blue;">"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}"</span><span style="font-size: 11px;">&nbsp;+&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@<span style="color: blue;">"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\"</span><span style="font-size: 11px;">&nbsp;+&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@<span style="color: blue;">".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"</span><span style="font-size: 11px;">;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.Text.RegularExpressions.Regex&nbsp;emailRegex&nbsp;=&nbsp;<span style="color: blue;">new</span><span style="font-size: 11px;">&nbsp;System.Text.RegularExpressions.Regex(emailStrRegex);&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Telerik.Notifications.Newsletters.DataManager&nbsp;newslettersManager&nbsp;=&nbsp;<span style="color: blue;">new</span><span style="font-size: 11px;">&nbsp;Telerik.Notifications.Newsletters.DataManager();&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">foreach</span><span style="font-size: 11px;">&nbsp;(Telerik.Newsletters.ISubscriber&nbsp;subscriber&nbsp;</span><span style="color: blue;">in</span><span style="font-size: 11px;">&nbsp;newslettersManager.GetSubscribers())&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">string</span><span style="font-size: 11px;">&nbsp;email&nbsp;=&nbsp;subscriber.Email;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">if</span><span style="font-size: 11px;">&nbsp;(!emailRegex.IsMatch(email))&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: green;">//output&nbsp;fauly&nbsp;email</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: green;">//you&nbsp;can&nbsp;also&nbsp;delete&nbsp;subscriber</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newslettersManager.DeleteSubscriber(subscriber.SubscriberId);&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> </tbody> </table> </div> <p></p> <p>&nbsp;</p> <p>You can use similar logic for validating subscribers' first and last names.</p> <p>&nbsp;</p> <br /> http://www.sitefinity.com/support/kb/newsletters-module-not-sending-e-mails.aspx Radoslav Georgiev http://www.sitefinity.com/support/kb/newsletters-module-not-sending-e-mails.aspx 051b0bfa-0333-4b17-9853-0c3aed42c026 Thu, 14 Jan 2010 16:11:52 GMT Evaluating Sitefinity from Developer’s perspective <p>So you are a developer and it’s the first time that you are entering in the Sitefinity world? You have deadlines and a tight schedule, but still, you have to find out if Sitefinity is suitable for your next state of the art project? This KB will get you started.</p> <p>If you already know the scale of your project, you can first take a look at our <a href="http://www.sitefinity.com/showcases/featured.aspx" title="showcase gallery" shape="rect">showcase gallery</a>. This should give you an overview of the typical web sites done so far with Sitefinity. Some of the showcases provide you with case studies – how the development/management problems are solved with the CMS. Learning from others' experience is sometimes better than learning from your own mistakes.</p> <p>If you are a .NET developer, then you already know the essential part of Sitefinity. When you pass the <a href="http://www.sitefinity.com/asp-net-cms-features/systems-requirements.aspx" title="System Requirements" shape="rect">System Requirements</a>, describing the various supported types of OS Web and Database servers, your next step should be <a href="http://www.sitefinity.com/support/installation-guide.aspx" title="installing the product" shape="rect">installing the product</a> and creating sample content. You can also play with our sample web site – Telerik University Demo. The basic developer resources that you are looking for are:</p> <ul> <li><a href="http://www.sitefinity.com/asp-net-cms-features.aspx" title="Important Features" shape="rect">Important Features</a>  </li> <li><a href="http://www.sitefinity.com/help/developer-manual/introduction.html" title="Sitefinity Developers Manual" shape="rect">Sitefinity Developers Manual</a>   </li> <li><a href="http://www.sitefinity.com/help/developer-manual/introduction.html" title="Core Concepts - Architecture" shape="rect">Core Concepts - Architecture</a>  </li> <li><a href="http://www.sitefinity.com/blogs/ivan/posts/09-02-18/sitefinity_3_6_new_backend_architecture_-_documentation_outline.aspx" title="Modules Architecture" shape="rect">Modules Architecture</a>  </li> </ul> <p>If you are looking for information about the basic features and commonly used tasks, such as creating pages, activating and using localization, managing users, roles and permissions, you can check our <a href="http://www.sitefinity.com/support/video-tutorials.aspx" title="product videos" shape="rect">product videos</a>.</p> <p> <br /> Once you pass this point, you will most probably want to know about the advanced customizations that could be done with our CMS. This is what Sitefinity is designed for – we provide you with a code base and API which you can use to create your own controls interacting with the content, modules and services. The resources that can guide you beyond the basics:</p> <ul> <li><a href="http://www.sitefinity.com/support/webinars.aspx" title="Webinars" shape="rect">Webinars</a>  </li> <li><a href="http://www.sitefinity.com/support/kb.aspx" title="Code Library" shape="rect">Code Library</a>  </li> <li><a href="http://www.sitefinity.com/support/kb.aspx" title="http://www.sitefinity.com/support/kb.aspx" shape="rect">Knowledgebase articles</a> </li> </ul> <p>Sitefinity comes with the award winning <a href="http://demos.telerik.com/aspnet-ajax/controls/examples/default/defaultcs.aspx" title="RadControls for Asp.Net AJAX" shape="rect">RadControls for Asp.Net AJAX</a> and Silverlight controls from Telerik - you can use them for the user interface or integrate them with your custom modules. We are regularly posting code examples with them in our <a href="http://sitefinity.com/blogs" title="Sitefinity Blogs" shape="rect">Blogs</a> and <a href="http://www.sitefinity.com/support/forums.aspx" title="Sitefinity Forums" shape="rect">Forums</a>. Another very helpful resource could be <a href="http://sitefinitywatch.com/" title="http://sitefinitywatch.com" shape="rect">sitefinitywatch.com</a>. </p> <p>What about the support service?</p> <p>It is important to mention that you are getting support from the people developing the product as well. The main support channels though which you could receive support is-are:</p> <ul> <li>Online Support Ticketing System accessible from your <a href="http://www.sitefinity.com/login.aspx" title="Client.Net account" shape="rect">Client.Net account</a> </li> <li><a href="http://www.sitefinity.com/support/forums.aspx" title="Forum threads " shape="rect">Forum threads</a> </li> </ul> <p>If you have any specific questions on the software architecture, or uncertainties on how to implement Sitefinity in your unique scenario, our team will be pleased to help you. <a href="http://www.sitefinity.com/partners.aspx" title="Our partners" shape="rect">Our partners</a> could also help you if the project is too big for you and you need additional development help.</p> <p>We wish you successful evaluation!</p> http://www.sitefinity.com/support/kb/sitefinity-3-x/evaluating-sitefinity-from-developer’s-perspective.aspx Georgi Chokov http://www.sitefinity.com/support/kb/sitefinity-3-x/evaluating-sitefinity-from-developer%e2%80%99s-perspective.aspx 0132f5f7-2c28-4bec-9054-c5b622d1620d Tue, 29 Dec 2009 14:29:19 GMT How to apply custom style sheets to Sitefinity Content View controls Most of you are probably aware that since Sitefinity 3.6 we have moved to using embedded control templates for Sitefinity's controls. This means that if you wish for example to modify the look and feel for the New View control you will have to map its external template and edit it to achieve the desired result. In the following article we will give you some guidance on how to change the style rules for content view controls. We will work with the News View control as an example. <p>&nbsp;</p> <p>Before you start I will suggest that you look at the following resources if you have any doubts on how to work with Sitefinity's control templates:</p> <p><a href="http://www.sitefinity.com/blogs/ivan/posts/09-02-23/introduction_to_controlsconfig_file.aspx">Introduction to ControlsConfig file </a></p> <a href="http://www.sitefinity.com/support/kb/sitefinity-3-x/how-to-map-a-view-to-an-external-template-in-sitefinity-3-6-or-later.aspx">How to map a view to an external template, in Sitefinity 3.6 or later? </a> <p>&nbsp;</p> <p>Once you have gained better understanding on how to map controls to use external templates you will need to make the News View control use the external templates. The files you will need to modify are <strong>~/Sitefinity/ControlTemplates/News/ListPageMaster.ascx</strong> and <strong>~/Sitefinity/ControlTemplates/News/Details.ascx</strong>. What you should do with those files is to change the CssFile link to point to your custom css files:</p> <div style="border: 1px solid #7f9db9; overflow: auto; background-color: white; line-height: 100% ! important; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; width: 99%; border-collapse: collapse; background-color: #ffffff;"> <col style="border-bottom: 1px solid #f7f7f7; font-family: courier new; font-size: 11px; padding-left: 10px; white-space: nowrap;" /> <tbody> <tr> <td><span style="font-size: 11px;"></span><span style="color: blue;">&lt;</span><span style="font-size: 11px;">telerik:CssFileLink&nbsp;</span><span style="color: red;">ID</span><span style="font-size: 11px;">=</span><span style="color: blue;">"CssFileLink1"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">FileName</span><span style="font-size: 11px;">=</span><span style="color: blue;">"~/Path&nbsp;to&nbsp;your&nbsp;style&nbsp;sheet"</span><span style="font-size: 11px;">&nbsp;&nbsp;</span><span style="color: red;">Media</span><span style="font-size: 11px;">=</span><span style="color: blue;">"screen"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">runat</span><span style="font-size: 11px;">=</span><span style="color: blue;">"server"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">/&gt;</span><span style="font-size: 11px;">&nbsp;&nbsp;</span></td> </tr> </tbody> </table> </div> <p>&nbsp;</p> Then you should map the control to the templates using the following view settings in the ControlsConfig file and restart the website: <p> <div style="border: 1px solid #7f9db9; overflow: auto; background-color: white; line-height: 100% ! important; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; width: 99%; border-collapse: collapse; background-color: #ffffff;"> <col style="border-bottom: 1px solid #f7f7f7; font-family: courier new; font-size: 11px; padding-left: 10px; white-space: nowrap;" /> <tbody> <tr> <td><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">&lt;</span><span style="font-size: 11px;">viewSettings&nbsp;</span><span style="color: red;">hostType</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Telerik.News.WebControls.NewsView"</span><span style="font-size: 11px;">&gt;&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">additionalTemplates</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: green;">&lt;!--Provides&nbsp;user&nbsp;interface&nbsp;for&nbsp;displaying&nbsp;a&nbsp;list&nbsp;of&nbsp;news&nbsp;items&nbsp;in&nbsp;the&nbsp;NewsView&nbsp;control&nbsp;for&nbsp;the&nbsp;News&nbsp;module.--&gt;</span><span style="font-size: 11px;">&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">add&nbsp;</span><span style="color: red;">key</span><span style="font-size: 11px;">=</span><span style="color: blue;">"ItemListTemplatePath"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">layoutTemplatePath</span><span style="font-size: 11px;">=</span><span style="color: blue;">"~/Sitefinity/ControlTemplates/News/ListPageMaster.ascx"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">/&gt;</span><span style="font-size: 11px;">&nbsp;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: green;">&lt;!--Provides&nbsp;user&nbsp;interface&nbsp;for&nbsp;displaying&nbsp;a&nbsp;single&nbsp;news&nbsp;item&nbsp;in&nbsp;the&nbsp;NewsView&nbsp;control&nbsp;of&nbsp;the&nbsp;News&nbsp;module.--&gt;</span><span style="font-size: 11px;">&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">add&nbsp;</span><span style="color: red;">key</span><span style="font-size: 11px;">=</span><span style="color: blue;">"SingleItemTemplatePath"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">layoutTemplatePath</span><span style="font-size: 11px;">=</span><span style="color: blue;">"~/Sitefinity/ControlTemplates/News/ListPageDetails.ascx"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">/&gt;</span><span style="font-size: 11px;">&nbsp;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;/</span><span style="font-size: 11px;">additionalTemplates</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;"><span style="color: blue;">&lt;/</span><span style="font-size: 11px;">viewSettings</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;&nbsp;</span></td> </tr> </tbody> </table> </div> </p> <p>&nbsp;</p> <p>For your convenience I am sending you as an attached file the default CSS styles for the content view public controls. This will save you some time from building the styles from scratch.</p> <p>&nbsp;</p> http://www.sitefinity.com/support/kb/sitefinity-3-x/how-to-apply-custom-style-sheets-to-sitefinity-content-view-controls.aspx Radoslav Georgiev http://www.sitefinity.com/support/kb/sitefinity-3-x/how-to-apply-custom-style-sheets-to-sitefinity-content-view-controls.aspx e86e8af6-2a22-4a7f-a5fa-216f2c71c485 Sat, 19 Dec 2009 12:45:32 GMT Enhance Sitefinity's ImageEditorDialog dialog security <style> <!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610611985 1073750139 0 0 159 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman";} p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph {mso-style-priority:34; mso-style-unhide:no; mso-style-qformat:yes; margin-top:0in; margin-right:0in; margin-bottom:0in; margin-left:.5in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-fareast-font-family:Calibri; mso-fareast-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman";} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; font-size:10.0pt; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} /* List Definitions */ @list l0 {mso-list-id:1542202293; mso-list-type:hybrid; mso-list-template-ids:703132144 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l0:level1 {mso-level-number-format:bullet; mso-level-text:; mso-level-tab-stop:none; mso-level-number-position:left; margin-left:38.5pt; text-indent:-.25in; font-family:Symbol;} @list l0:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} @list l0:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} @list l0:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} @list l0:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} @list l0:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} @list l0:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} @list l0:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} @list l0:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} @list l1 {mso-list-id:2087803433; mso-list-type:hybrid; mso-list-template-ids:472042858 67698689 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;} @list l1:level1 {mso-level-number-format:bullet; mso-level-text:; mso-level-tab-stop:none; mso-level-number-position:left; margin-left:38.5pt; text-indent:-.25in; font-family:Symbol;} @list l1:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} @list l1:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} @list l1:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} @list l1:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} @list l1:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} @list l1:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} @list l1:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} @list l1:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} ol {margin-bottom:0in;} ul {margin-bottom:0in;} --> </style> <p>To enhance Sitefinity's  ImageEditorDialog dialog security, there are new properties added to this control since Sitefinity 3.7 SP2:</p> <p> </p> <p>          <em>AllowedFileExtensions</em> – specifies the file extensions which are allowed for uploading by authenticated users. Default value (when you do not specify this property) – all file types!<br />            <em>AllowedFileExtensionsForAnonymousUsers</em> – specifies the file extensions which are allowed for uploading by anonymous users (for example, when anonymous users write in the Forums module on a public page). Default value (when you do not specify this property) – no file types!</p> <p> </p> <p>To set these properties,</p> <p><strong>1.Open:</strong></p> <p>      ~/your_website/Sitefinity/UserControls/Dialogs/ImageEditorDialog.aspx (for ImageEditorDialog)</p> <p><strong>or</strong></p> <p>       ~/your_website/Sitefinity/UserControls/Dialogs/DocumentEditorDialog.aspx (for DocumentEditorDialog),</p> <p><strong>2. Modify the ImageEditorDialog</strong> control  or <strong>DocumentEditorDialog.aspx</strong> by adding the AllowedFileExtensions property. For a property value enter the file extensions you want to allow, starting with a dot and separated by a comma.</p> <p> Sample code</p> <div style="border: #7f9db9 1px solid; line-height: 100% !important; background-color: white; font-family: courier new; font-size: 11px; overflow: auto; "> <table style="border-bottom: #eee 0px solid; border-right-width: 0px; background-color: #fff; margin: 2px 0px; width: 99%; border-collapse: collapse; border-top-width: 0px; border-left-width: 0px;" cellspacing="0" cellpadding="0"> <colgroup><col style="border-bottom: #f7f7f7 1px solid; padding-left: 10px; font-family: courier new; white-space: nowrap; font-size: 11px;" /></colgroup> <tbody> <tr> <td><span style="font-size: 11px;"></span><span style="color: #0000ff;">&lt;</span><span style="font-size: 11px;">lib:ImageEditorDialog </span><span style="color: #ff0000;">runat</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"server"</span><span style="font-size: 11px;"> </span><span style="color: #ff0000;">DisplayMode</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"Images"</span><span style="font-size: 11px;"> </span><span style="color: #ff0000;">AllowedFileExtensions</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">".jpg, .jpeg, .png"</span><span style="font-size: 11px;"> </span><span style="color: #ff0000;">AllowedFileExtensionsForAnonymousUsers</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">".jpg"</span><span style="font-size: 11px;">/&gt;  </span></td> </tr> </tbody> </table> </div> <p> </p> <p>With this code, you specify that authenticated users could upload only three file types using the image dialog, and that anonymous users could only upload one file type.</p> <p><span style="color: #ff0000;">Important note</span>: when you do not set the AllowedFileExtensions property, you allow all file types for authenticated users. However, when you do not set the AllowedFileExtensionsForAnonymousUsers property, you forbid anonymous users to upload any file type.</p> http://www.sitefinity.com/support/kb/sitefinity-3-x/enhance-sitefinity-s-imageeditordialog-dialog-security.aspx Ivan Dimitrov http://www.sitefinity.com/support/kb/sitefinity-3-x/enhance-sitefinity-s-imageeditordialog-dialog-security.aspx 24348ee0-9f12-441e-93ee-a12103b6bd32 Tue, 08 Dec 2009 22:30:13 GMT Creating a custom URL Mapping Service <div>Instead of using the default <a href="http://www.sitefinity.com/support/kb/sitefinity-3-x/the-“domain-–-page-mapping”-feature.aspx">Domain-Page mapping</a> implementation of the Cms URL Mapping Service, you can create a custom URL Mapping.</div><div><br /></div><div>The URL Mapping service allows to define different Site Map roots based on the inforamtion in the current HTTP Context.</div><div><br /></div><div><strong>For example</strong>, you can map a specific CMS page in the site to a specific Membership User. So when the site is accessed by this user, the mapped CMS page behaves as a root of the site.</div><div><br /></div><div>Here is the sample implementation:</div><div><br /></div><div>1. Create UserUrlMappingService class in the ~/App_Code/UserUrlMappingService.cs:</div><div><div style="overflow-x: auto; overflow-y: auto; background-color: white; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(127, 157, 185); border-right-color: rgb(127, 157, 185); border-bottom-color: rgb(127, 157, 185); border-left-color: rgb(127, 157, 185); line-height: 100% !important; font-family: 'courier new'; font-size: 11px; ;"><table cellpadding="0" cellspacing="0" style="width: 99%; margin-top: 2px; margin-right: 0px; margin-bottom: 2px; margin-left: 0px; border-collapse: collapse; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); background-color: rgb(255, 255, 255); border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; ;"> <col style="font-family: 'courier new'; font-size: 11px; padding-left: 10px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(247, 247, 247); white-space: nowrap; ;" /> <tbody> <tr> <td><span style="font-size: 11px; ;"></span><span style="color: blue; ;">using</span><span style="font-size: 11px; ;"> System.Web; </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;"><span style="color: blue; ;">using</span><span style="font-size: 11px; ;"> System.Web.Security; </span></td> </tr> <tr> <td><span style="color: blue; ;">using</span><span style="font-size: 11px; ;"> Telerik.Cms.Web; </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;"> </td> </tr> <tr> <td><span style="color: blue; ;">public</span><span style="font-size: 11px; ;"> </span><span style="color: blue; ;">class</span><span style="font-size: 11px; ;"> UserUrlMappingService : UrlMappingServiceBase </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">{ </td> </tr> <tr> <td>    <span style="color: blue; ;">protected</span><span style="font-size: 11px; ;"> </span><span style="color: blue; ;">override</span><span style="font-size: 11px; ;"> </span><span style="color: blue; ;">string</span><span style="font-size: 11px; ;"> GetKey(HttpContext context) </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">    { </td> </tr> <tr> <td>        RolePrincipal principal = context.User <span style="color: blue; ;">as</span><span style="font-size: 11px; ;"> RolePrincipal; </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">        <span style="color: blue; ;">if</span><span style="font-size: 11px; ;"> (principal != </span><span style="color: blue; ;">null</span><span style="font-size: 11px; ;">) </span></td> </tr> <tr> <td>        { </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">            <span style="color: blue; ;">return</span><span style="font-size: 11px; ;"> context.User.Identity.Name; </span></td> </tr> <tr> <td>        } </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">        <span style="color: blue; ;">else</span><span style="font-size: 11px; ;"> </span></td> </tr> <tr> <td>        { </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">            <span style="color: green; ;">// We should check the cookies, </span><span style="font-size: 11px; ;"> </span></td> </tr> <tr> <td>            <span style="color: green; ;">// because sometimes this method is called in the BeginRequest (before the user is authenticated).</span><span style="font-size: 11px; ;"> </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">            HttpCookie cookie = context.Request.Cookies[FormsAuthentication.FormsCookieName]; </td> </tr> <tr> <td>            <span style="color: blue; ;">if</span><span style="font-size: 11px; ;"> (cookie != </span><span style="color: blue; ;">null</span><span style="font-size: 11px; ;">) </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">            { </td> </tr> <tr> <td>                FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(cookie.Value); </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">                <span style="color: blue; ;">if</span><span style="font-size: 11px; ;"> (ticket != </span><span style="color: blue; ;">null</span><span style="font-size: 11px; ;">) </span></td> </tr> <tr> <td>                    <span style="color: blue; ;">return</span><span style="font-size: 11px; ;"> ticket.Name; </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">            } </td> </tr> <tr> <td>        } </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;"> </td> </tr> <tr> <td>        <span style="color: blue; ;">return</span><span style="font-size: 11px; ;"> </span><span style="color: blue; ;">string</span><span style="font-size: 11px; ;">.Empty; </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">    } </td> </tr> <tr> <td>} </td> </tr> </tbody></table></div><br /></div><div><br /></div><div>2. Declare the Mapping Service in the web.config and add your mappings:<br /></div><div><div style="overflow-x: auto; overflow-y: auto; background-color: white; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(127, 157, 185); border-right-color: rgb(127, 157, 185); border-bottom-color: rgb(127, 157, 185); border-left-color: rgb(127, 157, 185); line-height: 100% !important; font-family: 'courier new'; font-size: 11px; ;"><table cellpadding="0" cellspacing="0" style="width: 99%; margin-top: 2px; margin-right: 0px; margin-bottom: 2px; margin-left: 0px; border-collapse: collapse; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); background-color: rgb(255, 255, 255); border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; ;"> <col style="font-family: 'courier new'; font-size: 11px; padding-left: 10px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(247, 247, 247); white-space: nowrap; ;" /> <tbody> <tr> <td><span style="font-size: 11px; ;"></span><span style="color: blue; ;">&lt;</span><span style="font-size: 11px; ;">cms </span><span style="color: red; ;">defaultProvider</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"Sitefinity"</span><span style="font-size: 11px; ;"> ...</span><span style="color: blue; ;">&gt;</span><span style="font-size: 11px; ;"> </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">    <span style="color: blue; ;">&lt;</span><span style="font-size: 11px; ;">urlMappings </span><span style="color: red; ;">type</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"Custom"</span><span style="font-size: 11px; ;"> </span><span style="color: red; ;">customService</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"UserUrlMappingService, App_Code"</span><span style="font-size: 11px; ;">&gt; </span></td> </tr> <tr> <td>            <span style="color: blue; ;">&lt;</span><span style="font-size: 11px; ;">add </span><span style="color: red; ;">key</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"[username]"</span><span style="font-size: 11px; ;"> </span><span style="color: red; ;">value</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"[page_path]"</span><span style="font-size: 11px; ;"> </span><span style="color: blue; ;">/&gt;</span><span style="font-size: 11px; ;"> </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">    <span style="color: blue; ;">&lt;/</span><span style="font-size: 11px; ;">urlMappings</span><span style="color: blue; ;">&gt;</span><span style="font-size: 11px; ;"> </span></td> </tr> <tr> <td>    ... </td> </tr> </tbody></table></div><br /></div><div>Where <strong>username </strong>is the name of the membership user and<strong> page_path </strong>is the path to the page without extension i.e.<em> page1</em> or <em>page1/subpage1</em>.<br /></div><div><br /></div><div><strong>Additionaly</strong>, you can declare custom parameters for the mapping elements in the collection, and later access them for specific SiteMap node if it belongs to that mapping configuration.<br /></div><div>For example, lets say that you have 2 users (user1 and user2) and you want to define different Site Map roots for them (page1 and page2). Also, you want to <a href="http://www.sitefinity.com/support/forums/sitefinity-3-x/designing-with-sitefinity/front-end-change-theme-via-drop-down.aspx">dynamically load different themes</a> when the users access any page under their roots. Here is the implementation:</div><div><br /></div><div>1. UserUrlMappingService:</div><div><div style="overflow-x: auto; overflow-y: auto; background-color: white; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(127, 157, 185); border-right-color: rgb(127, 157, 185); border-bottom-color: rgb(127, 157, 185); border-left-color: rgb(127, 157, 185); line-height: 100% !important; font-family: 'courier new'; font-size: 11px; ;"><table cellpadding="0" cellspacing="0" style="width: 99%; margin-top: 2px; margin-right: 0px; margin-bottom: 2px; margin-left: 0px; border-collapse: collapse; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); background-color: rgb(255, 255, 255); border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; ;"> <col style="font-family: 'courier new'; font-size: 11px; padding-left: 10px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(247, 247, 247); white-space: nowrap; ;" /> <tbody> <tr> <td><span style="font-size: 11px; ;"></span><span style="color: blue; ;">using</span><span style="font-size: 11px; ;"> System.Web; </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;"><span style="color: blue; ;">using</span><span style="font-size: 11px; ;"> System.Web.Security; </span></td> </tr> <tr> <td><span style="color: blue; ;">using</span><span style="font-size: 11px; ;"> Telerik.Cms.Web; </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;"><span style="color: blue; ;">using</span><span style="font-size: 11px; ;"> Telerik.Cms.Configuration; </span></td> </tr> <tr> <td> </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;"><span style="color: blue; ;">public</span><span style="font-size: 11px; ;"> </span><span style="color: blue; ;">class</span><span style="font-size: 11px; ;"> UserUrlMappingService : UrlMappingServiceBase </span></td> </tr> <tr> <td>{ </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">    <span style="color: blue; ;">protected</span><span style="font-size: 11px; ;"> </span><span style="color: blue; ;">override</span><span style="font-size: 11px; ;"> UrlMappingInfo CreateMappingInfoItem(UrlMappingElement mappingElement) </span></td> </tr> <tr> <td>    { </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">        <span style="color: blue; ;">return</span><span style="font-size: 11px; ;"> </span><span style="color: blue; ;">new</span><span style="font-size: 11px; ;"> UserUrlMappingInfo(mappingElement); </span></td> </tr> <tr> <td>    } </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;"> </td> </tr> <tr> <td>    <span style="color: blue; ;">protected</span><span style="font-size: 11px; ;"> </span><span style="color: blue; ;">override</span><span style="font-size: 11px; ;"> </span><span style="color: blue; ;">string</span><span style="font-size: 11px; ;"> GetKey(HttpContext context) </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">    { </td> </tr> <tr> <td>        RolePrincipal principal = context.User <span style="color: blue; ;">as</span><span style="font-size: 11px; ;"> RolePrincipal; </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">        <span style="color: blue; ;">if</span><span style="font-size: 11px; ;"> (principal != </span><span style="color: blue; ;">null</span><span style="font-size: 11px; ;">) </span></td> </tr> <tr> <td>        { </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">            <span style="color: blue; ;">return</span><span style="font-size: 11px; ;"> context.User.Identity.Name; </span></td> </tr> <tr> <td>        } </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">        <span style="color: blue; ;">else</span><span style="font-size: 11px; ;"> </span></td> </tr> <tr> <td>        { </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">            <span style="color: green; ;">// We should check the cookies, </span><span style="font-size: 11px; ;"> </span></td> </tr> <tr> <td>            <span style="color: green; ;">// because sometimes this method is called in the BeginRequest (before the user is authenticated).</span><span style="font-size: 11px; ;"> </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">            HttpCookie cookie = context.Request.Cookies[FormsAuthentication.FormsCookieName]; </td> </tr> <tr> <td>            <span style="color: blue; ;">if</span><span style="font-size: 11px; ;"> (cookie != </span><span style="color: blue; ;">null</span><span style="font-size: 11px; ;">) </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">            { </td> </tr> <tr> <td>                FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(cookie.Value); </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">                <span style="color: blue; ;">if</span><span style="font-size: 11px; ;"> (ticket != </span><span style="color: blue; ;">null</span><span style="font-size: 11px; ;">) </span></td> </tr> <tr> <td>                    <span style="color: blue; ;">return</span><span style="font-size: 11px; ;"> ticket.Name; </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">            } </td> </tr> <tr> <td>        } </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;"> </td> </tr> <tr> <td>        <span style="color: blue; ;">return</span><span style="font-size: 11px; ;"> </span><span style="color: blue; ;">string</span><span style="font-size: 11px; ;">.Empty; </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">    } </td> </tr> <tr> <td>} </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;"> </td> </tr> <tr> <td><span style="color: blue; ;">public</span><span style="font-size: 11px; ;"> </span><span style="color: blue; ;">class</span><span style="font-size: 11px; ;"> UserUrlMappingInfo : UrlMappingInfo </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">{ </td> </tr> <tr> <td>    <span style="color: blue; ;">public</span><span style="font-size: 11px; ;"> UserUrlMappingInfo(UrlMappingElement mappingElement) </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">        : <span style="color: blue; ;">base</span><span style="font-size: 11px; ;">(mappingElement) </span></td> </tr> <tr> <td>    { </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">        <span style="color: blue; ;">this</span><span style="font-size: 11px; ;">.theme = mappingElement.Parameters[</span><span style="color: blue; ;">"theme"</span><span style="font-size: 11px; ;">]; </span></td> </tr> <tr> <td>    } </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;"> </td> </tr> <tr> <td>    <span style="color: blue; ;">public</span><span style="font-size: 11px; ;"> </span><span style="color: blue; ;">string</span><span style="font-size: 11px; ;"> Theme </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">    { </td> </tr> <tr> <td>        <span style="color: blue; ;">get</span><span style="font-size: 11px; ;"> { </span><span style="color: blue; ;">return</span><span style="font-size: 11px; ;"> </span><span style="color: blue; ;">this</span><span style="font-size: 11px; ;">.theme; } </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">    } </td> </tr> <tr> <td> </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">    <span style="color: blue; ;">private</span><span style="font-size: 11px; ;"> </span><span style="color: blue; ;">string</span><span style="font-size: 11px; ;"> theme; </span></td> </tr> <tr> <td>} </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;"> </td> </tr> </tbody></table></div><br /></div><div>2. URL mapping configuration:</div><div><div style="overflow-x: auto; overflow-y: auto; background-color: white; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(127, 157, 185); border-right-color: rgb(127, 157, 185); border-bottom-color: rgb(127, 157, 185); border-left-color: rgb(127, 157, 185); line-height: 100% !important; font-family: 'courier new'; font-size: 11px; ;"><table cellpadding="0" cellspacing="0" style="width: 99%; margin-top: 2px; margin-right: 0px; margin-bottom: 2px; margin-left: 0px; border-collapse: collapse; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); background-color: rgb(255, 255, 255); border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; ;"> <col style="font-family: 'courier new'; font-size: 11px; padding-left: 10px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(247, 247, 247); white-space: nowrap; ;" /> <tbody> <tr> <td><span style="font-size: 11px; ;">    </span><span style="color: blue; ;">&lt;</span><span style="font-size: 11px; ;">urlMappings </span><span style="color: red; ;">type</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"Custom"</span><span style="font-size: 11px; ;"> </span><span style="color: red; ;">customService</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"UserUrlMappingService, App_Code"</span><span style="font-size: 11px; ;">&gt; </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">       <span style="color: blue; ;">&lt;</span><span style="font-size: 11px; ;">add </span><span style="color: red; ;">key</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"user1"</span><span style="font-size: 11px; ;"> </span><span style="color: red; ;">value</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"page1"</span><span style="font-size: 11px; ;"> </span><span style="color: red; ;">theme</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"Levels"</span><span style="font-size: 11px; ;">/&gt; </span></td> </tr> <tr> <td>       <span style="color: blue; ;">&lt;</span><span style="font-size: 11px; ;">add </span><span style="color: red; ;">key</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"user2"</span><span style="font-size: 11px; ;"> </span><span style="color: red; ;">value</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"page2"</span><span style="font-size: 11px; ;"> </span><span style="color: red; ;">theme</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"Orange with left sidebar"</span><span style="font-size: 11px; ;"> </span><span style="color: blue; ;">/&gt;</span><span style="font-size: 11px; ;"> </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">    <span style="color: blue; ;">&lt;/</span><span style="font-size: 11px; ;">urlMappings</span><span style="color: blue; ;">&gt;</span><span style="font-size: 11px; ;"> </span></td> </tr> </tbody></table></div><br /></div><div>3. Custom InternalPage:</div><div>    - create a CustomInternalPage class in the ~/App_Code/CustomInternalPage.cs</div><div><div style="overflow-x: auto; overflow-y: auto; background-color: white; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(127, 157, 185); border-right-color: rgb(127, 157, 185); border-bottom-color: rgb(127, 157, 185); border-left-color: rgb(127, 157, 185); line-height: 100% !important; font-family: 'courier new'; font-size: 11px; ;"><table cellpadding="0" cellspacing="0" style="width: 99%; margin-top: 2px; margin-right: 0px; margin-bottom: 2px; margin-left: 0px; border-collapse: collapse; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); background-color: rgb(255, 255, 255); border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; ;"> <col style="font-family: 'courier new'; font-size: 11px; padding-left: 10px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(247, 247, 247); white-space: nowrap; ;" /> <tbody> <tr> <td><span style="font-size: 11px; ;"></span><span style="color: blue; ;">using</span><span style="font-size: 11px; ;"> System; </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;"><span style="color: blue; ;">using</span><span style="font-size: 11px; ;"> Telerik.Cms.Web; </span></td> </tr> <tr> <td> </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;"><span style="color: blue; ;">public</span><span style="font-size: 11px; ;"> </span><span style="color: blue; ;">class</span><span style="font-size: 11px; ;"> CustomInternalPage : InternalPage </span></td> </tr> <tr> <td>{ </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">    <span style="color: blue; ;">protected</span><span style="font-size: 11px; ;"> </span><span style="color: blue; ;">override</span><span style="font-size: 11px; ;"> </span><span style="color: blue; ;">void</span><span style="font-size: 11px; ;"> OnPreInit(EventArgs e) </span></td> </tr> <tr> <td>    { </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">        <span style="color: blue; ;">base</span><span style="font-size: 11px; ;">.OnPreInit(e); </span></td> </tr> <tr> <td> </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">        ICmsUrlContext context = (ICmsUrlContext)<span style="color: blue; ;">this</span><span style="font-size: 11px; ;">.Context.Items[UrlHelper.CmsPageKey]; </span></td> </tr> <tr> <td>        <span style="color: blue; ;">if</span><span style="font-size: 11px; ;"> (context != </span><span style="color: blue; ;">null</span><span style="font-size: 11px; ;">) </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">        { </td> </tr> <tr> <td>            CmsSiteMapNode node = context.GetSiteMapNode() <span style="color: blue; ;">as</span><span style="font-size: 11px; ;"> CmsSiteMapNode; </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">            <span style="color: blue; ;">if</span><span style="font-size: 11px; ;"> (node != </span><span style="color: blue; ;">null</span><span style="font-size: 11px; ;">) </span></td> </tr> <tr> <td>            { </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">                UserUrlMappingInfo urlMappingInfo = node.GetMappingInfo() <span style="color: blue; ;">as</span><span style="font-size: 11px; ;"> UserUrlMappingInfo; </span></td> </tr> <tr> <td>                <span style="color: blue; ;">if</span><span style="font-size: 11px; ;"> (urlMappingInfo != </span><span style="color: blue; ;">null</span><span style="font-size: 11px; ;">) </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">                { </td> </tr> <tr> <td>                    <span style="color: blue; ;">string</span><span style="font-size: 11px; ;"> theme = urlMappingInfo.Theme; </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">                    <span style="color: blue; ;">if</span><span style="font-size: 11px; ;"> (!</span><span style="color: blue; ;">string</span><span style="font-size: 11px; ;">.IsNullOrEmpty(theme)) </span></td> </tr> <tr> <td>                    { </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">                        <span style="color: blue; ;">this</span><span style="font-size: 11px; ;">.Theme = theme; </span></td> </tr> <tr> <td>                    } </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">                } </td> </tr> <tr> <td>            } </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">        } </td> </tr> <tr> <td>    } </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;"> </td> </tr> <tr> <td>} </td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;"> </td> </tr> </tbody></table></div><br /></div><div>    - replace the declaration of <strong>InternalPage </strong>class with the name of your newly created class in the following file <strong>~/Sitefinity/cmsentrypoint.aspx:</strong></div><div><strong><div style="overflow-x: auto; overflow-y: auto; background-color: white; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: rgb(127, 157, 185); border-right-color: rgb(127, 157, 185); border-bottom-color: rgb(127, 157, 185); border-left-color: rgb(127, 157, 185); line-height: 100% !important; font-family: 'courier new'; font-size: 11px; ;"><table cellpadding="0" cellspacing="0" style="width: 99%; margin-top: 2px; margin-right: 0px; margin-bottom: 2px; margin-left: 0px; border-collapse: collapse; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); background-color: rgb(255, 255, 255); border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; ;"> <col style="font-family: 'courier new'; font-size: 11px; padding-left: 10px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(247, 247, 247); white-space: nowrap; ;" /> <tbody> <tr> <td><span style="font-size: 11px; ;"></span><span style="color: blue; ;">&lt;</span><span style="font-size: 11px; ;">%@ Page </span><span style="color: red; ;">Language</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"C#"</span><span style="font-size: 11px; ;"> </span><span style="color: red; ;">MasterPageFile</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"~/App_Master/Dummy.master"</span><span style="font-size: 11px; ;"> </span><span style="color: red; ;">Inherits</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"<span style="background-color: rgb(146, 208, 80); ;">CustomInternalPage</span>"</span><span style="font-size: 11px; ;"> %</span><span style="color: blue; ;">&gt;</span><span style="font-size: 11px; ;"> </span></td> </tr> </tbody></table></div><br /></strong></div><div><strong><br /></strong></div><div><strong>Finally</strong>, the URL Mapping service can be used in many other different custom scenarios.</div><div><strong><br /></strong></div><div><br /></div> http://www.sitefinity.com/support/kb/sitefinity-3-x/creating-a-custom-url-mapping-service.aspx Vladimir Vasilev http://www.sitefinity.com/support/kb/sitefinity-3-x/creating-a-custom-url-mapping-service.aspx e50c580b-f451-4fbe-ba5f-0a0ef815e939 Fri, 04 Dec 2009 09:00:00 GMT Controling appearance of RadControls for ASP.NET AJAX in Sitefinity Sitefinity CMS comes with the complete set of RadControls for ASP.NET AJAX built in and at your disposal for use in your web site project. The CMS even uses some of the controls in its toolbox in the page editor. As an example the navigation controls such as the Site Menu, Site Panel Bar and the Site Tab Strip are essentially RadControls wrapped into user controls (.ascx) in order to make them available in the control toolbox for drag and drop use. Using RadControls skins in Sitefinity CMS is essentially the same as using them in regular ASP.NET themes, you can refer to the <a shape="rect" title="How to use RadControls skins in ASP.NET themes." href="http://www.telerik.com/help/aspnet-ajax/themeshowto.html">Using skins in ASP.NET themes</a> article for more information. This article will cover the topics of how to create your custom styles and skins for the RadControls. <p>&nbsp;</p> <h4>Using the built-in skins for RadControls.</h4> <p>&nbsp;</p> <p>With the built in RadControls for ASP.NET AJAX you also get access to the built-in skins for the RadControls. Currently the RadControls come with twelve built in skins. I will use the RadMenu control as an example through the rest of this article. You can see the look and feel of the twelve built-in skins for the RadMenu below:</p> <p>&nbsp;</p> <p><img alt="" src="http://www.sitefinity.com/Libraries/KB_Related_Files/menu_menu_skin.sflb.ashx" style="width: 612px; height: 512px;" /> </p> <p>&nbsp;</p> <p>If you wish to use one of those skins you simply have to open the <strong>RadMenu.skin</strong> located in the theme that your pages use and tell it that it has to use the desired skin. Lets take for example the Blue with right sidebar theme that comes with Sitefinity.Open the Visual Studio and go to <strong>~/App_Themes/Blue with right sidebar/RadMenu.skin</strong> (if this file does not exist in your theme directory you will have to create it). If I want to use the Telerik skin I just have to set the skin property:</p> <p>&nbsp;</p> <div style="border: 1px solid #7f9db9; overflow: auto; line-height: 100% ! important; background-color: white; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; background-color: #ffffff; width: 99%; border-collapse: collapse;"> <colgroup><col style="border-bottom: 1px solid #f7f7f7; padding-left: 10px; font-family: courier new; white-space: nowrap; font-size: 11px;" /></colgroup> <tbody> <tr> <td><span style="font-size: 11px;"></span><span style="color: #0000ff;">&lt;</span><span style="font-size: 11px;">%@&nbsp;Register&nbsp;</span><span style="color: #ff0000;">TagPrefix</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"telerik"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: #ff0000;">Assembly</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"Telerik.Web.UI"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: #ff0000;">Namespace</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"Telerik.Web.UI"</span><span style="font-size: 11px;">&nbsp;%</span><span style="color: #0000ff;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;"><span style="color: #0000ff;">&lt;</span><span style="font-size: 11px;">telerik:RadMenu&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000;">runat</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"server"</span><span style="font-size: 11px;">&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000;">Skin</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"Telerik"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: #ff0000;">EnableEmbeddedSkins</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"true"</span><span style="font-size: 11px;">&gt;&nbsp;</span></td> </tr> <tr> <td><span style="color: #0000ff;">&lt;/</span><span style="font-size: 11px;">telerik:RadMenu</span><span style="color: #0000ff;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> </tbody> </table> </div> <p>&nbsp;</p> <p>&nbsp;</p> <p>Note that this will also make the Site Menu navigation control to use this skin, since it is a RadMenu wrapped into a user control (.ascx).</p> <p>&nbsp;</p> <h4>Building your own skin</h4> <p>&nbsp;</p> <p>Building custom skins for RadControls for ASP.NET AJAX in Sitefinity, like using built in skins, is the same as doing so for regular ASP.NET themes. The documentation for RadControls, contains a tutorial on how to create custom skins for each of the controls, it also contains a full list of the CSS skin file selectors that you have to use in order to build your own styling rules. For the RadMenu you can take a look at the following tutorial and article:</p> <p><a shape="rect" title="How to build a custom skin for the RadMenu" href="http://www.telerik.com/help/aspnet-ajax/menu_appearancecreatingacustomskin.html">Tutorial: Creating A Custom Skin</a></p> <p><a shape="rect" title="CSS classes for the RadMenu" href="http://www.telerik.com/help/aspnet-ajax/menu_appearancecssselectors.html">CSS Skin File Selectors</a></p> <p>&nbsp;</p> <p>To put the process in a nut shell, you have to create a folder in your theme directory that will hold your styles and images files. For the RadMenu you have to create a directory called Menu (e.g. <strong>~/App_Themes/Blue with right sidebar/Menu/</strong>). If your skin is called MySkin the <strong>~/App_Themes/Blue with right sidebar/RadMenu.skin</strong> file has to look like this:</p> <div style="border: 1px solid #7f9db9; overflow: auto; line-height: 100% ! important; background-color: white; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; background-color: #ffffff; width: 99%; border-collapse: collapse;"> <colgroup><col style="border-bottom: 1px solid #f7f7f7; padding-left: 10px; font-family: courier new; white-space: nowrap; font-size: 11px;" /></colgroup> <tbody> <tr> <td><span style="font-size: 11px;"></span><span style="color: #0000ff;">&lt;</span><span style="font-size: 11px;">%@&nbsp;Register&nbsp;</span><span style="color: #ff0000;">TagPrefix</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"telerik"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: #ff0000;">Assembly</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"Telerik.Web.UI"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: #ff0000;">Namespace</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"Telerik.Web.UI"</span><span style="font-size: 11px;">&nbsp;%</span><span style="color: #0000ff;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;"><span style="color: #0000ff;">&lt;</span><span style="font-size: 11px;">telerik:RadMenu&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000;">runat</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"server"</span><span style="font-size: 11px;">&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000;">Skin</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"MySkin"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: #ff0000;">EnableEmbeddedSkins</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"false"</span><span style="font-size: 11px;">&gt;&nbsp;</span></td> </tr> <tr> <td><span style="color: #0000ff;">&lt;/</span><span style="font-size: 11px;">telerik:RadMenu</span><span style="color: #0000ff;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> </tbody> </table> </div> <p>&nbsp;</p> <p>And the style rules located in the <strong>~/App_Themes/Blue with right sidebar/Menu/styles.css </strong>file have to look as bellow. Note that you have to follow the convention with using the skin name so that your theme will be able to load them:</p> <div style="border: 1px solid #7f9db9; overflow: auto; line-height: 100% ! important; background-color: white; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; background-color: #ffffff; width: 99%; border-collapse: collapse;"> <colgroup><col style="border-bottom: 1px solid #f7f7f7; padding-left: 10px; font-family: courier new; white-space: nowrap; font-size: 11px;" /></colgroup> <tbody> <tr> <td><span style="font-size: 11px;">.RadMenu_MySkin&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">{&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000;">background</span><span style="font-size: 11px;">:&nbsp;</span><span style="color: #0000ff;">#75a8e6</span><span style="font-size: 11px;">;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000;">z-index</span><span style="font-size: 11px;">:&nbsp;100&nbsp;!important;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td> </tr> <tr> <td> </td> </tr> <tr> <td style="background-color: #f7f7f7;">}&nbsp;</td> </tr> <tr> <td>.RadMenu_MySkin&nbsp;.rmLink,&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">.RadMenu_MySkin&nbsp;.rmTemplate&nbsp;.rmText&nbsp;</td> </tr> <tr> <td>{&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000;">line-height</span><span style="font-size: 11px;">:&nbsp;</span><span style="color: #0000ff;">20px</span><span style="font-size: 11px;">;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000;">text-decoration</span><span style="font-size: 11px;">:</span><span style="color: #0000ff;">none</span><span style="font-size: 11px;">;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000;">color</span><span style="font-size: 11px;">:&nbsp;</span><span style="color: #0000ff;">#fff</span><span style="font-size: 11px;">;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000;">background</span><span style="font-size: 11px;">:&nbsp;</span><span style="color: #0000ff;">#75a8e6</span><span style="font-size: 11px;">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">}&nbsp;</td> </tr> </tbody> </table> </div> <p>&nbsp;</p> <h4>Disabling/overriding the embedded styling rules</h4> <p>&nbsp;</p> <p>All RadControls come with built in styling rules embedded into the Telerik.Web.UI.dll. Those embedded styles are used for your convenience so that you do not have to build the styles from scratch every time you create your theme or use a control. Those built in style get loaded together with your custom styles, and sometimes may interfere with the styling rules that you have built. To prevent this you can use two approaches.</p> <p>&nbsp;</p> <p>The first one is easier and quicker to apply. You just have to add !important statement to your styles that get override by the embedded style sheets. This will explicitly tell your theme that it has to use the custom styles. Here is an example:</p> <p>&nbsp;</p> <div style="border: 1px solid #7f9db9; overflow: auto; line-height: 100% ! important; background-color: white; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; background-color: #ffffff; width: 99%; border-collapse: collapse;"> <colgroup><col style="border-bottom: 1px solid #f7f7f7; padding-left: 10px; font-family: courier new; white-space: nowrap; font-size: 11px;" /></colgroup> <tbody> <tr> <td><span style="font-size: 11px;">.RadMenu_MySkin&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">{&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000;">z-index</span><span style="font-size: 11px;">:&nbsp;100&nbsp;!important;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">}&nbsp;</td> </tr> </tbody> </table> </div> &nbsp; <p>&nbsp;</p> <p>The second one is disabling completely the embedded style sheets. Although this approach is "cleaner" than the above one, it involves building control style rule from the ground up and might take you some more time. If you prefer this approach you should set the <strong>EnableEmbeddedBaseStyleSheet</strong> property in your skin file. Here is an example how to do it for the RadMenu:</p> <p>&nbsp;</p> <div style="border: 1px solid #7f9db9; overflow: auto; line-height: 100% ! important; background-color: white; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; background-color: #ffffff; width: 99%; border-collapse: collapse;"> <colgroup><col style="border-bottom: 1px solid #f7f7f7; padding-left: 10px; font-family: courier new; white-space: nowrap; font-size: 11px;" /></colgroup> <tbody> <tr> <td><span style="font-size: 11px;"></span><span style="color: #0000ff;">&lt;</span><span style="font-size: 11px;">%@&nbsp;Register&nbsp;</span><span style="color: #ff0000;">TagPrefix</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"telerik"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: #ff0000;">Assembly</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"Telerik.Web.UI"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: #ff0000;">Namespace</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"Telerik.Web.UI"</span><span style="font-size: 11px;">&nbsp;%</span><span style="color: #0000ff;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;"><span style="color: #0000ff;">&lt;</span><span style="font-size: 11px;">telerik:RadMenu&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000;">runat</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"server"</span><span style="font-size: 11px;">&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000;">Skin</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"SitefinityBlue"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: #ff0000;">EnableEmbeddedSkins</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"false"</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ff0000;">EnableEmbeddedBaseStylesheet</span><span style="font-size: 11px;">=</span><span style="color: #0000ff;">"false"</span><span style="font-size: 11px;">&gt;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;"><span style="color: #0000ff;">&lt;/</span><span style="font-size: 11px;">telerik:RadMenu</span><span style="color: #0000ff;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> </tbody> </table> </div> <p>&nbsp;</p> <p>For more information on how to disable embedded resources, such as skins, styles and scripts, for the RadControls you can take a look at the following article: <a href="http://www.telerik.com/help/aspnet-ajax/disabling_embedded_resources.html" title="How to disable embedded skins, styles and scripts">Disabling embedded resources</a>.</p> <br /> <p>&nbsp;</p> http://www.sitefinity.com/support/kb/sitefinity-3-x/controling-appearance-of-radcontrols-for-asp-net-ajax-in-sitefinity.aspx Radoslav Georgiev http://www.sitefinity.com/support/kb/sitefinity-3-x/controling-appearance-of-radcontrols-for-asp-net-ajax-in-sitefinity.aspx dc8bd22b-4ea0-4a9d-aff6-089954670b03 Thu, 20 Aug 2009 11:25:36 GMT The “Domain – Page mapping” feature <span style="line-height: 115%; font-family: calibri, sans-serif; font-size: 11pt; ;">In Sitefinity 3.7, you can map domains to specific pages without the need to write any code.</span><br /><div><span style="font-family: calibri; font-size: 18px; ;"><span style="line-height: 17px; font-size: 15px; ;"><br /></span></span></div><div><span style="font-family: calibri; font-size: 18px; ;"><span style="line-height: 17px; font-size: 15px; ;"><p class="MsoNormal"><span><strong>What does “Domain – Page mapping” mean?</strong></span></p><p class="MsoNormal"><span>You can map a specific CMS page in the site to a specific domain. So when the site is accessed via this domain, the mapped CMS page behaves as a root of the site.</span></p><span style="line-height: 115%; font-family: calibri, sans-serif; font-size: 11pt; ;"><span>The implementation was initially started in the following forum post: <a href="http://www.sitefinity.com/support/forums/sitefinity-3-x/developing-with-sitefinity/sub-domains.aspx">http://www.sitefinity.com/support/forums/sitefinity-3-x/developing-with-sitefinity/sub-domains.aspx</a></span></span><span><br /></span></span></span></div><div><span style="font-family: calibri; font-size: 18px; ;"><span style="line-height: 17px; font-size: 15px; ;"><br /></span></span></div><div><span style="font-family: calibri; font-size: 18px; ;"><span style="line-height: 17px; font-size: 15px; ;"><strong>Configuration:</strong></span></span></div><div><span style="font-family: calibri; font-size: 18px; ;"><span style="line-height: 17px; font-size: 15px; ;">All you need to do is to specify the mapping configuration rules under <strong>telerik/cms</strong> section in the web.config:</span></span></div><div><span style="font-family: calibri; font-size: 18px; ;"><span style="line-height: 17px; font-size: 15px; ;"><div style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(127, 157, 185); border-right-color: rgb(127, 157, 185); border-bottom-color: rgb(127, 157, 185); border-left-color: rgb(127, 157, 185); overflow-x: auto; overflow-y: auto; background-color: white; line-height: 100% !important; font-family: 'courier new'; font-size: 11px; ;"><table cellspacing="0" cellpadding="0" style="border-top-width: 0px; border-right-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); margin-top: 2px; margin-right: 0px; margin-bottom: 2px; margin-left: 0px; width: 99%; border-collapse: collapse; background-color: rgb(255, 255, 255); ;"> <col style="border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(247, 247, 247); font-family: 'courier new'; font-size: 11px; padding-left: 10px; white-space: nowrap; ;" /> <tbody> <tr> <td><span style="font-size: 11px; ;"></span><span style="color: blue; ;">&lt;</span><span style="font-size: 11px; ;">urlMappings</span><span style="color: blue; ;">&gt;</span><span style="font-size: 11px; ;"> </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;"> <span style="color: blue; ;">&lt;</span><span style="font-size: 11px; ;">add </span><span style="color: red; ;">key</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"&lt;domain&gt;"</span><span style="font-size: 11px; ;"> </span><span style="color: red; ;">value</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"&lt;page_path&gt;"</span><span style="font-size: 11px; ;"> </span><span style="color: blue; ;">/&gt;</span><span style="font-size: 11px; ;"> </span></td> </tr> <tr> <td> <span style="color: blue; ;">&lt;</span><span style="font-size: 11px; ;">add ... </span><span style="color: blue; ;">/&gt;</span><span style="font-size: 11px; ;"> </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;"> ... </td> </tr> <tr> <td><span style="color: blue; ;">&lt;/</span><span style="font-size: 11px; ;">urlMappings</span><span style="color: blue; ;">&gt;</span><span style="font-size: 11px; ;"> </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;"> <br /> </td> </tr> </tbody></table></div><span><br /></span></span></span></div><div><span style="font-family: calibri; font-size: 18px; ;"><span style="line-height: 17px; font-size: 15px; ;">where</span></span></div><div><span style="font-family: calibri; font-size: 18px; ;"><span style="line-height: 17px; font-size: 15px; ;"><em>&lt;domain&gt; </em> is the name of the domain, i.e.<em> www.mysite.com</em>, <em>blogs.mysite.com</em>, etc.</span></span></div><div><span style="font-family: calibri; font-size: 18px; ;"><span style="line-height: 17px; font-size: 15px; ;"><em>&lt;page_path&gt;</em> is the path to the page relative to the SiteMap root (without extension), i.e. <em>blogs</em>, <em>home/internal</em></span></span></div><div><span style="font-family: calibri; font-size: 18px; ;"><span style="line-height: 17px; font-size: 15px; ;"><br /></span></span></div><div><span style="font-family: calibri; font-size: 18px; ;"><span style="line-height: 17px; font-size: 15px; ;">The key and value attributes are required.<br /></span></span></div><div><span style="font-family: calibri; font-size: 18px; ;"><span style="line-height: 17px; font-size: 15px; ;">In the mapping <em>&lt;add&gt; </em>element, you can also specify shared attribute, which expects <em>True</em> ot <em>False</em>. It is optional with default value <em>False</em>. If shared="true", the mapped page node will be visible and accessible to the other domain; otherwise, it will be hidden for it. </span></span></div><div><span style="font-family: calibri; font-size: 18px; ;"><span style="line-height: 17px; font-size: 15px; ;"><br /></span></span></div><div><span style="font-family: calibri; font-size: 18px; ;"><span style="line-height: 17px; font-size: 15px; ;"><span style="line-height: 115%; font-family: calibri, sans-serif; font-size: 11pt; ;"><strong>Sample scenario:</strong></span><br /></span></span></div><div><span style="font-family: calibri; font-size: 18px; ;"><span style="line-height: 17px; font-size: 15px; ;"><br /></span></span></div><div><span style="font-family: calibri; font-size: 18px; ;"><span style="line-height: 17px; font-size: 15px; ;"><p class="MsoNormal"><span>For example, you have to create 3 Web sites:</span></p><p style="margin-left: 0.75in; text-indent: -0.25in; ;" class="MsoListParagraphCxSpFirst"><span><span><span>-<span style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-family: 'times new roman'; font-size: 7pt; ;"></span></span></span></span><span>mysite.com – the main Web Site</span></p><p style="margin-left: 0.75in; text-indent: -0.25in; ;" class="MsoListParagraphCxSpMiddle"><span><span><span>-<span style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-family: 'times new roman'; font-size: 7pt; ;"></span></span></span></span><span>blogs.mysite.com – for Blogs</span></p><p style="margin-left: 0.75in; text-indent: -0.25in; ;" class="MsoListParagraphCxSpLast"><span><span><span>-<span style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-family: 'times new roman'; font-size: 7pt; ;"></span></span></span></span><span>forums.mysite.com – for Forums</span></p><p class="MsoNormal"><span><span> </span></span><span>The three sites will share same resources, and you want to use single sign-in to manage their contents.</span></p><p class="MsoNormal"><span>The Site Map will have the following pages:</span></p><p style="margin-left: 0.75in; text-indent: -0.25in; ;" class="MsoListParagraphCxSpFirst"><span><span><span>-<span style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-family: 'times new roman'; font-size: 7pt; ;"></span></span></span></span><span>Home</span></p><p style="margin-left: 0.75in; text-indent: -0.25in; ;" class="MsoListParagraphCxSpMiddle"><span><span><span>-<span style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-family: 'times new roman'; font-size: 7pt; ;"></span></span></span></span><span>About</span></p><p style="margin-left: 0.75in; text-indent: -0.25in; ;" class="MsoListParagraphCxSpMiddle"><span><span><span>-<span style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-family: 'times new roman'; font-size: 7pt; ;"></span></span></span></span><span>Blogs</span></p><p style="margin-left: 1.25in; text-indent: -0.25in; ;" class="MsoListParagraphCxSpMiddle"><span style="font-family: 'courier new'; ;"><span><span>- <span style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-family: 'times new roman'; font-size: 7pt; ;"></span></span></span></span><span>Posts</span></p><p style="margin-left: 0.75in; text-indent: -0.25in; ;" class="MsoListParagraphCxSpMiddle"><span><span><span>-<span style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-family: 'times new roman'; font-size: 7pt; ;"></span></span></span></span><span>Forums</span></p><p style="margin-left: 1.25in; text-indent: -0.25in; ;" class="MsoListParagraphCxSpLast"><span style="font-family: 'courier new'; ;"><span><span>- <span style="font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; font-family: 'times new roman'; font-size: 7pt; ;"></span></span></span></span><span>Posts</span></p><p class="MsoNormal"><span>Without mapping, the blogs' posts will be accessible with:</span></p><p class="MsoNormal"><span><em>mysite.com/blogs/posts.aspx</em></span></p><p class="MsoNormal"><span>and the forums' posts with:</span></p><p class="MsoNormal"><span><em>mysite.com/forums/posts.aspx</em></span></p><p class="MsoNormal"><o:p><span> </span></o:p></p><p class="MsoNormal"><o:p><span>After applying the following domain mapping in the web.config:</span></o:p></p><p class="MsoNormal"><o:p></o:p></p><div style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(127, 157, 185); border-right-color: rgb(127, 157, 185); border-bottom-color: rgb(127, 157, 185); border-left-color: rgb(127, 157, 185); overflow-x: auto; overflow-y: auto; background-color: white; line-height: 100% !important; font-family: 'courier new'; font-size: 11px; ;"><table cellspacing="0" cellpadding="0" style="border-top-width: 0px; border-right-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); margin-top: 2px; margin-right: 0px; margin-bottom: 2px; margin-left: 0px; width: 99%; border-collapse: collapse; background-color: rgb(255, 255, 255); ;"> <col style="border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(247, 247, 247); font-family: 'courier new'; font-size: 11px; padding-left: 10px; white-space: nowrap; ;" /> <tbody> <tr> <td><span style="font-size: 11px; ;"></span><span style="color: blue; ;">&lt;</span><span style="font-size: 11px; ;">cms </span><span style="color: red; ;">defaultProvider</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"Sitefinity"</span><span style="font-size: 11px; ;"> ...</span><span style="color: blue; ;">&gt;</span><span style="font-size: 11px; ;"> </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;"> <span style="color: blue; ;">&lt;</span><span style="font-size: 11px; ;">urlMappings</span><span style="color: blue; ;">&gt;</span><span style="font-size: 11px; ;"> </span></td> </tr> <tr> <td> <span style="color: blue; ;">&lt;</span><span style="font-size: 11px; ;">add </span><span style="color: red; ;">key</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"blogs.mysite.com"</span><span style="font-size: 11px; ;"> </span><span style="color: red; ;">value</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"blogs"</span><span style="font-size: 11px; ;"> </span><span style="color: red; ;">shared</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"true"</span><span style="font-size: 11px; ;"> </span><span style="color: blue; ;">/&gt;</span><span style="font-size: 11px; ;"> </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;"> <span style="color: blue; ;">&lt;</span><span style="font-size: 11px; ;">add </span><span style="color: red; ;">key</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"forums.mysite.com"</span><span style="font-size: 11px; ;"> </span><span style="color: red; ;">value</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"forums"</span><span style="font-size: 11px; ;"> </span><span style="color: red; ;">shared</span><span style="font-size: 11px; ;">=</span><span style="color: blue; ;">"false"</span><span style="font-size: 11px; ;"> </span><span style="color: blue; ;">/&gt;</span><span style="font-size: 11px; ;"> </span></td> </tr> <tr> <td> <span style="color: blue; ;">&lt;/</span><span style="font-size: 11px; ;">urlMappings</span><span style="color: blue; ;">&gt;</span><span style="font-size: 11px; ;"> </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;"> <br /> </td> </tr> </tbody></table></div><span><br /></span><p></p><p class="MsoNormal"><span>.. when the Web Site is accessed via <em>blogs.mysite.com</em>, it will be opened starting from the <em>blogs </em>page. However, the blogs page will be still accessible through the other domains, because its <strong>shared </strong>attribute is set to <strong>True</strong>.</span></p><p class="MsoNormal"><span>The forums page will be accessible only through <em>forums.mysite.com</em>.</span></p><p class="MsoNormal"></p><p class="MsoNormal"><span><strong>Testing:</strong></span></p><p class="MsoNormal"><span>You can test it in your localhost before going to production. In order to do this you should edit <em>&lt;path_to_windows&gt;\System32\drivers\etc\hosts</em> file by adding the domains you want to test:</span></p><p class="MsoNormal"><span><strong></strong></span></p><span><strong><div style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(127, 157, 185); border-right-color: rgb(127, 157, 185); border-bottom-color: rgb(127, 157, 185); border-left-color: rgb(127, 157, 185); overflow-x: auto; overflow-y: auto; background-color: white; line-height: 100% !important; font-family: 'courier new'; font-size: 11px; ;"><table cellspacing="0" cellpadding="0" style="border-top-width: 0px; border-right-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: rgb(238, 238, 238); margin-top: 2px; margin-right: 0px; margin-bottom: 2px; margin-left: 0px; width: 99%; border-collapse: collapse; background-color: rgb(255, 255, 255); ;"> <col style="border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(247, 247, 247); font-family: 'courier new'; font-size: 11px; padding-left: 10px; white-space: nowrap; ;" /> <tbody> <tr> <td><span style="font-size: 11px; ;">127.0.0.1       localhost </span></td> </tr> <tr> <td style="background-color: rgb(247, 247, 247); ;">::1             localhost </td> </tr> <tr> <td> </td> </tr> <tr> <td><span style="background-color: rgb(146, 208, 80); ;">127.0.0.1       blogs.mysite.com </span></td> </tr> <tr> <td><span style="background-color: rgb(146, 208, 80); ;">127.0.0.1       forums.mysite.com </span></td> </tr> </tbody></table></div></strong></span><p></p><p class="MsoNormal"><span>Don't forget to rollback your changes after finishing with the tests.</span></p><p class="MsoNormal"></p><p class="MsoNormal"><span>The "Domain - Page mapping" is the default implementation of the <em>CmsUrlMappingService</em>. However, it is easy to build a custom mapping, based on the current <em>HttpContext </em>like "User - Page mapping" or "Cookie - Page mapping", which defines different SiteMap roots for specific users or for specific value in the cookie. How to do this will be handled in another KB.</span></p><p class="MsoNormal"></p></span></span></div> http://www.sitefinity.com/support/kb/sitefinity-3-x/the-“domain-–-page-mapping”-feature.aspx Vladimir Vasilev http://www.sitefinity.com/support/kb/sitefinity-3-x/the-%e2%80%9cdomain-%e2%80%93-page-mapping%e2%80%9d-feature.aspx d7fb0942-91b0-45fc-b40a-b3143749f92f Wed, 19 Aug 2009 05:01:00 GMT Social Bookmarks in Sitefinity <h2>Introduction</h2> <p>Social bookmarks are a way of sharing information on one's favourite social network. But first we must know how social bookmarks work in Sitefinity. I would like to point out that modifying basic things with Social Bookmarks in Sitefinity does not require programming skills.</p> <h2>Social Bookmarks in Sitefinity</h2> <p>Social bookarks are available for the following modules:</p> <ul> <li>Images &amp; Documents</li> <li>Generic Content</li> <li>Blogs</li> <li>Events</li> <li>News</li> </ul> <p>&nbsp;If you web site were located locally on your computer at C:\intetpub\wwwroot\dido, and it had a sub-folder C:\intetpub\wwwroot\dido\App_Data, I would refer from now on to the latter as ~/App_Data. Therefore, ~/ would mean the root directory of our web site.</p> <p>Social bookmarks settings are kept in the module's ControlTemplates directory. For example, for the news module, it would be ~/Sitefinity/ControlTemplates/News.</p> <p>In that directory, we have a file called socialBookmarkTemplate.xml. Here is a sample file:</p> <p></p> <div style="border: 1px solid #7f9db9; overflow: auto; background-color: white; line-height: 100% ! important; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; width: 99%; border-collapse: collapse; background-color: #ffffff;"> <col style="border-bottom: 1px solid #f7f7f7; font-family: courier new; font-size: 11px; padding-left: 10px; white-space: nowrap;" /> <tbody> <tr> <td><span style="font-size: 11px;"></span><span style="color: blue;">&lt;</span><span style="font-size: 11px;">bookmarks</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">itemTemplate</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">bookmark&nbsp;</span><span style="color: red;">title</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Facebook"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">name</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Facebook"</span><span style="font-size: 11px;">&gt;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">url</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&lt;![CDATA[http://www.facebook.com/sharer.php?</span><span style="color: red;">u</span><span style="font-size: 11px;">={0}&amp;</span><span style="color: red;">t</span><span style="font-size: 11px;">={1}]]</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&lt;/</span><span style="font-weight: bold; color: black;">url</span><span style="font-size: 11px;">&gt;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;/</span><span style="font-size: 11px;">bookmark</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">bookmark&nbsp;</span><span style="color: red;">title</span><span style="font-size: 11px;">=</span><span style="color: blue;">"StumbleUpon"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">name</span><span style="font-size: 11px;">=</span><span style="color: blue;">"StumbleUpon"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">url</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&lt;![CDATA[http://www.stumbleupon.com/submit?</span><span style="color: red;">url</span><span style="font-size: 11px;">={0}]]</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&lt;/</span><span style="font-weight: bold; color: black;">url</span><span style="font-size: 11px;">&gt;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;/</span><span style="font-size: 11px;">bookmark</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">bookmark&nbsp;</span><span style="color: red;">title</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Del.icio.us"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">name</span><span style="font-size: 11px;">=</span><span style="color: blue;">"delicious"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">url</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&lt;![CDATA[http://del.icio.us/post?</span><span style="color: red;">url</span><span style="font-size: 11px;">={0}&amp;</span><span style="color: red;">title</span><span style="font-size: 11px;">={1}]]</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&lt;/</span><span style="font-weight: bold; color: black;">url</span><span style="font-size: 11px;">&gt;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;/</span><span style="font-size: 11px;">bookmark</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;<span style="color: blue;">&lt;/</span><span style="font-size: 11px;">itemTemplate</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">extendedProperty</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">image</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">size</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">24</span><span style="color: blue;">&lt;/</span><span style="font-size: 11px;">size</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">extension</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">png</span><span style="color: blue;">&lt;/</span><span style="font-size: 11px;">extension</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;/</span><span style="font-size: 11px;">image</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;<span style="color: blue;">&lt;/</span><span style="font-size: 11px;">extendedProperty</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td><span style="color: blue;">&lt;/</span><span style="font-size: 11px;">bookmarks</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> </tbody> </table> </div> <p></p> <p></p> <p><strong>Important note!</strong></p> <em>Users with versions prior to 3.7 should upgrade this file, too - for all modules. You should add the CDATA element in the url tag.</em> <p></p> <p>&nbsp;Here, we have an item template and extended properties. Item template is used to list all social bookmarks, and the extended properties are used for naming (more on that later).</p> <p>&nbsp;Every bookmark element describes a single social bookmark. It has name, title and url. Name is what identifies this social bookamrks and participates in icon naming. Title is what shows as alternate text of the social bookmark's icon. </p> <p>&nbsp;Url is starts with &lt;!CDATA[ and ends with ]]&gt;. These are important, because they allow you to copy-paste the social bookmark url in this file without worrying about <a href="http://support.microsoft.com/kb/308060">escaping special XML characters</a>. In the url, we have two more important elements: {0} and {1}. These are placeholders for</p> <ul> <li>{0} =&gt; Url of the item that is going to be social-bookmark-ed</li> <li>{1} =&gt; Title of the blog post/news item/event/library item or Name of the generic content item.</li> </ul> These values are substituted by Sitefinity with the real values for you, so that when you click on the social bookmark, you will have the actual values. <p>&nbsp;</p> <p>For extended properties, we have image size and image extension. These apply to all social bookmarks. </p> <p>It is time to explain how images (icons) are mapped to social bookmarks. Right in the directory where socialBookmarkTemplate.xml. resides, there is a folder named SocialBookmark. All social bookmark images are there. Relating a bookmark element to a image in the SocialBookmark folder is guided by this rule:</p> <p>Final image name = SocialBookmarkName_ImageSize.ImageExtension.</p> <p>SocialBookmarkName is the name attribute of the bookmark element in socialBookmarkTemplate.xml, and ImageSize and ImageExtension come from the extended properties of the same file. This is done so that you can have two or more sets of icon sizes, and switching between them would be just a matter of editing a single value in the .xml file.</p> <h2>Customizing</h2> <p>If you want to change the icon of a social bookmark, all you have to do is change its image file. Now you know where to look for and what the social bookmark's name will be. </p> <p>Reordering the social bookmarks is done by reordering the bookmark elements in the xml file for a module.</p> <p>Removing a social bookmark is accomplished by removing its bookmark element.</p> <p>Adding a new social bookmark would require you to find out the url for adding a new item to the social network you use. This information would be generally located on the social network's official web site. Then you would add a new bookmark element and a properly named picture.</p> <h2>Conclusion</h2> <p>Social bookmarks in Sitefinity require no programming skills to be modified. They are an easy way to share your favourite pages with your friends.</p> http://www.sitefinity.com/support/kb/sitefinity-3-x/social-bookmarks-in-sitefinity.aspx Dilyan Rusev http://www.sitefinity.com/support/kb/sitefinity-3-x/social-bookmarks-in-sitefinity.aspx 3b2e766f-4c51-4d0c-9b61-a8455daadc71 Mon, 10 Aug 2009 15:38:00 GMT How to Wrap Generic Conent in a User Control <h1>Introduction </h1> While wrapping a GenericContent control in a custom control has its advantages, it is quicker to do it with a user control. This article is available in the <a href="http://www.sitefinity.com/documents/SitefinityDeveloperManual_Aricles_v3_6.chm">offline help</a> as well, but we decided to make it available as a KB, as well. <p>&nbsp;</p> <h2>Extensibility</h2> <p>Extending an existing control provided in Sitefinity is useful and time-saving - customizing existing controls take less time than creating new ones from scratch. The functionality the controls offer is prone to extension but it is up to each customer to define the exact requirements. This topic will provide an example for extending controls in Sitefinity by adding the Generic Content control to a user control.<br /> <br /> Entering content is the main functionality of the Generic Content control. Still, additional options such as choosing what to be visible to whom or when it should be visible are very useful. This would come in handy when setting different content of a page for registered and for unregistered users. </p> <p>&nbsp;</p> <h2>Example</h2> <p>A user control could wrap an existing <strong>GenericContent </strong>control, and implement the custom logic. The user control should implement <strong>IGenericContent</strong> interface and its Content property should have an appropriate <strong>ControlDesignerAttribute</strong>. For example:</p> <p><em>Mark-up:</em></p> <p> </p> <div style="border: 1px solid #7f9db9; overflow: auto; background-color: white; line-height: 100% ! important; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; width: 99%; border-collapse: collapse; background-color: #ffffff;"> <col style="border-bottom: 1px solid #f7f7f7; font-family: courier new; font-size: 11px; padding-left: 10px; white-space: nowrap;" /> <tbody> <tr> <td><span style="font-size: 11px;"></span><span style="color: blue;">&lt;</span><span style="font-size: 11px;">%@&nbsp;Control&nbsp;</span><span style="color: red;">Language</span><span style="font-size: 11px;">=</span><span style="color: blue;">"C#"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">AutoEventWireup</span><span style="font-size: 11px;">=</span><span style="color: blue;">"true"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">CodeFile</span><span style="font-size: 11px;">=</span><span style="color: blue;">"WrappingGCInUserControl.ascx.cs"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">Inherits</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Tickets_WrappingGCInUserControl"</span><span style="font-size: 11px;">&nbsp;%</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;"><span style="color: blue;">&lt;</span><span style="font-size: 11px;">%@&nbsp;Register&nbsp;</span><span style="color: red;">Assembly</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Telerik.Cms.Engine"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">Namespace</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Telerik.Cms.Engine.WebControls"</span><span style="font-size: 11px;">&nbsp;&nbsp;</span><span style="color: red;">TagPrefix</span><span style="font-size: 11px;">=</span><span style="color: blue;">"sfWeb"</span><span style="font-size: 11px;">&nbsp;%</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td><span style="color: blue;">&lt;</span><span style="font-size: 11px;">dl</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">dd</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">h2</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">Title</span><span style="color: blue;">&lt;/</span><span style="font-size: 11px;">h2</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;/</span><span style="font-size: 11px;">dd</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">dd</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">sfWeb:GenericContent&nbsp;</span><span style="color: red;">runat</span><span style="font-size: 11px;">=</span><span style="color: blue;">"server"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">ID</span><span style="font-size: 11px;">=</span><span style="color: blue;">"GenericContent1"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">/&gt;</span><span style="font-size: 11px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;/</span><span style="font-size: 11px;">dd</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">dd</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Footer&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;/</span><span style="font-size: 11px;">dd</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td><span style="color: blue;">&lt;/</span><span style="font-size: 11px;">dl</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> </tbody> </table> </div> <p></p> <em>Code-behind:</em> <p> </p> <div style="border: 1px solid #7f9db9; overflow: auto; background-color: white; line-height: 100% ! important; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; width: 99%; border-collapse: collapse; background-color: #ffffff;"> <col style="border-bottom: 1px solid #f7f7f7; font-family: courier new; font-size: 11px; padding-left: 10px; white-space: nowrap;" /> <tbody> <tr> <td><span style="font-size: 11px;"></span><span style="color: blue;">using</span><span style="font-size: 11px;">&nbsp;System;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;"><span style="color: blue;">using</span><span style="font-size: 11px;">&nbsp;System.ComponentModel;&nbsp;</span></td> </tr> <tr> <td><span style="color: blue;">using</span><span style="font-size: 11px;">&nbsp;System.Web.UI;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;"><span style="color: blue;">using</span><span style="font-size: 11px;">&nbsp;Telerik.Cms.Engine;&nbsp;</span></td> </tr> <tr> <td><span style="color: blue;">using</span><span style="font-size: 11px;">&nbsp;Telerik.Cms.Engine.WebControls;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;"><span style="color: blue;">using</span><span style="font-size: 11px;">&nbsp;Telerik.Framework.Web.Design;&nbsp;</span></td> </tr> <tr> <td><span style="color: blue;">using</span><span style="font-size: 11px;">&nbsp;Telerik.Web;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">[ControlDesignerAttribute(<span style="color: blue;">"Telerik.Cms.Engine.WebControls.Design.GenericContentDesigner,&nbsp;Telerik.Cms.Engine"</span><span style="font-size: 11px;">)]&nbsp;</span></td> </tr> <tr> <td><span style="color: blue;">public</span><span style="font-size: 11px;">&nbsp;partial&nbsp;</span><span style="color: blue;">class</span><span style="font-size: 11px;">&nbsp;Tickets_WrappingGCInUserControl&nbsp;:&nbsp;System.Web.UI.UserControl,&nbsp;IGenericContent&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">{&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;<span style="color: blue;">protected</span><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">void</span><span style="font-size: 11px;">&nbsp;Page_Load(</span><span style="color: blue;">object</span><span style="font-size: 11px;">&nbsp;sender,&nbsp;EventArgs&nbsp;e)&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;"><span style="color: gray;">&nbsp;&nbsp;&nbsp;#region&nbsp;IGenericContent&nbsp;Members</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;[CmsBrowsable(<span style="color: blue;">false</span><span style="font-size: 11px;">)]&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;[CmsPersistable(<span style="color: blue;">true</span><span style="font-size: 11px;">)]&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;<span style="color: blue;">public</span><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">string</span><span style="font-size: 11px;">&nbsp;Content&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">get</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">return</span><span style="font-size: 11px;">&nbsp;GenericContent1.Content;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">set</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GenericContent1.Content&nbsp;=&nbsp;value;&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;[Browsable(<span style="color: blue;">false</span><span style="font-size: 11px;">)]&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;<span style="color: blue;">public</span><span style="font-size: 11px;">&nbsp;Guid&nbsp;ContentID&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">get</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">return</span><span style="font-size: 11px;">&nbsp;GenericContent1.ContentID;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">set</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GenericContent1.ContentID&nbsp;=&nbsp;value;&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;<span style="color: blue;">public</span><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">string</span><span style="font-size: 11px;">&nbsp;ProviderName&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">get</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">return</span><span style="font-size: 11px;">&nbsp;GenericContent1.ProviderName;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">set</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GenericContent1.ProviderName&nbsp;=&nbsp;value;&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;[Browsable(<span style="color: blue;">false</span><span style="font-size: 11px;">)]&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;<span style="color: blue;">public</span><span style="font-size: 11px;">&nbsp;IContent&nbsp;SharedContent&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">get</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">return</span><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">this</span><span style="font-size: 11px;">.GenericContent1.SharedContent;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;<span style="color: blue;">public</span><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">bool</span><span style="font-size: 11px;">&nbsp;UseStagedVersion&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">get</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">return</span><span style="font-size: 11px;">&nbsp;GenericContent1.UseStagedVersion;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">set</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GenericContent1.UseStagedVersion&nbsp;=&nbsp;value;&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;[CmsBrowsable(<span style="color: blue;">false</span><span style="font-size: 11px;">),&nbsp;CmsPersistable(</span><span style="color: blue;">true</span><span style="font-size: 11px;">)]&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;<span style="color: blue;">public</span><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">bool</span><span style="font-size: 11px;">&nbsp;HasDynamicLinks&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">get</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">return</span><span style="font-size: 11px;">&nbsp;GenericContent1.HasDynamicLinks;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">set</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GenericContent1.HasDynamicLinks&nbsp;=&nbsp;value;&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;<span style="color: blue;">public</span><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">string</span><span style="font-size: 11px;">&nbsp;GetItemUrl(</span><span style="color: blue;">string</span><span style="font-size: 11px;">&nbsp;provider,&nbsp;Guid&nbsp;id,&nbsp;</span><span style="color: blue;">bool</span><span style="font-size: 11px;">&nbsp;resolveAsAbsoluteUrl)&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">return</span><span style="font-size: 11px;">&nbsp;GenericContent1.GetItemUrl(provider,&nbsp;id,&nbsp;resolveAsAbsoluteUrl);&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;<span style="color: blue;">public</span><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">void</span><span style="font-size: 11px;">&nbsp;RenderBinaryContent(HtmlTextWriter&nbsp;writer)&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GenericContent1.RenderBinaryContent(writer);&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;<span style="color: blue;">public</span><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">void</span><span style="font-size: 11px;">&nbsp;RenderTextContent(HtmlTextWriter&nbsp;writer)&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GenericContent1.RenderTextContent(writer);&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;"><span style="color: gray;">&nbsp;&nbsp;&nbsp;#endregion</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>}&nbsp;</td> </tr> </tbody> </table> </div> <p></p> <br /> http://www.sitefinity.com/support/kb/sitefinity-3-x/how-to-wrap-generic-conent-in-a-user-control.aspx Penka Ivanova http://www.sitefinity.com/support/kb/sitefinity-3-x/how-to-wrap-generic-conent-in-a-user-control.aspx 25def51e-c937-4403-b800-5ef9be890c74 Thu, 16 Jul 2009 11:47:55 GMT Editing Image Gallery causes IE7 Crash <span class="Apple-style-span" style="border-collapse: separate; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-family: 'times new roman'; color: #000000;"> <div style="margin: 0px; padding: 3px; background-image: none; word-wrap: break-word; text-align: left;"><span style="line-height: 16px; font-size: 12px; font-family: arial,sans-serif; color: #333333;"><span> </span> <div><span><span><strong>Problem:</strong></span></span></div> <span><span> </span></span> <div><span><span><strong><br /> </strong></span></span></div> <span><span> </span></span> <div><span><span>IE 7 crashes when one edits the Image Gallery Control.</span></span></div> <span><span> </span></span> <div><span><span><strong><br /> </strong></span></span></div> <span><span> </span></span> <div><span><span><strong>Solution:</strong></span></span></div> <span><span> </span></span> <div><span><span><br /> </span></span></div> <span><span>The problem is related to the way IE7 parses the rendered HTML by PagingSetting server controls in the ImageGalleryControlDesigner template and there are two options to avoid it.<br style="margin: 0px; padding: 0px;" /> <br style="margin: 0px; padding: 0px;" /> You should make the designer template external (you can find all external templates and their mapping configuration in the download section in your Client.net account):<br style="margin: 0px; padding: 0px;" /> <br style="margin: 0px; padding: 0px;" /> 1. In the ~/App_Data/Configuration/Telerik.Sitefinity.Configuration.ControlsConfig.xml add the following template mapping:<br style="margin: 0px; padding: 0px;" /> <br style="margin: 0px; padding: 0px;" /> </span></span> <div class="tFormatCodeBlock supportThreadCodeBlock" style="border: 1px solid #7f9db9; margin: 0px; padding: 0px 0px 20px; overflow: auto; color: #333333; background-color: white; line-height: 11px; font-family: 'courier new'; font-size: 11px;"><span><span> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-right: 0px dashed #999999; border-bottom: 0px solid #eeeeee; margin: 2px 0px; padding: 0px; line-height: 13px; width: 798px; border-collapse: collapse; background-color: #ffffff;"> <col style="border-bottom: 1px solid #f7f7f7; margin: 0px; padding: 0px 0px 0px 10px; font-family: 'courier new'; font-size: 11px; white-space: nowrap;" /> <tbody style="margin: 0px; padding: 0px;"> <tr style="margin: 0px; padding: 0px;"> <td style="border-top: 1px dashed #999999; border-left: 1px dashed #999999; margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; font-size: 11px;"></span><span style="margin: 0px; padding: 0px; color: blue;">&lt;?</span><span style="margin: 0px; padding: 0px; font-size: 11px;">xml&nbsp;</span><span style="margin: 0px; padding: 0px; color: red;">version</span><span style="margin: 0px; padding: 0px; font-size: 11px;">=</span><span style="margin: 0px; padding: 0px; color: blue;">"1.0"</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;</span><span style="margin: 0px; padding: 0px; color: red;">encoding</span><span style="margin: 0px; padding: 0px; font-size: 11px;">=</span><span style="margin: 0px; padding: 0px; color: blue;">"utf-8"</span><span style="margin: 0px; padding: 0px; font-size: 11px;">?&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td> </tr> <tr style="margin: 0px; padding: 0px;"> <td style="border-top: 1px dashed #999999; border-left: 1px dashed #999999; margin: 0px; padding: 0px; background-color: #f7f7f7;"><span style="margin: 0px; padding: 0px; color: blue;">&lt;</span><span style="margin: 0px; padding: 0px; font-size: 11px;">controlsConfig</span><span style="margin: 0px; padding: 0px; color: blue;">&gt;</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td> </tr> <tr style="margin: 0px; padding: 0px;"> <td style="border-top: 1px dashed #999999; border-left: 1px dashed #999999; margin: 0px; padding: 0px;">&nbsp;&nbsp;<span style="margin: 0px; padding: 0px; color: blue;">&lt;</span><span style="margin: 0px; padding: 0px; font-size: 11px;">viewMap</span><span style="margin: 0px; padding: 0px; color: blue;">&gt;</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td> </tr> <tr style="margin: 0px; padding: 0px;"> <td style="border-top: 1px dashed #999999; border-left: 1px dashed #999999; margin: 0px; padding: 0px; background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="margin: 0px; padding: 0px; color: blue;">&lt;</span><span style="margin: 0px; padding: 0px; font-size: 11px;">viewSettings&nbsp;</span><span style="margin: 0px; padding: 0px; color: red;">hostType</span><span style="margin: 0px; padding: 0px; font-size: 11px;">=</span><span style="margin: 0px; padding: 0px; color: blue;">"Telerik.Libraries.WebControls.Design.ImageGalleryDesigner"</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td> </tr> <tr style="margin: 0px; padding: 0px;"> <td style="border-top: 1px dashed #999999; border-left: 1px dashed #999999; margin: 0px; padding: 0px;">&nbsp;</td> </tr> <tr style="margin: 0px; padding: 0px;"> <td style="border-top: 1px dashed #999999; border-left: 1px dashed #999999; margin: 0px; padding: 0px; background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="margin: 0px; padding: 0px; color: red;">layoutTemplatePath</span><span style="margin: 0px; padding: 0px; font-size: 11px;">=</span><span style="margin: 0px; padding: 0px; color: blue;">"~/Sitefinity/Admin/ControlTemplates/Libraries/ImageGalleryControlDesigner.ascx"</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;</span><span style="margin: 0px; padding: 0px; color: blue;">/&gt;</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td> </tr> <tr style="margin: 0px; padding: 0px;"> <td style="border-top: 1px dashed #999999; border-left: 1px dashed #999999; margin: 0px; padding: 0px;">&nbsp;&nbsp;<span style="margin: 0px; padding: 0px; color: blue;">&lt;/</span><span style="margin: 0px; padding: 0px; font-size: 11px;">viewMap</span><span style="margin: 0px; padding: 0px; color: blue;">&gt;</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td> </tr> <tr style="margin: 0px; padding: 0px;"> <td style="border-top: 1px dashed #999999; border-left: 1px dashed #999999; margin: 0px; padding: 0px; background-color: #f7f7f7;"><span style="margin: 0px; padding: 0px; color: blue;">&lt;/</span><span style="margin: 0px; padding: 0px; font-size: 11px;">controlsConfig</span><span style="margin: 0px; padding: 0px; color: blue;">&gt;</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td> </tr> </tbody> </table> </span></span></div> <span><span> <br style="margin: 0px; padding: 0px;" /> <br style="margin: 0px; padding: 0px;" /> layoutTemplatePath is the path where you store the external template. Generally you can add it to&nbsp; ~/Sitefinity/Admin/ControlTemplates/Libraries/ImageGalleryControlDesigner.ascx<br style="margin: 0px; padding: 0px;" /> <br style="margin: 0px; padding: 0px;" /> Open the ~/Sitefinity/Admin/ControlTemplates/Libraries/ImageGalleryControlDesigner.ascx for edit and find the first instance of PagingSetting control:<br style="margin: 0px; padding: 0px;" /> <br style="margin: 0px; padding: 0px;" /> </span></span> <div class="tFormatCodeBlock supportThreadCodeBlock" style="border: 1px solid #7f9db9; margin: 0px; padding: 0px 0px 20px; overflow: auto; color: #333333; background-color: white; line-height: 11px; font-family: 'courier new'; font-size: 11px;"><span><span> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-right: 0px dashed #999999; border-bottom: 0px solid #eeeeee; margin: 2px 0px; padding: 0px; line-height: 13px; width: 910px; border-collapse: collapse; background-color: #ffffff;"> <col style="border-bottom: 1px solid #f7f7f7; margin: 0px; padding: 0px 0px 0px 10px; font-family: 'courier new'; font-size: 11px; white-space: nowrap;" /> <tbody style="margin: 0px; padding: 0px;"> <tr style="margin: 0px; padding: 0px;"> <td style="border-top: 1px dashed #999999; border-left: 1px dashed #999999; margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; font-size: 11px;"></span><span style="margin: 0px; padding: 0px; color: blue;">&lt;</span><span style="margin: 0px; padding: 0px; font-size: 11px;">sf:PresentationModeSettings&nbsp;</span><span style="margin: 0px; padding: 0px; color: red;">ID</span><span style="margin: 0px; padding: 0px; font-size: 11px;">=</span><span style="margin: 0px; padding: 0px; color: blue;">"ModeSettings1"</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;</span><span style="margin: 0px; padding: 0px; color: red;">runat</span><span style="margin: 0px; padding: 0px; font-size: 11px;">=</span><span style="margin: 0px; padding: 0px; color: blue;">"server"</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td> </tr> <tr style="margin: 0px; padding: 0px;"> <td style="border-top: 1px dashed #999999; border-left: 1px dashed #999999; margin: 0px; padding: 0px; background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="margin: 0px; padding: 0px; color: blue;">&lt;</span><span style="margin: 0px; padding: 0px; font-size: 11px;">DetailHeaderTemplate</span><span style="margin: 0px; padding: 0px; color: blue;">&gt;</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td> </tr> <tr style="margin: 0px; padding: 0px;"> <td style="border-top: 1px dashed #999999; border-left: 1px dashed #999999; margin: 0px; padding: 0px;">&nbsp;&nbsp;&nbsp;&nbsp;...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td> </tr> <tr style="margin: 0px; padding: 0px;"> <td style="border-top: 1px dashed #999999; border-left: 1px dashed #999999; margin: 0px; padding: 0px; background-color: #f7f7f7;">&nbsp;</td> </tr> <tr style="margin: 0px; padding: 0px;"> <td style="border-top: 1px dashed #999999; border-left: 1px dashed #999999; margin: 0px; padding: 0px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="margin: 0px; padding: 0px; color: blue;">&lt;</span><span style="margin: 0px; padding: 0px; font-size: 11px;">sf:PagingSetting&nbsp;</span><span style="margin: 0px; padding: 0px; color: red;">id</span><span style="margin: 0px; padding: 0px; font-size: 11px;">=</span><span style="margin: 0px; padding: 0px; color: blue;">"pagingSetting"</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;</span><span style="margin: 0px; padding: 0px; color: red;">AllowPagingSetting</span><span style="margin: 0px; padding: 0px; font-size: 11px;">=</span><span style="margin: 0px; padding: 0px; color: blue;">"true"</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;</span><span style="margin: 0px; padding: 0px; color: red;">DefaultPageCount</span><span style="margin: 0px; padding: 0px; font-size: 11px;">=</span><span style="margin: 0px; padding: 0px; color: blue;">"10"</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;</span><span style="margin: 0px; padding: 0px; color: red;">AllowPaging</span><span style="margin: 0px; padding: 0px; font-size: 11px;">=</span><span style="margin: 0px; padding: 0px; color: blue;">"true"</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;</span><span style="margin: 0px; padding: 0px; color: red;">runat</span><span style="margin: 0px; padding: 0px; font-size: 11px;">=</span><span style="margin: 0px; padding: 0px; color: blue;">"server"</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;</span><span style="margin: 0px; padding: 0px; color: blue;">/&gt;</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;</span></td> </tr> </tbody> </table> </span></span></div> <span><span> <br style="margin: 0px; padding: 0px;" /> Approach 1:<br style="margin: 0px; padding: 0px;" /> <br style="margin: 0px; padding: 0px;" /> Remove the instance of the control from the template<br style="margin: 0px; padding: 0px;" /> <br style="margin: 0px; padding: 0px;" /> Approach 2:<br style="margin: 0px; padding: 0px;" /> <br style="margin: 0px; padding: 0px;" /> Duplicated the PagingSetting control:<br style="margin: 0px; padding: 0px;" /> <br style="margin: 0px; padding: 0px;" /> </span></span> <div class="tFormatCodeBlock supportThreadCodeBlock" style="border: 1px solid #7f9db9; margin: 0px; padding: 0px 0px 20px; overflow: auto; color: #333333; background-color: white; line-height: 11px; font-family: 'courier new'; font-size: 11px;"><span><span> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-right: 0px dashed #999999; border-bottom: 0px solid #eeeeee; margin: 2px 0px; padding: 0px; line-height: 13px; width: 903px; border-collapse: collapse; background-color: #ffffff;"> <col style="border-bottom: 1px solid #f7f7f7; margin: 0px; padding: 0px 0px 0px 10px; font-family: 'courier new'; font-size: 11px; white-space: nowrap;" /> <tbody style="margin: 0px; padding: 0px;"> <tr style="margin: 0px; padding: 0px;"> <td style="border-top: 1px dashed #999999; border-left: 1px dashed #999999; margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; font-size: 11px;"></span><span style="margin: 0px; padding: 0px; color: blue;">&lt;</span><span style="margin: 0px; padding: 0px; font-size: 11px;">sf:PagingSetting&nbsp;</span><span style="margin: 0px; padding: 0px; color: red;">id</span><span style="margin: 0px; padding: 0px; font-size: 11px;">=</span><span style="margin: 0px; padding: 0px; color: blue;">"pagingSetting"</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;</span><span style="margin: 0px; padding: 0px; color: red;">AllowPagingSetting</span><span style="margin: 0px; padding: 0px; font-size: 11px;">=</span><span style="margin: 0px; padding: 0px; color: blue;">"true"</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;</span><span style="margin: 0px; padding: 0px; color: red;">DefaultPageCount</span><span style="margin: 0px; padding: 0px; font-size: 11px;">=</span><span style="margin: 0px; padding: 0px; color: blue;">"10"</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;</span><span style="margin: 0px; padding: 0px; color: red;">AllowPaging</span><span style="margin: 0px; padding: 0px; font-size: 11px;">=</span><span style="margin: 0px; padding: 0px; color: blue;">"true"</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;</span><span style="margin: 0px; padding: 0px; color: red;">runat</span><span style="margin: 0px; padding: 0px; font-size: 11px;">=</span><span style="margin: 0px; padding: 0px; color: blue;">"server"</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;</span><span style="margin: 0px; padding: 0px; color: blue;">/&gt;</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td> </tr> <tr style="margin: 0px; padding: 0px;"> <td style="border-top: 1px dashed #999999; border-left: 1px dashed #999999; margin: 0px; padding: 0px; background-color: #f7f7f7;"><span style="margin: 0px; padding: 0px; color: blue;">&lt;</span><span style="margin: 0px; padding: 0px; font-size: 11px;">sf:PagingSetting&nbsp;</span><span style="margin: 0px; padding: 0px; color: red;">id</span><span style="margin: 0px; padding: 0px; font-size: 11px;">=</span><span style="margin: 0px; padding: 0px; color: blue;">"pagingSetting1"</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;</span><span style="margin: 0px; padding: 0px; color: red;">AllowPagingSetting</span><span style="margin: 0px; padding: 0px; font-size: 11px;">=</span><span style="margin: 0px; padding: 0px; color: blue;">"true"</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;</span><span style="margin: 0px; padding: 0px; color: red;">DefaultPageCount</span><span style="margin: 0px; padding: 0px; font-size: 11px;">=</span><span style="margin: 0px; padding: 0px; color: blue;">"10"</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;</span><span style="margin: 0px; padding: 0px; color: red;">AllowPaging</span><span style="margin: 0px; padding: 0px; font-size: 11px;">=</span><span style="margin: 0px; padding: 0px; color: blue;">"true"</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;</span><span style="margin: 0px; padding: 0px; color: red;">runat</span><span style="margin: 0px; padding: 0px; font-size: 11px;">=</span><span style="margin: 0px; padding: 0px; color: blue;">"server"</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;</span><span style="margin: 0px; padding: 0px; color: blue;">/&gt;</span><span style="margin: 0px; padding: 0px; font-size: 11px;">&nbsp;</span></td> </tr> </tbody> </table> </span></span></div> <span><span> <br style="margin: 0px; padding: 0px;" /> The templates and ControlsConfig file are attached for your convenience. Let us know if there is anything else that we can do for you.</span></span></span></div> <span> </span></span> http://www.sitefinity.com/support/kb/sitefinity-3-x/editing-image-gallery-causes-ie7-crash.aspx Georgi and Radoslav http://www.sitefinity.com/support/kb/sitefinity-3-x/editing-image-gallery-causes-ie7-crash.aspx c3f4801c-d1ee-4d5e-9833-987e8141b533 Thu, 09 Jul 2009 13:16:04 GMT Google Checkout Integration <div> <link href="styles/tableStyle.css" type="text/css" rel="stylesheet" /></div> <span style="text-decoration: underline;"><strong>Introduction</strong></span><br /> <br /> In a basic view, an e-Commerce system is a product list, a shopping cart and a checkout area. Many businesses will provide you with a shopping cart and checkout area. Often, they pass a small fee to your customers for their services. Sitefinity can provide you with a product list with the added benefit of built-in categories and tag lists. In this example, I shall use the EventsView with a Google Checkout button, demonstrating basic e-Commerce functionality with Sitefinity out of the box.<br /> <br /> <span style="text-decoration: underline;"><strong>Installation</strong></span><br /> <br /> For the purposes of this demonstration, I shall provide you with the necessary files to install Google Checkout to allow users to pay for events. Here is how to install them:<br /> <br /> 1. Download the sample project, which is shown below this article<br /> 2. Using the same folder structure, copy the files into Sitefinity<br /> 3. In your Web.config and under the &lt;/configSections&gt; tag, add the necessary app settings:<br /> <br /> <div style="border: 1px solid #7f9db9; overflow: auto; background-color: white; line-height: 100% ! important; font-family: courier new; font-size: 11px;" class="tFormatCodeBlock supportThreadCodeBlock"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; width: 99%; border-collapse: collapse; background-color: #ffffff;"> <col style="border-bottom: 1px solid #f7f7f7; font-family: courier new; font-size: 11px; padding-left: 10px; white-space: nowrap;" /> <tbody> <tr> <td><span style="font-size: 11px;">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: blue;">&lt;</span><span style="font-size: 11px;">appSettings</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">add&nbsp;</span><span style="color: red;">key</span><span style="font-size: 11px;">=</span><span style="color: blue;">"GoogleMerchantID"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">value</span><span style="font-size: 11px;">=</span><span style="color: blue;">"xxxxx"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">/&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">add&nbsp;</span><span style="color: red;">key</span><span style="font-size: 11px;">=</span><span style="color: blue;">"GoogleMerchantKey"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">value</span><span style="font-size: 11px;">=</span><span style="color: blue;">"xxxxx"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">/&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;</span><span style="font-size: 11px;">add&nbsp;</span><span style="color: red;">key</span><span style="font-size: 11px;">=</span><span style="color: blue;">"GoogleEnvironment"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">value</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Sandbox"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">/&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">&lt;/</span><span style="font-size: 11px;">appSettings</span><span style="color: blue;">&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;</td> </tr> </tbody> </table> </div> <br /> 4. In your Web.config, add this line of code beneath the &lt;metaFields&gt; tag:<br /> <br /> <div class="tFormatCodeBlock supportThreadCodeBlock" style="border: 1px solid #7f9db9; overflow: auto; background-color: white; line-height: 100% ! important; font-family: courier new; font-size: 11px;"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; width: 99%; border-collapse: collapse; background-color: #ffffff;"> <col style="border-bottom: 1px solid #f7f7f7; font-family: courier new; font-size: 11px; padding-left: 10px; white-space: nowrap;" /> <tbody> <tr> <td><span style="font-size: 11px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: blue;">&lt;</span><span style="font-size: 11px;">add&nbsp;</span><span style="color: red;">key</span><span style="font-size: 11px;">=</span><span style="color: blue;">"Events.Price"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">valueType</span><span style="font-size: 11px;">=</span><span style="color: blue;">"ShortText"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">visible</span><span style="font-size: 11px;">=</span><span style="color: blue;">"True"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">searchable</span><span style="font-size: 11px;">=</span><span style="color: blue;">"True"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">sortable</span><span style="font-size: 11px;">=</span><span style="color: blue;">"True"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: red;">defaultValue</span><span style="font-size: 11px;">=</span><span style="color: blue;">"0"</span><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">/&gt;</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;</td> </tr> </tbody> </table> </div> <br /> <br /> 5. Login to your Sitefinity project. <br /> 6. Click on Pages<br /> 7. Select a page and click <em>Edit this Page</em> or <em>Edit this Language Version</em> if localization is turned on<br /> 8. From the toolbox on the right, drag and drop an EventsView<br /> 9. Click Edit on the EventsView<br /> 10. Click on the Advanced Tab<br /> 11. Expand the appearance section and under the ItemListTemplatePath property, enter this path:<br /> <br /> <strong>~\Sitefinity\ControlTemplates\Events\ContentViewItemView.ascx</strong><br /> <br /> 11. Click I'm done<br /> 12. Click Publish or Save, depending on the workflow settings.<br /> <br /> If workflow is turned on, make sure that the page is approved and later published.<br /> <br /> <span style="text-decoration: underline;"><strong>Obtaining an Google Merchant ID and a Google Merchant Key</strong></span><br /> <br /> For this example, we will use the Google Sandbox to do test sales. This will ensure that the orders are not processed while we do custom development. As with most 3rd party applications, you must obtain a user name and password to use their API. Often times, this is known as an API key with a special secret key. To obtain this info, please visit <a href="http://code.google.com/apis/checkout/developer/Google_Checkout_Basic_HTML_Sandbox.html#Locate_ID_and_Key">Google Checkout's website</a>.<br /> <br /> When this is complete, enter the data into the app settings keys of your application. If you'd like to use this in a production envionment, you must change the App Settings Environment variable to production and <a href="http://checkout.google.com/sell/">obtain a production Merchant ID and Merchant key</a>.<br /> <br /> <span style="text-decoration: underline;"><strong>Create Events with a Price</strong></span><br /> <br /> Once this is complete, login to the CMS and click <strong>Modules &gt; Events</strong>. Create some new events and add a price for them. <br /> <br /> <strong><span style="text-decoration: underline;">Checking out with Google</span></strong><br /> <br /> Now that this code has been inserted and you have events with prices, here is the end result:<br /> <br /> <img alt="" src="http://admin.telerik.com/Images/editor/joesCookout.jpg" /><br /> <br /> <span style="text-decoration: underline;"><strong>Explaining the code</strong></span><br /> <br /> Google uses a special button control along with a method called AddItem. This method redirects the user to a URL, based on the product name, price and quantity. In this case, I passed the Event's meta data into this method. To get that data, I extracted the event's ID and passed the parameters into the EventManager's GetContent method. Here is the annotated code:<br /> <br /> <div style="border: 1px solid #7f9db9; overflow: auto; background-color: white; line-height: 100% ! important; font-family: courier new; font-size: 11px;" class="tFormatCodeBlock supportThreadCodeBlock"> <table cellspacing="0" cellpadding="0" style="border-width: 0px; border-bottom: 0px solid #eeeeee; margin: 2px 0px; width: 99%; border-collapse: collapse; background-color: #ffffff;"> <col style="border-bottom: 1px solid #f7f7f7; font-family: courier new; font-size: 11px; padding-left: 10px; white-space: nowrap;" /> <tbody> <tr> <td><span style="font-size: 11px;"></span><span style="color: blue;">using</span><span style="font-size: 11px;">&nbsp;Telerik.Events;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;"><span style="color: blue;">using</span><span style="font-size: 11px;">&nbsp;Telerik.Cms.Engine;&nbsp;</span></td> </tr> <tr> <td><span style="color: blue;">using</span><span style="font-size: 11px;">&nbsp;GCheckout.Checkout;&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;"><span style="color: blue;">using</span><span style="font-size: 11px;">&nbsp;GCheckout.Util;&nbsp;</span></td> </tr> <tr> <td>&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;"><span style="color: blue;">public</span><span style="font-size: 11px;">&nbsp;partial&nbsp;</span><span style="color: blue;">class</span><span style="font-size: 11px;">&nbsp;Sitefinity_ControlTemplates_Events_ContentViewItemView&nbsp;:&nbsp;System.Web.UI.UserControl&nbsp;</span></td> </tr> <tr> <td>{&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">protected</span><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">void</span><span style="font-size: 11px;">&nbsp;Page_Load(</span><span style="color: blue;">object</span><span style="font-size: 11px;">&nbsp;sender,&nbsp;EventArgs&nbsp;e)&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">public</span><span style="font-size: 11px;">&nbsp;</span><span style="color: blue;">void</span><span style="font-size: 11px;">&nbsp;repeater_ItemDataBound(</span><span style="color: blue;">object</span><span style="font-size: 11px;">&nbsp;sender,&nbsp;RepeaterItemEventArgs&nbsp;e)&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: green;">//Assign&nbsp;the&nbsp;event&nbsp;ID&nbsp;to&nbsp;the&nbsp;button's&nbsp;command&nbsp;argument,&nbsp;so&nbsp;it&nbsp;can&nbsp;be&nbsp;used&nbsp;later</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">if</span><span style="font-size: 11px;">&nbsp;(e.Item.ItemType&nbsp;==&nbsp;ListItemType.Item&nbsp;||&nbsp;e.Item.ItemType&nbsp;==&nbsp;ListItemType.AlternatingItem)&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EventsManager&nbsp;manager&nbsp;=&nbsp;<span style="color: blue;">new</span><span style="font-size: 11px;">&nbsp;EventsManager(</span><span style="color: blue;">"Events"</span><span style="font-size: 11px;">);&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IContent&nbsp;content&nbsp;=&nbsp;(IContent)e.Item.DataItem;&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GCheckoutButton&nbsp;button&nbsp;=&nbsp;(GCheckoutButton)e.Item.FindControl(<span style="color: blue;">"GCheckoutButton1"</span><span style="font-size: 11px;">);&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">if</span><span style="font-size: 11px;">&nbsp;(button&nbsp;!=&nbsp;</span><span style="color: blue;">null</span><span style="font-size: 11px;">)&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;button.CommandName&nbsp;=&nbsp;<span style="color: blue;">"Select"</span><span style="font-size: 11px;">;&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;button.CommandArgument&nbsp;=&nbsp;content.ID.ToString();&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: green;">//Subscribe&nbsp;to&nbsp;the&nbsp;button's&nbsp;click&nbsp;event</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;button.Click&nbsp;+=&nbsp;<span style="color: blue;">new</span><span style="font-size: 11px;">&nbsp;ImageClickEventHandler(button_Click);&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td>&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">void</span><span style="font-size: 11px;">&nbsp;button_Click(</span><span style="color: blue;">object</span><span style="font-size: 11px;">&nbsp;sender,&nbsp;ImageClickEventArgs&nbsp;e)&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: green;">//Since&nbsp;this&nbsp;button&nbsp;is&nbsp;inside&nbsp;of&nbsp;a&nbsp;repeater,&nbsp;you&nbsp;must&nbsp;cast&nbsp;the&nbsp;sender&nbsp;object&nbsp;as&nbsp;a&nbsp;Google&nbsp;Checkout&nbsp;button</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GCheckoutButton&nbsp;GCheckoutButton1&nbsp;=&nbsp;&nbsp;(GCheckoutButton)sender;&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: green;">//Get&nbsp;the&nbsp;ID&nbsp;of&nbsp;the&nbsp;event</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Guid&nbsp;EventID&nbsp;=&nbsp;<span style="color: blue;">new</span><span style="font-size: 11px;">&nbsp;Guid(GCheckoutButton1.CommandArgument);&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">if</span><span style="font-size: 11px;">&nbsp;(EventID&nbsp;!=&nbsp;</span><span style="color: blue;">null</span><span style="font-size: 11px;">)&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EventsManager&nbsp;manager&nbsp;=&nbsp;<span style="color: blue;">new</span><span style="font-size: 11px;">&nbsp;EventsManager(</span><span style="color: blue;">"Events"</span><span style="font-size: 11px;">);&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IContent&nbsp;content&nbsp;=&nbsp;manager.Content.GetContent(EventID);&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: green;">//Pass&nbsp;the&nbsp;event's&nbsp;name,&nbsp;description,&nbsp;left&nbsp;null&nbsp;here,&nbsp;price&nbsp;and&nbsp;quanity&nbsp;to&nbsp;Google&nbsp;Checkout</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CheckoutShoppingCartRequest&nbsp;Req&nbsp;=&nbsp;GCheckoutButton1.CreateRequest();&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Req.AddItem(content.GetMetaData(<span style="color: blue;">"Title"</span><span style="font-size: 11px;">).ToString(),&nbsp;String.Empty,&nbsp;Convert.ToDecimal(content.GetMetaData(</span><span style="color: blue;">"Price"</span><span style="font-size: 11px;">)),&nbsp;1);&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GCheckoutResponse&nbsp;Resp&nbsp;=&nbsp;Req.Send();&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: green;">//Report&nbsp;any&nbsp;errors</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">if</span><span style="font-size: 11px;">&nbsp;(Resp.IsGood)&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Redirect(Resp.RedirectUrl,&nbsp;<span style="color: blue;">true</span><span style="font-size: 11px;">);&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: blue;">else</span><span style="font-size: 11px;">&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write(<span style="color: blue;">"ResponseXml&nbsp;=&nbsp;"</span><span style="font-size: 11px;">&nbsp;+&nbsp;Resp.ResponseXml&nbsp;+&nbsp;</span><span style="color: blue;">"&lt;br&gt;"</span><span style="font-size: 11px;">);&nbsp;</span></td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Response.Write(<span style="color: blue;">"ErrorMessage&nbsp;=&nbsp;"</span><span style="font-size: 11px;">&nbsp;+&nbsp;Resp.ErrorMessage&nbsp;+&nbsp;</span><span style="color: blue;">"&lt;br&gt;"</span><span style="font-size: 11px;">);&nbsp;</span></td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td>&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;</td> </tr> <tr> <td style="background-color: #f7f7f7;">}&nbsp;</td> </tr> </tbody> </table> </div> <br /> For more information about Google Checkout, please read <a href="http://code.google.com/apis/checkout/samples/Google_Checkout_Sample_Code_NET.html">Getting Started with Google Checkout</a>. For more info on the Event's module's API please red our <a href="http://checkout.google.com/sell/">Developer Manual</a>. <br /> <br /> http://www.sitefinity.com/support/kb/sitefinity-3-x/google-checkout-integration.aspx Joseph Anderson http://www.sitefinity.com/support/kb/sitefinity-3-x/google-checkout-integration.aspx a0f1de01-1f31-40fe-a59f-5afc2c058d0c Thu, 14 May 2009 12:02:08 GMT