Screen Resolution

  • Thread starter Thread starter fabrice
  • Start date Start date
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
 
Screen resolution would be irrelevant though, unless they always ran in full
screen for their browser?

Otherwise, grab the info, set it in a hidden variable, do an autopostback,
validate, redirect to the site or to a "sorry..." page.
 

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

Back
Top