click on "Save" button not picking up changes on form

I am guessing this is something simple.  I've not done any ASP.NET programming in about 9 months, so I am a little rusty.

Basically, I have a bunch of fields and drop down lists on a form that I am filling.  Then I can make changes to some of the values.  Then I want to save those changes.

The problem is when I go to save the changes, the changes are not getting picked-up.  According to the values of each control, they are the same as they were when the form first loaded the values.  It's as if I have made no changes, but I know I have.

Here is my code and markup:

code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.IO;
using System.Data.Linq;
using System.Data;

using Models;
using Framework.Business;
using Framework.Utilities;
using System.Xml.Linq;
using Framework.UIControls.Base;
using System.Configuration;
using System.Text;
using System.Data.OleDb;
using System.Data.Common;
using System.Threading;

namespace Reo.ContentControls
{
    //page created by Tom Knowlton - cr 1123

    public partial class AgentFormEdit : Reo.Base.BaseControl
    {
        private List<Models.AgentFormEdit_AgentForm_GetResult> getOneAgentForm;

        protected List<Models.AgentFormAdd_AgentFormTypes_SelectResult> showamfclientagentforms;

        protected void Page_Load(object sender, EventArgs e)
        {
            FillProductTypeDDL();
            FillAgentFormFields();
        }

//        private void FillTaskCodeDropDown()
//        {
////            SELECT t.code      
////from Task t
////where t.CategoryID in (935,930)
//        }

        
        private void FillAgentFormFields()
        {
            string[] aflidsid = Session["afa_agentformlistidsid"].ToString().Split('-');
            
            using (AgentFormsDataContext dc = new AgentFormsDataContext())
            {
                getOneAgentForm = dc.AgentFormEdit_AgentForm_Get(Convert.ToInt32(aflidsid[0]), Convert.ToInt32(aflidsid[1])).ToList<Models.AgentFormEdit_AgentForm_GetResult>();                
            }     

            foreach (Models.AgentFormEdit_AgentForm_GetResult agentfield in getOneAgentForm)
            {
                ddlLookupFormType.LookupID = agentfield.FormTypeID;
                TextBoxSequence.Text = agentfield.Sequence.ToString();
                TextBoxFormName.Text = agentfield.FormName;
                TextBoxColist.Text = agentfield.ColistFlag.ToString();
                RadioButtonAcceptanceRequiredFalse.Checked = agentfield.AcceptanceReqd == true ?  false : true;
                RadioButtonAcceptanceRequiredTrue.Checked = !RadioButtonAcceptanceRequiredFalse.Checked;
                RadioButtonDuplicatesAllowedFalse.Checked = agentfield.DuplicatesAllowed == true ? false : true;
                RadioButtonDuplicatesAllowedTrue.Checked = !RadioButtonDuplicatesAllowedFalse.Checked;                
                TextBoxExternalLink.Text = agentfield.ExternalLink;
                TextBoxTaskCode.Text = agentfield.TaskCode;
             //   TextBoxAMFirm.Text = agentfield.AMFID.ToString();
             //   TextBoxClient.Text = agentfield.ClientID.ToString();
                ddlProducts.SelectedValue = agentfield.ProductID.ToString();
                RadioButtonActiveFalse.Checked = agentfield.Active == true ? false : true;
                RadioButtonActiveTrue.Checked = !RadioButtonActiveFalse.Checked;

                //ternary operator syntax example
                //int ystep = y0 < y1 ? 1 : -1;
            }         
        }

        private void FillProductTypeDDL()
        {
            ProductTypeDataContext pdc = new ProductTypeDataContext();
            var result = pdc.ProductType_DropDown_Get(null, null, CurrentUser.UserID, CurrentUser.UserSID).ToList();
            this.ddlProducts.DataSource = result;
            ddlProducts.DataTextField = "Name";
            ddlProducts.DataValueField = "ProductTypeID";
            ddlProducts.DataBind();
        }

        protected void ButtonSave_Click(object sender, EventArgs e)
        {
            SaveChanges();
            Session["afa_returnfromchild"] = true;
            string prevPage = Session["afa_parent"].ToString();
            Response.Redirect(prevPage);
        }

