Showing posts with label anymore. Show all posts
Showing posts with label anymore. Show all posts

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...

Monday, March 26, 2012

ajax asp tags not available in head anymore?

Prior to this release I had a (?potentially bad?) habit of putting my script manager tag inside the <head> tag. Now it looks like that can't be done, or at least the intellisense won't work there. Any comments on

1) this was a stupid idea to begin with ?

2) its a bug or a feature - but get used to it?

Thanks.

hello.

1. if i'm not mistaken, now theymust be inside a form (which is good since after all we're talking about a server control)

2. well, not getting intellisense is surelly a bug :)


In the early CTPs they worked inside the head, which in 2.0 is a programmable container.

The loss of this ability to me to be a 'breaking change' from CTP to Beta. Its 'adjustable' but cuts down some scenarios for wiring in clientside scripts using web service proxies declared in the header, but meant to be used via dhtml outside of serverside form tags. Working through my scenarios now.


hello.

well, in my opinion, the previous behavior was a bug, since all server controls must be declared inside a server form.


Not all controls are required to be within the form;

The SM is required to be within the form in the beta, but this may be relaxed. The partial page postback model (UpdatePanel) requires it to be in the form, but when EnablePartialRendering is not on and/or Updatepanels are not around, then it might be 'allowed' outside. Still being debated however.


hello again.

well, from looking at the control hierarchy, i think that my previous statement was wrong since it only inherits from control. so, maybe it could be put outside the form tag (if it doesn't break the page postback model)