Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Html bridge


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Html bridge

  1. 1. HTML Bridge<br />Mahender<br />Senior Software Engineer<br />United Health Group<br />
  2. 2. Mahender Sarangam<br />Having 5 years of experience on .NET Technologies. Working as a Senior Software Engineer in United Health Group (UHG India Information Service Ltd.). Worked with Big Firms like Deloitte Consulting & Wipro Technology. <br />Got Technical Acquaintance on Technologies like C#, ASP.NET,AJAX, LINQ, Silverlight, WPF,WCF ,SQL Server, Team Foundation Server(TFS) and SharePoint Technology. <br />MCTS Certified in Web Technologies.<br />Blog : <br />
  3. 3. HTML Bridge<br /><ul><li> HTML Bridge is a technology in Silverlight that enables you to access the HTML Document Object Model (DOM) from managed code, and to call managed code from JavaScript
  4. 4. Why do I need HTML Bridge?
  5. 5. Ability to interop between both the Silverlight and JavaScript in the browser. Since Silverlight run within Object tag of an HTML, there should be way of communicating HTML Dom with Silverlight or We would commonly use HTML Bridge to transfer information, such as events, types and data.</li></ul>Note: The Silverlight plug-in does not need to have a visible UI to access the underlying DOM of the page<br />
  6. 6. What are feature that HTML Bridge Provide<br />Attach Silverlight managed event handlers to HTML controls <br />Expose complete managed types to JavaScript for scripting like properties in Code Behind<br /> Use managed containers for DOM elements such as window, document, and standard HTML elements<br />Pass managed types as parameters to JavaScript functions and objects <br /> Return managed types from JavaScript<br />Control various security aspects of your Silverlight-based application <br />Attach JavaScript event handlers to Silverlight controls<br />
  7. 7. Managed Attributes<br />ScriptableTypeAttribute : - Marks a property, method or event accessible to JavaScript. ScriptableMemberAttribute Marks all public properties, methods, and events on a managed type accessible to JavaScript when registered using the RegisterCreateableType method.<br />
  8. 8. using System.Windows.Browser; <br /> [ScriptableTypeAttribute] <br /> public class Person <br /> { <br /> [ScriptableMemberAttribute] <br /> public string Name{ get; set; } <br /> [ScriptableMemberAttribute] <br /> public event EventHandlerregisteredEvent; <br /> [ScriptableMemberAttribute] <br /> public double FullName() <br /> { <br /> ////<br /> } <br /> } <br />
  9. 9. Thank you<br />