Screenresolution written in database using only 1 page.

Discussion in 'ASP .Net' started by IkBenHet, Jul 22, 2005.

  1. IkBenHet

    IkBenHet Guest

    Aldo it is something very simpel, it is not easy to find good
    information on this subject.

    For the moment we have only 1 ASP.NET page and we want that if vistors
    access it, this visit is logged into a database. Because we are
    developing the future site right now, we also want to know what
    browser, screensize and resolutions the visitors of our site are using.

    I already know that because Javascript is clientside and ASP.NET
    serverside, that you can not pass it easly from Javascript to ASP.NET.
    Possible solutions are redirecting from javascript to a new page and
    pass the values in a query string or write a cookie. I think these are
    both not that good solutions.
    I was also told that it is possible with a onload function and some
    hidden fields. This would be great because then you can stay on the
    same page. Maybe you guys can help me on this.

    I found this on the web:
    http://www.devcity.net/Articles/64/1/screenresolution.aspx

    Thank you for you support on this!
     
    IkBenHet, Jul 22, 2005
    #1
    1. Advertising

  2. On 22 Jul 2005 04:20:35 -0700, "IkBenHet" <>
    wrote:

    >Aldo it is something very simpel, it is not easy to find good
    >information on this subject.
    >
    >For the moment we have only 1 ASP.NET page and we want that if vistors
    >access it, this visit is logged into a database. Because we are
    >developing the future site right now, we also want to know what
    >browser, screensize and resolutions the visitors of our site are using.
    >
    >I already know that because Javascript is clientside and ASP.NET
    >serverside, that you can not pass it easly from Javascript to ASP.NET.
    >Possible solutions are redirecting from javascript to a new page and
    >pass the values in a query string or write a cookie. I think these are
    >both not that good solutions.
    >I was also told that it is possible with a onload function and some
    >hidden fields. This would be great because then you can stay on the
    >same page. Maybe you guys can help me on this.
    >
    >I found this on the web:
    >http://www.devcity.net/Articles/64/1/screenresolution.aspx
    >
    >Thank you for you support on this!


    You could do it without disrupting the client by using an iframe, but
    not all browsers support this. In fact if JavaScript is turned off in
    the browser you would have a hard time doing it at all. To use the
    iframe you'd need to load another page into it with JavaScript that
    would fill in some (hidden) form fields and submit the form.

    You could also do that on the main page - generate the script in the
    page load event if it isn't a postback, have it fill in the form and
    submit it automatically. The problem with this approach is that it
    messes with the funcationality of the Back button and can make the
    user believe they are "trapped" on your site.
     
    Peter D. Dunlap, Jul 22, 2005
    #2
    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. Steve C. Orr, MCSD
    Replies:
    1
    Views:
    595
    reaway lee
    Aug 24, 2003
  2. me
    Replies:
    1
    Views:
    647
    Kevin Goodsell
    Sep 25, 2003
  3. KaiWen
    Replies:
    102
    Views:
    2,880
    Jorgen Grahn
    Sep 15, 2011
  4. Martin Gustavsson

    Page in frame depending on screenresolution?

    Martin Gustavsson, Oct 1, 2003, in forum: Javascript
    Replies:
    2
    Views:
    86
  5. IkBenHet
    Replies:
    1
    Views:
    94
    Grant Wagner
    Jul 22, 2005
Loading...

Share This Page