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

  • Home
  • SEARCH
  • 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 6630115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:21:24+00:00 2026-05-25T22:21:24+00:00

I have to use Form.Action to redirect to a script that will be picking

  • 0

I have to use Form.Action to redirect to a script that will be picking up values from my page. It is worth noting that this script is external.

My issue is that I also want the button that is clicked and has the Action hooked up to it, to also complete some functionality in the code behind first.

Is there anyway I can either :

In the buttons click event handler, can I set the Form.Action and then call something such as Form.Submit?

OR

Set up the Form.Action in advance and then somehow have the button posting back before the action takes place.

If this is not possible, any pointers in the correct direction with how I can achieve this would be appreciated.

  • 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-25T22:21:25+00:00Added an answer on May 25, 2026 at 10:21 pm

    If the page does not need to do validation/processing on server side when user clicks the button then you can do it like,

    In ASPX:

    <asp:Button ID="btnSubmit" runat="server"
       OnClientClick="$('form').get(0).setAttribute('action', 'ScriptActionUrl'); $('form').submit();"
       Text="Submit">
    </asp:Button>
    

    If there is something to be processed/validated on server-side then do it like,

    In ASPX:

    <asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_Click" Text="Submit">
    </asp:Button>
    

    In Page-behind-code:

    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        Page.Validate(); //Do Validation or some other processing
        if(Page.IsValid)
        {
             Page.ClientScript.RegisterStartupScript(this.GetType(), Guid.NewGuid().ToString(), "$('form').get(0).setAttribute('action', 'ScriptActionUrl'); $('form').submit();", true);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an C# form application that use an access database. This application works
I have a small jQuery plugin that I use for form AJAX validation. There
I have attempted to use this CSS to set the width of my form
I have seen people say that it is bad form to use catch with
So I have an unbound form that I use to save data to a
I have a html form that I process with a aspx page. I want
Say I have an HTML form like this to collect an email from a
Problem: I have a page that has a large form, and in the middle
I have configured my application to use form based authentication and set up the
I have a search form on each of my pages. If I use form

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.