INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

RegisterStartUpScript() Not Working After Adding AJAX UpdatePanel (VB.Net)

RegisterStartUpScript() Not Working After Adding AJAX UpdatePanel (VB.Net)

RegisterStartUpScript() Not Working After Adding AJAX UpdatePanel (VB.Net)

(OP)
Hello,

I had a working web site, but wanted to add a ProgressBar to it. After much trial-and-error, I finally decided to try using the Ajax UpdatePanel on it to handle the ProgressBar.

Previously the ScriptManager.RegisterStartupScript() was working just fine.
Once I added the Ajax Updatepanel, it quit working.

I see a variety of other postings on other websites about this problem, but there does not seem to be a definitive solution.
Some people tried one thing and it worked, but did not work for others, etc.
I tried a number of "throw it on the wall to see if it sticks" approaches, but they too did not work.

What used to work and successfully launched 'startup' javascript:
ScriptManager.RegisterStartupScript(Me.Page, Page.GetType, "MyStartUpJavaScript", "startUpScript()", True)

Any suggestions/advice would be greatly appreciated.

Thanks,
JRB-Bldr

RE: RegisterStartUpScript() Not Working After Adding AJAX UpdatePanel (VB.Net)

(OP)
I forgot to add that I want the StartUp javascript to execute when the Whole Page executes.

I don't see that this StartUp javascript should need to execute when the UpdatePanel refreshes (every one second after being 'Triggered') - since that only displays the ProgressBar and not the other form objects which the startup javascript 'manipulates'.

Since I don't know if that may or may not be pertinent to the issue, I thought that I'd throw it in.

Thanks,
JRB-Bldr

RE: RegisterStartUpScript() Not Working After Adding AJAX UpdatePanel (VB.Net)

(OP)
I MAY have found the answer even though I am not sure why.

By changing the syntax to:
ScriptManager.RegisterClientScriptBlock(TryCast(sender, Control), Me.GetType(), Guid.NewGuid().ToString(), "startUpScript()", True)

It is now launching the intended javascript - startUpScript()

I now have another issue related to that, but I will post it in a javascript area of the forum.

Thanks,
JRB-Bldr

RE: RegisterStartUpScript() Not Working After Adding AJAX UpdatePanel (VB.Net)

(OP)
Please forget what I said above about a 'new' problem.

Actually my primary problem stated here, while seeming to be resolved, was really not.

So let me restate my problem in a hopefully more clear manner.

I have an ASP.Net webpage that used to work just fine.
That code had in it a working javascript StartUpScript that I launched with a:

CODE --> VB.Net

ScriptManager.RegisterStartupScript(Me.Page, Page.GetType(), Guid.NewGuid().ToString(), "startUpScript()", True) 

But I wanted to add a ProgressBar to the back-end table updates that are launched with a Button Click (not a SUBMIT button).
After trying a number of things, I finally decided to try AJAX and their approach to a ProgressBar using an UpdatePanel.

I followed a rather clearly presented approach and put that code in place - and from a methodology approach it looks as though it might really work.

But when I first launched the code, I saw that my javascript StartUpScript was not executing - Firebug was not breaking at my intended javascript Function

It appeared that AJAX was creating its own javascript and that it was running instead of mine.

Point of reference, when I first launch the page the AJAX javascript seems to run and I never see my javascript code run.
However if I do a manual Page Refresh through the browser control, my javascript StartUpScript seems to be launched, but it cannot 'see' any of the form objects that I need.

From web readings that I have done ALL DAY, I am guessing that one of the javascript code launches is for the AJAX UpdatePanel load and the other javascript code launch is for the over-all form. But I cannot tell which is which and what code it SHOULD be running at launch.

What more information can I offer to help you assist me in finding the answer?

As before, any advice/suggestions you might have would be greatly appreciated.

Thanks,
JRB-Bldr



Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close