my code source ..
function test() {
var wre = Sys.Application.findComponent("WebResizingExtender1");alert (wre); // ?
wre.setSize(400, 200);
}
WebResizingExtender control name : WebResizingExtender1
updatepanel control name : up_test
WebResizingExtender1 ..setting ..
TargetControlID : up_test
promgram run ... message box 'null'
why? help me plz. :)
Hi,
To get reference to AJAX javascript object you may use public method $find(id). Below is an example.
<ig:WebResizingExtender ID="WebResizingExtender1" runat="server" TargetControlID="Panel1" /><asp:Panel ID="Panel1" runat="server" BackColor="#FF9933" Height="69px" Width="328px"> </asp:Panel> <script type="text/javascript"> function checkResizer() { var resizer = $find('<%=WebResizingExtender1.ClientID%>'); alert('resizer id:' + resizer.get_id() + ', maxWidth:' + resizer.get_maximumWidth()); var target = resizer.getTargetElement(); target.style.border = '1px solid red'; } </script> <input type="button" value="check resizer" onclick="checkResizer()" />
Instead of alert you may put debugger; and check all available public methods of resizer object.
I want to learn how to use this,
can you help me?