39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Web;
|
|
|
|
namespace MoonProTablet
|
|
{
|
|
/// <summary>
|
|
/// Descrizione di riepilogo per windowSize
|
|
/// vedere https://techbrij.com/browser-height-width-server-responsive-design-asp-net
|
|
/// </summary>
|
|
public class windowSize : IHttpHandler, System.Web.SessionState.IRequiresSessionState
|
|
{
|
|
/// <summary>
|
|
/// Processa la richeista andando a recuperare width-height del browser
|
|
/// </summary>
|
|
/// <param name="context"></param>
|
|
public void ProcessRequest(HttpContext context)
|
|
{
|
|
context.Response.ContentType = "application/json";
|
|
|
|
var json = new System.Web.Script.Serialization.JavaScriptSerializer();
|
|
var output = json.Serialize(new { isFirst = context.Session["BrowserWidth"] == null });
|
|
context.Response.Write(output);
|
|
|
|
context.Session["BrowserWidth"] = context.Request.QueryString["Width"];
|
|
context.Session["BrowserHeight"] = context.Request.QueryString["Height"];
|
|
// modificare: salvare in REDIS come conteggio... poi emttere in ABOUT PAGE il resoconto dei conteggi...
|
|
}
|
|
|
|
public bool IsReusable
|
|
{
|
|
get
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
} |