Welcome aboard! We are happy you are here and wish you good net-raft!
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>TITLE</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
var widthscreen = screen.width;
var heightscreen = screen.height;
$.ajax({
type: "POST",
contentType: "application/json;charset=utf-8",
url: "Default.aspx/DisplayData",
data: '{param1: "' + widthscreen + '", param2: "' + heightscreen + '"}',
dataType: "json",
success: function (data) {
$("#lbltxt").text(data.d);
},
error: function (result) {
alert("Error");
}
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<label id="lbltxt" runat="server"></label>
</div>
</form>
</body>
</html>
The most helpful C# solutions
detect ie C#C# Click to see more ... 4.7K 853