Click event in Visual Studio C#

I've been researching and can't find what I'm looking for. I have a page with a drop down list. I want to select the OrderID from the dropdown list then populate text boxes on a different page based on the OrderID field from the Order table when clicking the submit button. I know I need a click event but don't know what else. Any ideas?
Robin HarrisNetwork TechnicianAsked:
Who is Participating?
 
it_saigeConnect With a Mentor DeveloperCommented:
And for completeness, here is a version using a DDL.

-saige-
EE-Q28618631.zip
0
 
it_saigeDeveloperCommented:
There are many ways to transfer data between pages (Query String, Session State, HTTP Post Information, etc. etc.).

Microsoft has a TID that discusses this process and some of the options available - https://msdn.microsoft.com/en-us/library/6c3yckfw(v=vs.140).aspx

-saige-
0
 
Robin HarrisNetwork TechnicianAuthor Commented:
Thanks for the link.  To the source page I added this code:
          protected void btnSubmit_Click(object sender, EventArgs e)
          {

              Response.Redirect("wscOrderVerify.aspx?orderID=" + ddlOrderID.Text);

          }

Open in new window


I added the following code to the target page:

public partial class wscOrderVerify : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["OrderID"] != null)
                orderID.Text = Request.QueryString["OrderID"];
        }
    }

Open in new window


Right now I just want to pass the OrderID selected from the drop down (ddlorderID) and fill the orderID text box on the target page. With the code above nothing happens when I click the submit button.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
it_saigeDeveloperCommented:
That's because it is case sensitive.  Either use OrderID or orderID for all references.

-saige-
0
 
Robin HarrisNetwork TechnicianAuthor Commented:
Ahh yes I'm punching myself for missing that. I made the change all references say orderID. The target page still doesn't load when clicking submit. I don't receive any error messages either.
0
 
it_saigeDeveloperCommented:
It works for me.  I have attached a test solution.

-saige-
EE-Q28618631.zip
0
 
Robin HarrisNetwork TechnicianAuthor Commented:
Don't know how but I was missing onclick="btnSubmit_Click". I apologize for the noob questions. I've spent the last 24 hours reading up on ASP.Net and C#. I haven't looked at this stuff in 2 years. Thanks a ton for your help.
0
 
Robin HarrisNetwork TechnicianAuthor Commented:
Excellent job. The expert was very patient with me. Thanks again.
0
 
it_saigeDeveloperCommented:
No worries.  Glad you were able to get it sorted out.

-saige-
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.