Wednesday, March 28, 2012

ajax beta 2, resizable textbox?

Hey,

Trying to adapt my app to beta 2..

And my resizable textboxes don't work anymore :/

Here is an extract of the code: (worked for atlas)

------------------------------------------------

<asp:PanelID="resizeActionPanel"runat="Server"Height="100%"Width="100%"BorderStyle="Outset"BorderWidth="1px">

<asp:TextBoxTextMode="multiline"ID="itm_action"CssClass="normal"Width="100%"Height="100%"Text=<%#Container.DataItem("item_action") %>runat="server"ReadOnly="<%#CheckEditRights() %>"></asp:TextBox></asp:Panel><ajaxToolkit:ResizableControlExtenderID="ResizableControlExtender5"runat="server"TargetControlID="resizeActionPanel"resizablecssclass="resizingText"HandleCssClass="handle2"HandleOffsetX="0"HandleOffsetY="10"MinimumHeight="57"MinimumWidth="299"MaximumWidth="299"MaximumHeight="300"onclientresizing="ResizeTextBox"/><scripttype="text/javascript">function ResizeTextBox(sender, eventargs)

{

var element = sender.control.element;

element.children[2].style.height = element.style.height;

returnfalse;

}

</script>

------------------------------------------------

> Does anyone know if getting a resizable textbox is still possible?

By adapting the code above? Or another way...?

Regards,

NNM

A quick search of the forum suggests this post is a favorite answer for this question:http://forums.asp.net/thread/1404868.aspx

Yeah, and I started that thread too, but that does not work with ajax 2 anymore.


What are the errors you are seeing? Could you post the new aspx file?

The code is in the first post!

Worked with atlas, doesn't work with ajax beta 2...


I'm having the same problem. I was trying to use your solution from the first post with beta 2 and I can't get it to work. Any ideas? Anyone??

The sample code in the first post here has script errors under the latest ASP.NET AJAX. I made the following changes to remove them:

var element = sender.get_element();
element.childNodes[3].style.height = element.style.height;


Thanks but i'm still getting the following error:

'DataItem' is not a member is not a member of 'System.Web.UI.Control'


My post should have addressed the original sample - maybe you want to post one, too?

found out that the multiline textbox in update panel does not render properly in firefox.

Anyone has a workaround?


i got it working..

heres the simple workaround.

<script type="text/javascript">
function ResizeTextBox(sender, eventargs)

{
var browserName=navigator.appName;
if (browserName=="Microsoft Internet Explorer")
{

var element = sender.get_element();
element.childNodes[2].style.height = element.style.height;

// element.children[2].style.width = element.style.width;

return false;

}
}

</script>

dont forget to keep the text height and width to 100%...

this will work in both firefox and IE

Cheers...

No comments:

Post a Comment