Results 1 to 4 of 4

Thread: Button: Execute code behind code, then call javascript function.

  1. #1

    Thread Starter
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861

    Button: Execute code behind code, then call javascript function.

    I generate a pop up window from a datagrid hyperlink to delete a record.
    The user clicks Yes (to delete it) or No.
    When the user clicks Yes, I need to run the code in the buttons click event, then call a javascript function that submits the "parent form" (the page with the datagrid on it). then closes the pop up window.

    I tried doing it with the Attributes.Add but that doesn't work because it doesn't execute the code behind code first.

    I know I can do it using "Page.RegisterStartupScript", but because of my departments standards, I am not allowed to do it that way.

    So does anyone know how I can execute the code in the buttons click event first, then call the client-side javascript function that closes the window and refreshes the datagrid?
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  2. #2
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    Re: Button: Execute code behind code, then call javascript function.

    Register a Startup Script in your popup button. have the start up script window.opener.whatever you can even do window.opener.__doPostBack('','') to refresh the page depending on your page.

    and at the end window.close
    Magiaus

    If I helped give me some points.

  3. #3

    Thread Starter
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861

    Re: Button: Execute code behind code, then call javascript function.

    I can't use RegisterStartUp script, it violates my departments standards.
    I don't have a popup button.
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

  4. #4
    Frenzied Member Magiaus's Avatar
    Join Date
    Mar 2002
    Location
    swamp land
    Posts
    1,267

    Re: Button: Execute code behind code, then call javascript function.

    I meant in the "Yes" Button. I don't think there is another way. Why aren't you allowed to use StartUp scripts? I mean why is your department against it? Well you could try Response.Write but it does the same thing more or less.
    Magiaus

    If I helped give me some points.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width