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 8117681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:15:12+00:00 2026-06-06T04:15:12+00:00

I have things like: <form id=Form1> … </form> How do I refer to this

  • 0

I have things like:

<form  id="Form1"> ... </form>

How do I refer to this form in my C# codebehind? I tried simply using “Form1” but it gives me an error. And googling hasn’t helped either.

What I’m trying to achieve is to enter the item name or one of those fields dynamically on a google checkout “buy now” button. See: How to subscribe to click event of html form?.

  • 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-06-06T04:15:14+00:00Added an answer on June 6, 2026 at 4:15 am

    You need to run the form server side:

    <form id="Form1" runat="server> ... </form>
    

    However, if you are using ASP.NET Web Forms you can only have 1 form per web form running server side.


    EDIT: After seeing your edit, I would recommend posting the values to a standalone value on your website using Response.Redirect():

    Response.Redirect("GoogleCheckout.aspx?field=" + fieldvalue);
    

    Then on this standalone page have the following:

    <form action="https://sandbox.google.com/checkout/..." id="Form1" method="post" name="..." target="_top">
    <input name="item_name_1" type="hidden" value="<%= Request.Querystring["field"] %>" />
    ...
    <input alt="" src="https://sandbox.google.com/checkout/buttons/buy.gif?merchant_id=..." type="image" />
    </form>
    

    Then use javascript/jquery to automatically post this form onload:

    $("form").submit();
    

    This gets around the issue of only having 1 form per page.

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

Sidebar

Related Questions

I want to have a JSP like this: <form id=form1> Name is: <%=request.getParameter(name) %>
I always forget how to do things like this. I have a database table
I have a few custom form validation rules I wish to apply. Things like
I have a form on the page. It has too many things like checkboxes
The login form works fine, but any other form I submit (things like editing
For instance, let's say I have a User model. Users have things like logins,
I usually have to check things like: if ['Bob','Mary','John'].include? @user.name Is there a way
I have previously only used reflection to do things like dynamically get class and
I have an enumeration for my Things like so: public enum Things { OneThing,
I have php scripts that do things like register, login, upload. I would like

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.