When using ajax aspx pages use RegisterStartupScript. Using techniques such as response.write to add scripts on an event postback will not render the page correctly.
Using javascript you can determine which browser is calling the site and makes changes to the markup accordingly.