Simon Steed's Blog About Stuff!
i.e. anything interesting…
i.e. anything interesting…
Sep 1st
Ever had a long webpage with validation that fails on postback but returns the user to the top of the page instead of where you want them?
Annoying isnt it. Well in .Net Framework 2.0 (yes it’s been there a while now), you can use the property:
Page.MaintainScrollPositionOnPostBack = true;
Well this will force the user to be returned back to the last point they clicked i.e. could be a control, button, checkbox etc
Very useful and helps with improving the user experience, something we should all be striving for!
Aug 2nd
I needed to detect if Safari was being used as there were some issues with styling on a website I was working upon, only on Mac Safari though!!!
The following code is what I use to detect safari and load the relevant script:
<script type="text/javascript">
if(/Safari/.test(navigator.userAgent))
{
//you are using safari, or at least you CLAIM to be
document.write('<link type="text/css" media="screen" rel="stylesheet" href="/css/safari.css" title="example" />');
}
</script>
Add in the
tags and set the path to the correct css file you wish to load. Same concept can be used to load javascript files.Jan 20th
Jan 19th
Jan 18th
Jan 17th
Jan 15th
Jan 11th