S
srini
Frens,
I am trying to get screen resolution of the client machine using
javascript and use those values in my project. I looked at some of the
examples given in this group, i tried to implement the same but
everytime i get nulls, i tested javascript by keeping alert statements
and everything looks good to me....
I am trying to figure it out what peice of info is missing in this
code.....
Here is my code
In PageLoad....
===========
If (Not IsPostBack) Then
RegisterStartupScript("MyScript", _
"<script language=javascript>" & _
"document.forms['Form1'].submit();</script>")
Else
Dim resW As String = Request.Form("resW")
Dim resH As String = Request.Form("resH")
End If
In ASPX page
==========
<HTML>
<HEAD>
<script language="javascript">
document.getElementsByName('resW').value = screen.width;
document.getElementsByName('resH').value = screen.height;
</script>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<INPUT id="resW" type="hidden" name="resW" runat="server">
<INPUT id="resH" type="hidden" name="resH" runat="server">
</form>
</body>
</HTML>
I looked at some examples posted in this site...saying that they are
able to get those values
<http://groups.google.com/group/micr...ues+in+ASP.NET&rnum=11&hl=en#19a7705d4458e6e6>
Thanks in advance...
Thanks
Srini
I am trying to get screen resolution of the client machine using
javascript and use those values in my project. I looked at some of the
examples given in this group, i tried to implement the same but
everytime i get nulls, i tested javascript by keeping alert statements
and everything looks good to me....
I am trying to figure it out what peice of info is missing in this
code.....
Here is my code
In PageLoad....
===========
If (Not IsPostBack) Then
RegisterStartupScript("MyScript", _
"<script language=javascript>" & _
"document.forms['Form1'].submit();</script>")
Else
Dim resW As String = Request.Form("resW")
Dim resH As String = Request.Form("resH")
End If
In ASPX page
==========
<HTML>
<HEAD>
<script language="javascript">
document.getElementsByName('resW').value = screen.width;
document.getElementsByName('resH').value = screen.height;
</script>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<INPUT id="resW" type="hidden" name="resW" runat="server">
<INPUT id="resH" type="hidden" name="resH" runat="server">
</form>
</body>
</HTML>
I looked at some examples posted in this site...saying that they are
able to get those values
<http://groups.google.com/group/micr...ues+in+ASP.NET&rnum=11&hl=en#19a7705d4458e6e6>
Thanks in advance...
Thanks
Srini