Screenresolution written in database using only 1 page.

I

IkBenHet

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!
 
P

Peter D. Dunlap

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.
 

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,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top