I found a javascript code that get and set the dimension of image .
By reference this link , I write the code in my asp.net web site likes this ,
<img runat="server" id="MyImage" onload="if( this.width >
this.height ){ this.width = 400; this.height = 600} else {this.width = 600;
this.height=400}" />
What I want to know is how to write this javascript code in this <script> tag
<script type="text/javascript">
function setDimension() {
}
</script>
javascriptcode is wrong , Kindly show me the correct code :), Thanks !