Latest Tweets

Find Posts by Tag
Twitter
« Posting what you can do and what will kill you | Main | Captaris Workflow - Getting the Overdue Event to Fire »
Tuesday
Jan302007

Resize a webform automatically

When designing a workflow in Captaris Workflow, one of your options is to use WebForms for all the UI. When doing this, we will usually open the form to some less than useful size and the enduser will usually resize the form to be able to use it. Resizing the form automatically is easy enough to do, but I always forget what the JavaScript should look like to do that. So here it is...just stick this in the PageLoad method and set the size to the right size for that form. Easy... Hopefully next time I need it, I won't have to search for 10 minutes for this no-brainer...

Page.RegisterClientScriptBlock("tpCustomScript",
    "<script language=JavaScript>function resize()
    {window.resizeTo(300,300);};window.onresize=resize;
    resize();</script>");

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Hyperlinks will be created for URLs automatically.