Showing posts with label textboxes. Show all posts
Showing posts with label textboxes. 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 asynchronous postback

Hi all,

I have created a web page with ajax support. In that i have two buttons and three textbox.

All the three textboxes having required field validator attached to them. Now while i am trying to do asynchronous postback it is not possible for me because the required field validator prompts me to enter values. Is there any way to get rid of this...

I would like to do asynchronous postback even though ther are validators on the page

Do u set the same value to propertie ValidationGroup for validators and the button that cause the validation?


 This will not cause validation :
 <asp:button ID="someButton"CausesValidation="false" runat="server" />

Hi SathishRaja,

My understanding of your issue is that you want to get rid of the validation when click the button which will normally fire the validators. If I have misunderstood, please feel free to let me know.

As far as I know, there are three methods to achieve this list below:

Solution 1


Thanks Solution 2 is Working fine for me.