Screen Resolution

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top