1: /// <summary>
2: /// Custom control class representing the SilverlightControl - will be used to provide a custom installation experience for the client if
3: /// Silverlight is not installed.
4: /// </summary>
5: public class SilverlightBase : System.Web.UI.SilverlightControls.Silverlight
6: { 7: public SilverlightBase()
8: { 9: base.PluginNotInstalledTemplate = new PlugInTemplate();
10: }
11: }
12:
13: /// <summary>
14: /// ITemplate class to add to the custom Silverlight control
15: /// </summary>
16: public class PlugInTemplate: ITemplate
17: { 18: #region ITemplate Members
19:
20: public void InstantiateIn(Control container)
21: { 22: StringBuilder str = new StringBuilder();
23: str.Append("<h2>Get Microsoft Silverlight 2</h2>"); 24: str.Append("<p>This application requires Microsoft Silverlight 2 to " + 25: "provide a rich integrated media experience. Silverlight is a small, " +
26: "safe, cross-platform browser plugin created and supported by Microsoft.</p>");
27:
28: str.Append("<p><div style='position:absolute;'>" + 29: "<a href='http://go.microsoft.com/fwlink/?LinkID=124807' " +
30: "style='text-decoration: none;'><img src='http://go.microsoft.com/fwlink/?LinkId=108181' " +
31: "alt='Get Microsoft Silverlight' style='border-style: none'/></div></p>");
32:
33: System.Web.UI.WebControls.Label txt = new System.Web.UI.WebControls.Label();
34: txt.ID = "lblMess";
35: txt.Text = str.ToString();
36:
37: container.Controls.Add(txt);
38: }
39:
40: #endregion
41: }
42: }