This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form> | |
<fieldset name="userinfo"> | |
<legend>User information</legend> | |
<label for="name">Name</label> | |
<input type="text" name="name" id="name" size="40" required> | |
<br /> | |
<label for="address">Address</label> | |
<input type="text" name="address" id="address" size="40"> | |
<br /> | |
<label for="phone">Phone</label> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="Scripts/modernizr-2.5.3.min.js" type="text/javascript"></script> | |
<script> | |
Modernizr.load({ | |
test: Modernizr.input.placeholder, | |
nope: function () { | |
Modernizr.load('Scripts/yourplaceholderpolyfill.js'); | |
} | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- add your version of jQuery first --> | |
<script src="Scripts/jquery-1.7.1.min.js"></script> | |
<script src="Scripts/js-webshim/minified/polyfiller.js"></script> | |
<script>$.webshims.polyfill('forms forms-ext');</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- jQuery (HTML5Forms requires jQuery 1.4 and higher) --> | |
<script src="Scripts/jquery-1.7.1.min.js"></script> | |
<!-- jQuery.html5form plugin --> | |
<script src="Scripts/jquery.html5form-1.5-min.js"></script> | |
<script> | |
$(document).ready(function () { | |
$('#myform').html5form(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var wsUri = 'ws://' + window.location.hostname + | |
window.location.pathname.replace('index.htm', 'ws.ashx'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Web; | |
using Microsoft.Web.WebSockets; | |
namespace MyWebSocket | |
{ | |
public class ws : IHttpHandler | |
{ | |
public bool IsReusable | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(context.IsWebSocketRequest){ | |
// Do something | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Microsoft.Web.WebSockets; | |
namespace MyWebSocket | |
{ | |
public class MyWebSocketHandler : WebSocketHandler | |
{ | |
private int clientsConnectCount; | |
public override void OnOpen() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public virtual void OnClose(); | |
public virtual void OnError(); | |
public virtual void OnMessage(byte[] message); | |
public virtual void OnMessage(string message); | |
public virtual void OnOpen(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestWebSocketHandler : WebSocketHandler | |
{ | |
private static WebSocketCollection clients = new WebSocketCollection(); | |
private string name; | |
public override void OnOpen() | |
{ | |
this.name = this.WebSocketContext.QueryString["name"]; | |
clients.Add(this); | |
clients.Broadcast(name + " has connected."); |