Hi Bruce...
I found that the best way to ensure your suggested method to work was to
reference the UpdatePanel control itself and call the method statically as
in:
System.Web.UI.ScriptManager.RegisterStartupScript(Me.UpdatePanel1,
Me.UpdatePanel1.GetType(), "jsShowModal", "PageSetup(); ", True)
This worked fine but resulted in my dialog box popping up before the
contents of the UpdatePanel were completely refreshed.
In a forum discussion from 2006 when VS 2008 was in Beta I found this
alternate method to be used in the ASPX page:
----------------------------
<script type="text/javascript">
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
function EndRequestHandler(sender, args)
{
showDialog("From PageRequestManager");
}
---------------------------
http://forums.asp.net/p/1037531/1440930.aspx
This approach allows the dialog to appear after the update panel contents
are completely refreshed. I cant really see a downside to this appoach
because the code always resides on the rendered page. Maybe there is a
problem that I might run into at some point and I will go back to the
System.Web.UI.ScriptManager.RegisterStartupScript. I was wondering if the
StartupScript that is produced actually persists after the first call to
RegisterStartupScript, or if that script is only generated on the page
whenever the method is called from the code-behind. I suppose that is easy
enough to test.
I was also wondering if I called ScriptManager.RegisterStartupScript in the
PreRender event or even later, if the contents of the Update Panel would be
rendered before the dialog appears.
Thanks for your help Bruce.
"bruce barker" <(E-Mail Removed)> wrote in message
news

68B8A95-CEE0-4B0D-8DC5-(E-Mail Removed)...
> use ScriptManger.RegisterStartupScript(). it must be attached to a control
> in
> update panel. also unless the hidden field is in the update panel, it will
> not be updated with a async postback
>
> -- bruce (sqlwork.com)
>
>
> "John Kotuby" wrote:
>
>> Hi all,
>>
>> I am converting an ASPX 3.5 page in VB and VS 2008 from the standard
>> postback to callbacks using an UpdatePanel.
>> I had originally been adding an onload attribute to the Body tag in the
>> Master Page, which would call a Javascript function to display a message
>> if
>> a hidden field contained a value other than a null string.
>>
>> Well, of course I discovered that the Body onload event only happenned
>> upon
>> initial load of the page.
>>
>> I tried adding a client event attribute to the UpdatePanel but I am not
>> having any success.
>>
>> Thanks for any help in this matter.
>>
>>
>>
>>