Doorgaan naar hoofdcontent

Adding Polymer element to ASPX


Below you can see a simple example of how to integrate a Polymer element (core-toolbar here) into an ASP.NET Webforms page. Note that the import lines are included in the element.
Source Code:
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs"  
Inherits="TestPolWebApp._Default" %>
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
    
    <link rel="import" href="Scripts/Polymer/polymer/polymer.html">
    <link rel="import" href="Scripts/Polymer/core-toolbar/core-toolbar.html">
 
    <script src="Scripts/Polymer/webcomponentsjs/webcomponents-lite.js"></script>
 
    <div class="jumbotron">
        <h1>ASP.NET</h1>
        <p class="lead">ASP.NET is a free web framework for building great Web sites and Web applications using HTML, CSS, and JavaScript.</p>
        <p><a href="http://www.asp.net" class="btn btn-primary btn-lg">Learn more »</a></p>
    </div>
 
        <p> Polymer test: </p>
       <core-toolbar style="border-radius:4pxdisplay:inline-block";> 
           <span class="glyphicon glyphicon-bookmark"></span>
           <span>Example of use of Polymer element in simple aspx page</span>
    </core-toolbar>
 
    <div class="row">
        <div class="col-md-4">
            <h2>Getting started</h2>
            
            <p>
                ASP.NET Web Forms lets you build dynamic websites using a familiar drag-and-drop, event-driven model.
            A design surface and hundreds of controls and components let you rapidly build sophisticated, powerful UI-driven sites with data access.
            </p>
            <p>
                <a class="btn btn-default" href="https://go.microsoft.com/fwlink/?LinkId=301948">Learn more »</a>
            </p>
        </div>
    </div>
 </asp:Content>
Result:

Reacties

  1. How to add source code to a blog post in blogger? Just check: http://www.coding-issues.com/2013/10/copy-code-from-visual-studio-to-blogger.html
    There's also a version for VS2017 available.

    BeantwoordenVerwijderen

Een reactie posten

Populaire posts van deze blog

How to keep track of your continuous learning? I try it with a scrum board:  https://trello.com/b/OIuiA3Ql/study

Settings for CodedUI in Visual Studio 2017

When working with CodedUI and SpecFlow, it can be important to have it run as a 32-bits process. I spend quite some time finding the correct setting in Visual Studio for a project that was not running the tests. It appeared I needed to change the following test setting: from the Menu in Visual Studio, choose Test\Test settings\Default Processor Architecture: X86 (so not: X64!). The same can be said for all other test types run from the Test Explorer, like unit tests.
Synchronize databases When you want to synchronize master data between SQL databases in different environments, you can easily generate a script for this with SSMS 2017. Just select the database, right mouse click and choose: Tasks => Generate script => Set scripting options => Advanced Scripting options: and change a setting from Types of data to "Schema AND data". A T-SQL script will be generated with both the table structure and the INSERT INTO statements.