On 22 Jul 2005 04:20:35 -0700, "IkBenHet" <ikbenhet79@hotmail.com>
wrote:
[color=blue]
>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...esolution.aspx
>
>Thank you for you support on this![/color]
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.