Showing posts with label specific. Show all posts
Showing posts with label specific. Show all posts

Wednesday, March 28, 2012

How do I use javascript to force an UpDatePanel to Update

Hi, I am trying to find a simple way to force a specific update panel to refresh/update from a javascript function. The reason being that I am trying to build a simple calendar control, simular to that on the AJAX Control Toolbox site under PopUpControlhttp://atlas.asp.net/atlastoolkit/PopupControl/PopupControl.aspx, and I want the calendar to update if a date has been manually entered into the text box. I have found that you have to add an atrribute to the date input text box to invoke a call to a javascript function. (I am using the calendar control that I make inside of a gridview control which is enbeded inside of multiple levels of Update Panels and the TextBox.OnChange() event does not fire when inside of a gridview. So I added the following to the Page_Load event:TextBox.Attributes.Add("OnMouseLeave","javascriptFunction()") ) The problem that I am having is what to add to thejavascriptFunction()to force a specific UpDatePanel to refresh. I can get all of the panels to update using a "__doPostBack('DateControl$DateDisplay',''); "but there seems like that should be a simple way to force only one panel to update. I've tried to click on a hidden button using a javascript click() event, but I continuosly get the follwing javascript error: " Microsoft JScript runtime error: '_postbackSettings.async' is null or not an object " Is there a way to implement theUpdatePanel.Update() function directly from Javascript? Am I even going in the right direction? Could I call one of my code behind functions from javascript to perform the UpdatePanel.Update()?

So in simple terms, when building a control how can i update a specific UpdatePanel in the control through a javascript function?

Help Please!! Thanks!Big Smile

There is no direct support for updating just a single panel. You can mostly achieve it by setting all your panels to be Conditional and then calling Update on just the ones you want.

Thanks,

Eilon

Wednesday, March 21, 2012

How can I tell Scriptmanager to look for a specific form id value?

I'm getting a javascript error. I think it's because the Scriptmanager is looking for 'form1' which isn't the value of the form id on the page. The form id value is 'form1_1458'

I did a view source on the browser and I see this line:

Sys.WebForms.PageRequestManager._initialize('ScriptManager1', document.getElementById('form1'));
 

I need the ScriptManager to look for 'form1_1458' How can I force the scriptmanager to do to this?

It queries the ClientID on Page's Form property internally. What does Form.ClientID on your page return, if you try to output that?


i should have mentioned that this .aspx page is hosted within a portal environment (BEA aqualogic). The portal seems to append the _1458 to form1 which in the end makes it form1_1458.

let me see what Form.ClientID outputs.