        private void SaveChanges()
        {
            using (AgentFormsDataContext dc = new AgentFormsDataContext())
            {
                string[] aflidsid = Session["afa_agentformlistidsid"].ToString().Split('-');

                int agentformlistid = Convert.ToInt32(aflidsid[0]);
                int agentformlistsid = Convert.ToInt32(aflidsid[1]);
                int formtypeid = Convert.ToInt32(ddlLookupFormType.LookupID);
                int sequence = Convert.ToInt32(TextBoxSequence.Text);
                string formname = TextBoxFormName.Text;
                int colist = Convert.ToInt32(TextBoxColist.Text);
                bool rbAcceptReqd = RadioButtonAcceptanceRequiredFalse.Checked == true ? false : true;
                bool rbDupAllowed = RadioButtonDuplicatesAllowedFalse.Checked == true ? false : true;
                string extlink = TextBoxExternalLink.Text;
                string taskCode = TextBoxTaskCode.Text;
                int productid = Convert.ToInt32(ddlProducts.SelectedValue);
                bool rbActive = RadioButtonActiveFalse.Checked == true ? false : true;

                dc.AgentFormEdit_AgentForm_Update(agentformlistid, agentformlistsid, formtypeid, sequence, formname, colist, rbAcceptReqd, rbDupAllowed, extlink, taskCode, productid, rbActive);

                
                //dc.AgentFormEdit_AgentForm_Update(Convert.ToInt32(aflidsid[0]), Convert.ToInt32(aflidsid[1])).ToList<Models.AgentFormEdit_AgentForm_GetResult>();
                //dc.AgentFormEdit_AgentForm_Update(Convert.ToInt32(aflidsid[0]), Convert.ToInt32(aflidsid[1])).ToList<Models.AgentFormEdit_AgentForm_GetResult>();
            }  
        }

        protected void ButtonCancel_Click(object sender, EventArgs e)
        {
            Session["afa_returnfromchild"] = true;
            string prevPage = Session["afa_parent"].ToString();
            Response.Redirect(prevPage);
        }

    }
}

Open in new window







markup:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AgentFormEdit.ascx.cs" Inherits="Reo.ContentControls.AgentFormEdit" %>
<%@ Register Assembly="Framework" Namespace="Framework.UIControls" TagPrefix="cc1" %>

<%--page created by Tom Knowlton - cr 1123--%>


<script type="text/javascript" src="Scripts/jQueryDatePicker/jquery-ui-1.8.5.custom.min.js"></script>

<script type="text/javascript">

   
     $(document).ready(function () {
         $('div[id="agentformfields"]').css('position', 'relative');
         //$('div[id="agentformfields"]').css('background-color', 'red');
         $('div[id="agentformfields"]').css('height', '500px');
         $('div[id="agentformfields"]').css('width', '800px');

         $('div[class="afa_label"]').css('position', 'relative');
         $('div[class="afa_label"]').css('width', '120px');
      //   $('div[class="afa_label"]').css('background-color', 'red');
         $('div[class="afa_label"]').css('float', 'left');
         $('div[class="afa_label"]').css('clear', 'left');
         $('div[class="afa_label"]').css('text-align', 'right');
         $('div[class="afa_label"]').css('margin-right', '5px');
         $('div[class="afa_label"]').css('padding-top', '5px');


         $('div[class="afa_control"]').css('position', 'relative');
         $('div[class="afa_control"]').css('width', '280px');      
         $('div[class="afa_control"]').css('float', 'left'); 
         
         $('input').css('width', '30px');
         $('input[name*="TextBoxExternalLink"]').css('width', '200px');
         $('input[name*="TextBoxFormName"]').css('width', '200px');
         $('select[name*="TextBoxExternalLink"]').css('width', '200px');

         $('div[class="afa_controlrb"]').css('position', 'relative');
         $('div[class="afa_controlrb"]').css('width', '80px');
         $('div[class="afa_controlrb"]').css('float', 'left');

         $('div[class="afa_button"]').css('position', 'relative');
         $('div[class="afa_button"]').css('width', '150px');
         $('div[class="afa_button"]').css('float', 'left');


         $('input[type="submit"]').css('width', '80px');
         $('input[type="submit"]').css('position', 'relative');
         $('input[type="submit"]').css('float', 'left');       
     });

     

     		
    </script>


