Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 772651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:50:12+00:00 2026-05-14T18:50:12+00:00

This is driving me crazy! I have read at least 5 questions on here

  • 0

This is driving me crazy! I have read at least 5 questions on here closely related to my problem, and probably 5 or so more pages just from googling. I just don’t get it.

I am trying to have a jqueryui dialog come up after a user fills out a form saying ‘registration submitted’ and then redirecting to another page, but I cannot for the life of me get any javascript to work, not even a single alert.

Here is my update panel:

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="upForm" runat="server" 
    UpdateMode="Conditional" ChildrenAsTriggers="False">
    <ContentTemplate>
               'Rest of form'
         <asp:Button ID="btnSubmit" runat="server" Text="Submit" /> 
              <p>Did register Pass? <%= registrationComplete %></p>
    </ContentTemplate>
</asp:UpdatePanel>

The Jquery I want to execute: (Right now this is sitting in the head of the markup, with autoOpen set to false)

<script type="text/javascript"> 
function pageLoad() {

    $('#registerComplete').dialog({
        autoOpen: true,
        width: 270,
        resizable: false,
        modal: true,
        draggable: false,
        buttons: {
          "Ok": function() {
          window.location.href = "someUrl";
        }
        }
    });

}
     </script>

Finally my code behind: ( Commented out all the things I’ve tried)

Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSubmit.Click     
      'Dim sbScript As New StringBuilder()'
           registrationComplete = True
            registrationUpdatePanel.Update()

            'sbScript.Append("<script language='JavaScript' type='text/javascript'>" + ControlChars.Lf)'
            'sbScript.Append("<!--" + ControlChars.Lf)'
            'sbScript.Append("window.location.reload()" + ControlChars.Lf)'
            'sbScript.Append("// -->" + ControlChars.Lf)'
            'sbScript.Append("</")'
            'sbScript.Append("script>" + ControlChars.Lf)'

            'ScriptManager.RegisterClientScriptBlock(Me.Page, Me.GetType(), "AutoPostBack", sbScript.ToString(), False)'
            'ClientScript.RegisterStartupScript("AutoPostBackScript", sbScript.ToString())'
                            'Response.Write("<script type='text/javascript'>alert('Test')</script>")'
            'Response.Write("<script>windows.location.reload()</script>")'
End Sub

I’ve tried:

  • Passing variables from server to
    client via inline <%= %> in the
    javascript block of the head tag.

  • Putting that same code in a script
    tag inside the updatePanel.

  • Tried to use
    RegisterClientScriptBlock and
    RegisterStartUpScript

  • Just doing a Response.Write with the
    script tag written in it.

  • Tried various combinations of putting
    the entire jquery.dialog code in the
    registerstartup script, or just
    trying to change the autoOpen
    property, or just calling “open” on
    it.

I can’t even get a simple alert to work with any of these, so I am doing something wrong but I just don’t know what it is.

Here is what I know:

  • The Jquery is binding properly even
    on async postbacks, because the div
    container that is the dialog box is
    always invisible, I saw a similiar
    post on here stating that was causing
    an issue, this isn’t the case here.

  • Using page_load instead of
    document.ready since that is supposed
    to run on both async and normal
    postbacks, so that isn’t the issue.

  • The update panel is updating
    correctly because <p>Did register
    Pass? <%= registrationComplete
    %></p>
    updates to true after I
    submit the form.

So how can I make this work? All I want is -> click submit button inside an update panel -> run server side code to validate form and insert into db -> if everything succeeded, have that jquery (modal) dialog pop up saying hey it worked.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T18:50:13+00:00Added an answer on May 14, 2026 at 6:50 pm

    To register from the Codebehind, here’s the format:

    ClientScript.RegisterStartupScript(GetType(), "AutoPostBackScript", 
                                       "alert('hi');", True);
    

    The true on the end tells it to wrap your code in <script> tags, leave it off if you want to do the tags yourself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is driving me crazy, I just can't find out the problem: I have
Any regex gurus around here? its driving me crazy. Say I have this string:
As many questions begin, this is driving me crazy. I have a homegrown StarTeam
OK guys, I have a problem that is literally driving me crazy. Here's what
Ok, so this is driving me crazy. I have read the Associations article and
This is driving me crazy. I have a PHP script that gets some data
This is driving me crazy. I have a very simple user control: public int?
This is driving me crazy and I can't find the answer anywhere. I have
Ok, this is driving me crazy. I have a CA that needs to know
This has been driving me crazy for the past few minutes I have a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.