Changing myView height width

Can the height and width of a goView be set from the web page:
MyView.Height = heightTexBox.text;
?? that code doesn’t. Not sure is this is setable at runtime and if so, what would the casting look like?
Thanks, Mark

It isn’t sufficient to set the width or height of the element on the client, because the web server is generating an image of a particular size, so if you change the size of the IMG, you will just cause it to be stretched or compressed.
So on the client you can call the JavaScript function goSize to set the Width and/or Height of the GoView on the server. Or call goResize if you want to adjust the width and/or height.

Ok, let make sure we are talking about the same thing, because I’ve just spent hours trying not to look like I know nothing about html and c# programming.
I want my users to be able to put in width and height parameters on text boxes on the web page, press a “reset” button and have the dimensions of the view change size (to better fit what size monitor they are using).
I have added this java script to my html code in the head section:
<script type=“text/javascript”>
function callSize(w, h, docID) {
goSize(w, h, docID);
}
</script>
To my c# page_load area I have added:
resizeButton.Attributes.Add(“onclientclick”, “callResize(” + widthTextBox.Text + ", " + heightTextBox.Text + “, ‘MyView’);”);
I get no errors, but the size does not change.
I’m obviously missing something, and as always, appreciate the help
Mark

You don’t need to do anything on the server.
Here’s some HTML (note no “asp:”):


Resize MyView
And here’s the definition of the JavaScript function “resizeView”:
function resizeView(w, h, id) {
var img = goFindImg(id);
if (img) {
img.width = w;
img.height = h;
goSize(w, h, id);
}
}
This works particularly well when GoView.NoPost is true.
You might want to provide initial values for the two text input boxes.

Works great. Thank you.