<div id="frame">
    <div id="frame_header">
        <div id="frame_title">
            <h1>
                Edit Agent Form</h1>
        </div>
    </div>

   <%-- <asp:UpdatePanel ID="UpdatePanelAgentFormAdd" runat="server" 
        ChildrenAsTriggers="False">
    <ContentTemplate>--%>
    <div id="corpus">
        <div id = "agentformfields">
            <div>
                <div id="formtype" class="afa_label">Form Type</div>
                <div id="formtypeddl" class="afa_control"><cc1:DdlLookup runat="server" HeaderCode="DocType" ID="ddlLookupFormType"></cc1:DdlLookup></div>
            </div>
            <div>
                <div id="sequence" class="afa_label">Sequence</div>
                <div id="tbsequence" class="afa_control"><asp:TextBox ID="TextBoxSequence" runat="server"></asp:TextBox></div>
            </div>
            <div>
                <div id="formname" class="afa_label">Form Name</div>
                <div class="afa_control"><asp:TextBox ID="TextBoxFormName" runat="server"></asp:TextBox></div>
            </div>
            <div>
                <div id="colist" class="afa_label">Colist</div>
                <div class="afa_control"><asp:TextBox ID="TextBoxColist" runat="server"></asp:TextBox></div>
            </div>
            <div>
                <div id="accptreqd" class="afa_label">Acceptance Reqd</div>
                <div class="afa_controlrb" id="radiobuttonaccptreqdtrue"><asp:RadioButton ID="RadioButtonAcceptanceRequiredTrue" GroupName="AccReqdGroup" runat="server" Text="True" /></div>
                <div id="radiobuttonaccptreqdfalse" class="afa_controlrb"><asp:RadioButton ID="RadioButtonAcceptanceRequiredFalse"  GroupName="AccReqdGroup" runat="server" Text="False"/></div>
            </div>
            <div>
                <div id="dupallow" class="afa_label">Duplicates Allowed</div>
                <div class="afa_controlrb" id="radiobuttondupallowedtrue"><asp:RadioButton ID="RadioButtonDuplicatesAllowedTrue" GroupName="DupAllowedGroup" runat="server" Text="True" /></div>
                <div id="radiobuttondupallowedfalse" class="afa_controlrb"><asp:RadioButton ID="RadioButtonDuplicatesAllowedFalse"  GroupName="DupAllowedGroup" runat="server" Text="False"/></div>
            </div>
            <div>
                <div id="extlink" class="afa_label">External Link</div>
                <div class="afa_control"><asp:TextBox ID="TextBoxExternalLink" runat="server"></asp:TextBox></div>
            </div>
            <div>
                <div id="taskcode" class="afa_label">Task Code</div>
                <div class="afa_control"><asp:TextBox ID="TextBoxTaskCode" runat="server"></asp:TextBox></div>
            </div>
            <%--<div>
                <div id="amfirm" class="afa_label">AM firm</div>
                <div class="afa_control"><asp:TextBox ID="TextBoxAMFirm" runat="server"></asp:TextBox></div>
            </div>
            <div>
                <div id="client" class="afa_label">Client</div>
                <div class="afa_control"><asp:TextBox ID="TextBoxClient" runat="server"></asp:TextBox></div>                
            </div>
            --%><div>
                <div id="product" class="afa_label">Product</div>
                <div class="afa_control"><asp:DropDownList ID="ddlProducts" runat="server"></asp:DropDownList></div>
            </div>
            <div>
                <div id="active" class="afa_label">Active</div>
                <div id="radiobuttonacttrue" class="afa_controlrb"><asp:RadioButton ID="RadioButtonActiveTrue" GroupName="ActiveGroup" runat="server" Text="True" /></div>
                <div id="radiobuttonactfalse" class="afa_controlrb"><asp:RadioButton ID="RadioButtonActiveFalse"  GroupName="ActiveGroup" runat="server" Text="False"/></div>
            </div>  
             <div>                
                <div id="Div2" class="afa_label"> </div>                
            </div>   
             <div>                
                <div id="Div3" class="afa_label"> </div>                
            </div>   
            <div>                
                <div id="Div1" class="afa_label"></div>
                <div id="divsave" ><asp:Button runat="server" ID="ButtonSave" Text="Save" 
                        Width="100px" onclick="ButtonSave_Click" /></div>
                <div id="divcancel"><asp:Button runat="server" ID="ButtonCancel" Text="Cancel" 
                        Width="100px" onclick="ButtonCancel_Click" /></div>
            </div>        
        </div>    
    </div>
 <%--   </ContentTemplate>
    </asp:UpdatePanel>--%>
    <div id="footer"></div>
<div id="end_cap"></div>
</div>

Open in new window

LVL 5
Tom KnowltonWeb developerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rpkhareCommented:
I think you need to use:

       protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
               FillProductTypeDDL();
               FillAgentFormFields();
             }
        }

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Tom KnowltonWeb developerAuthor Commented:
Concur!

Once I finally got a hold of my boss, he made the same suggestion.

Great minds think alike, right?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.