Screen Resolution

Discussion in 'ASP .Net' started by fabrice, Oct 12, 2005.

  1. fabrice

    fabrice Guest

    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
    fabrice, Oct 12, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew FPGA
    Replies:
    0
    Views:
    969
    Andrew FPGA
    Sep 26, 2005
  2. Jenny

    Screen resolution

    Jenny, Aug 26, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    365
    Ken Schaefer
    Aug 26, 2003
  3. Screen resolution

    , Nov 3, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    340
    Teemu Keiski
    Nov 3, 2003
  4. Guadala Harry

    Discover User's Screen Resolution

    Guadala Harry, Jul 1, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    408
    bruce barker
    Jul 1, 2004
  5. Pat
    Replies:
    5
    Views:
    537
Loading...

Share This Page