You got that error because you are trying to use a windows form in side your asp.net means web form application..
and for your solution try to get your screen resolution using javascript
like this...
<script type="text/javascript">
function detecteScreenResolutions() {
var width = screen.width;
var height = screen.height;
alert("YOUR SCREEN RESOLUTION IS "+width +" x "+height);
}
</script>
and as per this functin result set your css classes of your div..