F
fabrice
Hi,
I'm trying to get the screen resolution of the client and to realize a
treatment in code behind.
it seem to be hard.
I can get information about the resolution with this following sub, call in
Page_Load.I fix the text of The Control Label. But no treatment is possible.
If i try to keep out the text of this label in code behind, i have nothing.
The variable is empty.
Private Sub SetScreen(ByVal ctrl As Control)
Dim sb As New System.Text.StringBuilder
sb.Append("<script language='javascript'>")
sb.Append("document.getElementById('")
sb.Append(ctrl.ClientID)
sb.Append("').innerText='Résolution : ' + screen.height + 'X' +
screen.width;")
sb.Append("</script>")
RegisterStartupScript("SetScreen", sb.ToString)
End Sub 'SetScreen
Is it possible to take the screen resolution in code behind or disable a
control web with javascript.
My goal is to refuse authentication if the resolution is not supported.
Thanks for you help.
fabrice
I'm trying to get the screen resolution of the client and to realize a
treatment in code behind.
it seem to be hard.
I can get information about the resolution with this following sub, call in
Page_Load.I fix the text of The Control Label. But no treatment is possible.
If i try to keep out the text of this label in code behind, i have nothing.
The variable is empty.
Private Sub SetScreen(ByVal ctrl As Control)
Dim sb As New System.Text.StringBuilder
sb.Append("<script language='javascript'>")
sb.Append("document.getElementById('")
sb.Append(ctrl.ClientID)
sb.Append("').innerText='Résolution : ' + screen.height + 'X' +
screen.width;")
sb.Append("</script>")
RegisterStartupScript("SetScreen", sb.ToString)
End Sub 'SetScreen
Is it possible to take the screen resolution in code behind or disable a
control web with javascript.
My goal is to refuse authentication if the resolution is not supported.
Thanks for you help.
fabrice