Problem: Parent Control cannot pick up child control values in pages that use new 2.0 features

I have been experiencing the loss of data either with my own custom controls or using third party controls such as FreeTextBox...regardless if I reference the controls by a controlID, manage viewstate etc.
However, the issues with not being to retrieve data from child controls typically only occur when a chld control is called from another child control and the parent control uses Treeview, MultiView, or WizardSteps....

For example:

I have an page that has a treeview menu control on the left (using a master page) that selects the page to load.  The page in question is a security selection page to select roles (not using the membership / roles feature of 2.0 ).  This page uses a custom listpicker control.  I added to the listpicker control a label to verify the control is indeed updating the "Changed" bool variable that the parent requires to check to see if the role selection has been updated.  It does as I add an entry from the 'All Roles' list to the 'Selected Roles' list.

However the parent control when the submit event is fired does not pick up the variable change and is always reporting false... However, the same identical ListPicker when used without MasterPages, Treeviews, MultiViews, Wiazardsteps etc.. works like a champ.  So either I have coded something that worked but really shouldn't or there is some kind of bug in the RTM C# 2005 that is just making my life miserable. 

Code:  Lispicker

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Text;
using System.IO;
using Cavalia;

namespace Cavalia
{

    [Designer(typeof(Cavalia.CommunityDesigner))]
    public class ListPicker :  SkinnedCommunityControl
    {
       
        ListBox lstSelectedItems;
        ListBox lstAllItems;
        Button AddOne;
        Button AddAll;
        Button RemoveOne;
        Button RemoveAll;
        //bool AllowDuplicates = false;
        private ArrayList _allItems = new ArrayList();
        private ArrayList _selectedItems = new ArrayList();
        private IEnumerable _dataSource = null;
        private string _dataField = String.Empty;
        string _skinFileName = "ListPicker.ascx";
        bool _Changed = false;
        string _SelectedItemsText;
        string _SelectedState;
        string _AllItemsText;
        bool _AllowDuplicates;
        Label showError;

        override protected string SkinType
        {
            get { return "ControlSkins"; }
        }

        override protected void InitializeSkin(Control skin)
        {
            lstSelectedItems = (ListBox)GetControl(skin, "lstSelectedItems");
            lstAllItems = (ListBox)GetControl(skin, "lstAllItems");
            AddOne = (Button)GetControl(skin, "AddOne");
            AddAll = (Button)GetControl(skin, "AddAll");
            RemoveOne = (Button)GetControl(skin, "RemoveOne");
            RemoveAll = (Button)GetControl(skin, "RemoveAll");
            showError = (Label)GetControl(skin, "showError");

            AddOne.Click += new EventHandler(AddOne_Click);
            AddAll.Click += new EventHandler(AddAll_Click);
            RemoveOne.Click += new EventHandler(RemoveOne_Click);
            RemoveAll.Click += new EventHandler(RemoveAll_Click);
           
        }


        public ListPicker()
            : base()
        {

            // Assign a default template name
            if (SkinFileName == null)
                SkinFileName = _skinFileName;


        }

        //*********************************************************************
        //
        // Changed Property
        //
        // True when new item picked.
        //
        //*********************************************************************
        public bool Changed
        {
            get { return _Changed; }
            set { _Changed = value; }
        }


        public string SelectedItemsText
        {
            get { return _SelectedItemsText; }
            set { _SelectedItemsText = value; }
        }
        private string SelectedState
        {
            get { return _SelectedState; }
            set { _SelectedState = value; }
        }



        public string AllItemsText
        {
            get { return _AllItemsText; }
            set { _AllItemsText = value; }
        }

        //*********************************************************************
        //
        // DataSource Property
        //
        // The Data Source for the All Items listbox
        //
        //*********************************************************************
        public IEnumerable DataSource
        {
            get { return _dataSource; }
            set { _dataSource = value; }
        }


        //*********************************************************************
        //
        // DataField Property
        //
        // The Data Field for the All Items Data Source
        //
        //*********************************************************************
        public string DataField
        {
            get { return _dataField; }
            set { _dataField = value; }
        }



        protected void AddAll_Click(object sender, EventArgs e)
        {
            _Changed = true;
            // Adds all of the items to the list that will be saved
            lstSelectedItems.SelectedIndex = -1;
            foreach (ListItem li in lstAllItems.Items)
            {
                AddItem(li);
            }
        }
        protected void AddOne_Click(object sender, EventArgs e)
        {
           
            //Adds the selected item to the list that will be saved
            lstSelectedItems.SelectedIndex = -1;
            ListItem li = lstAllItems.SelectedItem;
            if (AllowDuplicates == true)
            {
                lstSelectedItems.Items.Add(li);
                _Changed = true;
            }
            else
            {
                if (lstSelectedItems.Items.FindByText(li.Text) == null)
                {
                    lstSelectedItems.Items.Add(li);
                    _Changed = true;
                    showError.Text = Changed.ToString();
                }
            }
        }
        protected void RemoveOne_Click(object sender, EventArgs e)
        {
            if (lstSelectedItems.SelectedIndex >= 0)
            {
                lstSelectedItems.Items.RemoveAt(lstSelectedItems.SelectedIndex);
                lstSelectedItems.SelectedIndex = -1;
                _Changed = true;
            }
        }
        protected void AddItem(ListItem li)
        {
            lstSelectedItems.SelectedIndex = -1;
            lstSelectedItems.Items.Add(li);
           
        }
        protected void RemoveItem(ListItem li)
        {
            lstSelectedItems.SelectedIndex = -1;
            lstSelectedItems.Items.Remove(li);
        }
        /*
        public ListItemCollection SelectedItems
        {
            get { return lstSelectedItems.Items; }
        }*/

        public bool AllowDuplicates
        {
            get { return _AllowDuplicates; }
            set { _AllowDuplicates = value; }
        }

        protected void RemoveAll_Click(object sender, EventArgs e)
        {
            // Adds all of the items to the list that will be saved
            lstSelectedItems.SelectedIndex = -1;
           /* foreach (ListItem li in lstSelectedItems.Items)
            {
                RemoveItem(li);
            }*/
            lstSelectedItems = null;
            SelectedItemsText = null;
            _Changed = true;
        }

        //*********************************************************************
        //
        // SelectedItems Property
        //
        // Returns an array of selected items
        //
        //*********************************************************************
        public string[] SelectedItems
        {
                
            get
            {
                return (string[])_selectedItems.ToArray(typeof(String));
            }
            set
            {
                _selectedItems = new ArrayList(value);
                SelectedState = String.Join(",", value);
            }
       
        }



        //*********************************************************************
        //
        // AllItems Property
        //
        // Returns an array of all items.
        //
        //*********************************************************************
        public string[] AllItems
        {
            get
            {
                return (string[])_allItems.ToArray(typeof(String));
            }
        }


        protected override void OnLoad(EventArgs e)
        {
            EnsureChildControls();
            if (!Page.IsPostBack)
            {
               // BindData();
            }
        }
        protected override void OnDataBinding(EventArgs e)
        {
            IEnumerator objDataEnum;
           
            // bind all items
            if (_dataSource != null)
            {
                Context.Trace.Warn("Data Source is: " + _dataSource.ToString());
                // Populate all items
                objDataEnum = _dataSource.GetEnumerator();
                while (objDataEnum.MoveNext())
                    if (_dataField == String.Empty)
                        _allItems.Add((string)objDataEnum.Current);
                    else
                        _allItems.Add((string)DataBinder.Eval(objDataEnum.Current, _dataField));


                EnsureChildControls();
                lstAllItems.DataSource = AllItems;
                lstAllItems.DataBind();

                lstSelectedItems.DataSource = SelectedItems;
                lstSelectedItems.DataBind();
            }
            else
            {
                Context.Trace.Warn("Data Source is null and not used");
            }
        }







             
    }
}


Code: Parent control...

namespace Cavalia.Admin.EditSections
{
    using System;
    using System.Collections;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.Security;
    using Cavalia.Admin;
    using Cavalia;
    using Cavalia.Enums;

    /// <summary>
    ///        Summary description for SectionSecurity.
    /// </summary>
    public class SectionSecurity : SkinnedCommunityControl
    {
        //Define the SKIN - we use this tecnique because we want to be able to use admin functions
        //anywhere within the site....
        string _skinFileName = "/admin/Section_Security.ascx";
        string errorMSG = "Could not complete your request.";

        protected System.Web.UI.WebControls.Panel formEntry;
        protected System.Web.UI.WebControls.Label showError;
        protected System.Web.UI.WebControls.CheckBox chkIsEnabled;

        protected System.Web.UI.WebControls.Button btnSubmit;

         ListPicker ctlViewRoles;
         ListPicker ctlAddRoles;
         ListPicker ctlEditRoles;
         ListPicker ctlDeleteRoles;
         ListPicker ctlCommentRoles;
         ListPicker ctlRateRoles;
         ListPicker ctlModerateRoles;

               

        public SectionInfo Section;
       
        public ArrayList AllRoles;
       
       
        public string[] ViewRoles {
            get { return ctlViewRoles.SelectedItems; }
       
        }

        public bool ViewRolesChanged {
            get { return ctlViewRoles.Changed; }
           
        }
       
        public string[] AddRoles {
            get { return ctlAddRoles.SelectedItems; }
        }
       
        public bool AddRolesChanged {
            get { return ctlAddRoles.Changed; }
        }
       
       
        public string[] EditRoles {
            get { return ctlEditRoles.SelectedItems; }
        }
       
        public bool EditRolesChanged {
            get { return ctlEditRoles.Changed; }
        }
       
       
        public string[] DeleteRoles {
            get { return ctlDeleteRoles.SelectedItems; }
        }
       
        public bool DeleteRolesChanged {
            get { return ctlDeleteRoles.Changed; }
        }

        public string[] RateRoles
        {
            get { return ctlRateRoles.SelectedItems; }
        }

        public bool RateRolesChanged
        {
            get { return ctlRateRoles.Changed; }
        }

        public bool CommentRolesChanged
        {
            get { return ctlCommentRoles.Changed; }
        }

        public string[] CommentRoles
        {
            get { return ctlCommentRoles.SelectedItems; }
        }

        public bool ModerateRolesChanged
        {
            get { return ctlModerateRoles.Changed; }
        }

        public string[] ModerateRoles
        {
            get { return ctlModerateRoles.SelectedItems; }
        }

        //*********************************************************************
        //
        // SectionID Property
        //
        // Stores the ID of the content being edited in View State
        //
        //*********************************************************************

        int SectionID
        {
            get
            {
                try
                {
                    return (int)ViewState["SectionID"];
                }
                catch
                {
                    return -2;
                }
            }
            set { ViewState["SectionID"] = value; }
        }

        //*********************************************************************
        //
        // SkinType Property
        //
        // Specifies the skins directory where this page's skin file is located.
        //
        //*********************************************************************

        override protected string SkinType
        {
            get { return "ControlSkins"; }
        }

        override protected void InitializeSkin(Control skin)
        {
                   
            // Find Title
            ctlViewRoles = (ListPicker)GetControl(skin, "ctlViewRoles");

            //Find Name of the Section
            ctlAddRoles = (ListPicker)GetControl(skin, "ctlAddRoles");

            //Find the Menu Title
            ctlEditRoles = (ListPicker)GetControl(skin, "ctlEditRoles");

            // Find Section Description Text
            ctlDeleteRoles = (ListPicker)GetControl(skin, "ctlDeleteRoles");
            ctlModerateRoles = (ListPicker)GetControl(skin, "ctlModerateRoles");
            ctlRateRoles = (ListPicker)GetControl(skin, "ctlRateRoles");
            ctlCommentRoles = (ListPicker)GetControl(skin, "ctlCommentRoles");
           
            formEntry = (Panel)GetControl(skin, "formEntry");
            formEntry.Visible = false;
            showError = (Label)GetControl(skin, "showError");
            // Find the Update button
            btnSubmit = (Button)GetControl(skin, "btnSubmit");
            btnSubmit.Click += new EventHandler(btnSubmit_Click);



        }
       
       
    override protected void OnLoad(EventArgs e) {
            EnsureChildControls();

            if (!Page.IsPostBack)
            {
                try
                {
                    SectionID = Int32.Parse(Context.Request.QueryString["id"]);
                    showError.Visible = true;
                    showError.Text = "We got the section";
                }
                catch
                {
                    //If null then we want to add an error message.  Without a valid param
                    //string then nothing to edit....
                    errorMSG = "No valid parameters were detected.  Please, contact your system administrator for assistance.  If this problem persists, then submit a Trouble Ticket at http://sites-easy.com";
                    showError.Visible = true;
                    showError.Text = errorMSG;
                    ViewState["SectionID"] = -2;
                }

                // Get the Section information
                if (SectionID != -2)
                {
                    SectionInfo Section = SectionUtility.GetSectionInfoFromDB(SectionID);


                    // Assign Values
                    EnsureChildControls();
                    if (Section != null)
                    {
                        ArrayList AllRoles = UserUtility.GetAllRoles();
                        formEntry.Visible = true;
                        ctlViewRoles.DataSource = AllRoles;
                        ctlAddRoles.DataSource = AllRoles;
                        ctlEditRoles.DataSource = AllRoles;
                        ctlDeleteRoles.DataSource = AllRoles;
                        ctlCommentRoles.DataSource = AllRoles;
                        ctlModerateRoles.DataSource = AllRoles;
                        ctlRateRoles.DataSource = AllRoles;


                        ctlViewRoles.SelectedItems = Section.ViewRoles;
                        ctlAddRoles.SelectedItems = Section.AddRoles;
                        ctlEditRoles.SelectedItems = Section.EditRoles;
                        ctlDeleteRoles.SelectedItems = Section.DeleteRoles;
                        ctlCommentRoles.SelectedItems = Section.CommentRoles;
                        ctlModerateRoles.SelectedItems = Section.ModerateRoles;
                        ctlRateRoles.SelectedItems = Section.RateRoles;
                    }
                    else
                    {
                        ctlViewRoles.SelectedItems = new string[] { "Community-Everyone" };
                        ctlAddRoles.SelectedItems = new string[] { "Community-Administrators" };
                        ctlEditRoles.SelectedItems = new string[] { "Community-Administrators" };
                        ctlDeleteRoles.SelectedItems = new string[] { "Community-Administrators" };
                        ctlCommentRoles.SelectedItems = new string[] { "Community-Authenticated" };
                        ctlModerateRoles.SelectedItems = new string[] { "Community-Administrators", "Community-Moderators" };
                        ctlRateRoles.SelectedItems = new string[] { "Community-Administrators" };
                    }

                    DataBind();
                }
            }
        }
        //*********************************************************************
        //
        // SubmitUpdateMethod
        //
        // This method is raised by clicking the Edit button in the Edit
        // form.
        //
        //*********************************************************************

     
            protected void btnSubmit_Click(object sender, EventArgs e)
        {
            EnsureChildControls();
            if (Page.IsValid)
            {
                errorMSG = "Start :";
                errorMSG = "ViewRoles : " + ViewRolesChanged.ToString() + " The child control value : " + ctlViewRoles.Changed.ToString();
                errorMSG = errorMSG + "  " + ctlViewRoles.SelectedItemsText.ToString();
               
                // Update View Roles
                if (ctlViewRoles.Changed == true)
                {
                    SectionUtility.AddSectionRoles(SectionID, RoleType.ViewRole, ViewRoles);
                    errorMSG = "ViewRoles : " + ViewRolesChanged.ToString();
                }
                // Update Add Roles
                if (AddRolesChanged == true)
                {
                    SectionUtility.AddSectionRoles(SectionID, RoleType.AddRole, AddRoles);
                    errorMSG = errorMSG + "AddRolesChanged : " + AddRolesChanged.ToString();
                }
                // Update Edit Roles
                if (EditRolesChanged)
                {
                    SectionUtility.AddSectionRoles(SectionID, RoleType.EditRole, EditRoles);
                    errorMSG = errorMSG + "EditRolesChanged : " + EditRolesChanged.ToString();
                }
                // Update Delete Roles
                if (DeleteRolesChanged)
                {
                    SectionUtility.AddSectionRoles(SectionID, RoleType.DeleteRole, DeleteRoles);
                    errorMSG = errorMSG + "DeleteRolesChanged : " + DeleteRolesChanged.ToString();
                }
                // Update Comment Roles
                if (CommentRolesChanged)
                {
                    SectionUtility.AddSectionRoles(SectionID, RoleType.CommentRole, CommentRoles);
                    errorMSG = errorMSG + "CommentRolesChanged : " + CommentRolesChanged.ToString();
                }
                // Update Moderate Roles
                if (ModerateRolesChanged)
                {
                    SectionUtility.AddSectionRoles(SectionID, RoleType.ModerateRole, ModerateRoles);
                    errorMSG = errorMSG + "ModerateRolesChanged : " + ModerateRolesChanged.ToString();
                }
                // Update Rate Roles
                if (RateRolesChanged)
                {
                    SectionUtility.AddSectionRoles(SectionID, RoleType.RateRole, RateRoles);
                    errorMSG = errorMSG + "RateRolesChanged : " + RateRolesChanged.ToString();
                }
                                  // Redirect back to Article Page
                   // Context.Response.Redirect(CommunityGlobals.CalculatePath(String.Format("{0}.aspx", SectionID)));
                ActivityUtility.RecordMessage("Results", errorMSG);
            }
            else { ActivityUtility.RecordMessage("Section Security: Page is not Valid", ""); }
        }


        //*********************************************************************
        //
        // EditArticle Constructor
        //
        // Calls the base SkinnedCommunityControl constructor
        // and assigns the default page skin. Also checks whether
        // current user has permissions to edit.
        //
        //*********************************************************************

        public SectionSecurity()
            : base()
        {
            // Assign a default skin file name
            // Assign a default skin file name
            if (SkinFileName == null)
                SkinFileName = _skinFileName;

            //Add the Security Checks here....

            //add button event
           

        }


    }
}

---------------------------------

I have noticed this behavior in a bunch of different places - where child controls are required but when included in a page that contains a MultiView, TreeView - basically any of the new UI controls... data is lost on postbacks, or null values are picked up by the parent control =- even though it is evident that the child control is changing and updating values.  I have used the set viewstate to manage and that does not work either...

Can anyone explain how to correct this behavior as I am baffled why it will work sometimes in pages and not in others...?





-- jody
My Blogs on .Net 2.0 and Ajax
http://csk.wbcb.com
http://ArtbyJody.com
0
jodywbcb
1/28/2006 12:44:01 PM
asp.net.web-forms 93655 articles. 5 followers. Follow

0 Replies
814 Views

Similar Articles

[PageSpeed] 3

Reply:

Similar Artilces:

Passing values from a parent web control to child web control
I have a parent control which called CONTROL1 and a child control witch called CONTROL2 I would link to pass a value from the parent control to the child control. In the parent control(CONTROL1) I have the following Event Handler . private void btn_Handler(object sender, EventArgs e) { …      if (Page.IsPostBack) {              // Send the officer names to the child controls.             if(m_nameList.SelectedItem.Text != "")     ...

Pass value from Child page to Parent page ( to locate sub controls of parent page )
Team, This is a question related parent and child webform or webpage. My utlimate aim is to pass or update a control of my parent page from child page. The Design   Parent Page --------------   Parent DataList 1       Child DataList 1          Textbox1 Textbox2 Textbox3 Textbox4       Child Datalist 2          Textbox1 Textbox2 Textbox3 Textbox4       Child Datalist 3     ...

Having problem modifying controls with new DNN 2.0.1 and DNN 2.0.2
Has something changed in the DNN 2.0.1 and DNN 2.0.2 releases of DNN that will not allow changes to the DesktopModules? In DNN 2.0.0 I was able to go and modify the EditContact.ascx file and place the following fields on the form. Last Name: First Name: Department: I made all the change to the database table and the stored procedures. I made the changes to the ContactsDB files as well as the changes to the DataProvider file and the SqlDataProvider file. In version DNN 2.0.0 the modified contacts form works like a champ I changed the Contacts form to show the three new fields...

How to validate controls on a .NET 2.0 Web user Control
Hi Guys, (ASP.NET 2.0 / C#) I've looked thorugh every post on validating web user controls (and know about Pter Blum's Professional Validation and More package) - but can't seem to get my head around whre to start. I have a web user control, called wucICL.ascx on a we page called AddEditInvestment.aspx.  I would like to validate a couple of DropDownLists (ddlAccounts and ddlContacts) when the Insert and Update buttons are clicked on the AddEdit Investment page. The other controls on the AddEditInvestments page belong to a validation group called All Validators and the DropDownL...

How to get the HREF value of the Anchor tag in a web page using the web browser control in vb.net
Hi Friends,               i have a webserver control in my application.i load the web browser control on a button click using the below code Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click                AxWebBrowser1.Navigate("http://www.rateitall.com/i-322335-.aspx", False) End sub once the page is loaded in the browser i want the <a> HREF value in that page.For example if that page has ...

Datagrid(.net 1.1) to GridView(.net 2.0) and using the RowUpdating event how to extract the values from the controls.
Ok  This is the settings: I use a Viewgrid with only itemtemplate colums for example. <asp:TemplateField HeaderText="Test"><ItemTemplate><asp:Label id="LBL_Test" text='<%# DataBinder.Eval(Container.DataItem, "Test1") %>' runat="server" meta:resourcekey="LBL_TestResource1"></asp:Label></font></ItemTemplate> <EditItemTemplate><asp:TextBox ID="HDN_Test" Text='<%# DataBinder.Eval(Container.DataItem, "Test1") %>' Runat="server" meta:resourcekey="HDN_TestResource1" /></EditItemTemplate></asp:TemplateField>  The ...

Problems passing values from parent user control to child user control
PARENT (EmployeeView.ascx) <asp:TextBox id="txtEID" runat="server">3</asp:TextBox> <asp:PlaceHolder id="plhDetail" runat="server"></asp:PlaceHolder> Private Sub lnkGeneral_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lnkGeneral.Click plhDetail.Controls.Add(Me.LoadControl("ucGeneral.ascx")) End Sub Public Property pEID() As Integer Get Return CInt(txtEID.Text) End Get Set(ByVal Value As Integer)...

Cannot pass target control value to web method (autocomplete, .NET 2.0, toolkit release 1.0.20229)
I am trying to use 1.020229 in VS 2008, and maybe that is my problem, but I want to use VS 2008 and target a .NET 2.0 framework and I have tried several of the other toolkit controls in this same environment (e.g. tabpanel) and they seem to work. The problem is that when I use "public string[] GetSuggestions(string prefix, int n)" in the web service code behind, it never gets invoked.  But if I remove the parameters (i.e. "public string[] GetSuggestions()", then it does, but of course in that case the results have nothing to do with the text entered in the target ...

Major problems with .NET 2.0 and child controls?
Although .NET is excellent for most things I'm less than happy with the way it handles validation of child controls (or, more accurately, the way it DOESN'T handle validation of child controls). As a result the following is giving me a headache: I have a wizard which contains several multiline textboxes. I need to have a character counter working for each textbox. I've tried various character counter controls and code from the web and none works. An example is the MultiLineTextBoxValidator control from the Fluent Consulting web site (http://www.fluentconsulting.com/). This control works fi...

How to pass form values to a page using button web controls?
I am having problems working out how to produce some code for a web site administration section. What I am trying to do is to show a list of the categories, as taken from the database. There are then buttons to edit or delete a selected category, as well as the ability to add a new category. What I have done previously, in ASP, is to have a form at the top of the page with a couple of hidden fields, one for the action and one for the category ID, and then used javascript to change those values according to which button was pressed, and submitted the form. So far, I have used a Repeater...

controlling an object in a web control from the page the web control is placed in
I have created a web control in vb.net that has an image button and an image. when it loads the image button is visible and the image is not. I want to be able from the page which "includes" the web control to set the image button to invisible and the image to visible. When I tried this, the main page didn't recognise the image button or the image (both < asp: objects). help would be gratefully appreciated. oh yeah, it's inline code so any code behind stuff will just confuse me ;) Some code please.-- Justin Lovell...

Problem to use TreeView Control in a 'content page' This Error Occur "Only Content controls are allowed directly in a content page that contains Content controls."
hi I am trying to use the TreeView Control inside the content page (Page that has a master page is a content page). On compiling the project I got the following ASP.Net runtime error: "Only Content controls are allowed directly in a content page that contains Content controls."B@b@R J Issue resolved. I was putting script tag in the content page that is not allowed. when remove the script from content page problem is resolved.B@b@R J...

Trying to use the FAQ " Sorting and paging in the GridView control when not using data source controls "Sorting and paging in the GridView control when not using..."
and I am not getting the results I had hoped for.  I keep getting a "Compiler Error Message: CS0123: No overload for 'AdhocJobGridView_PageIndexChanged' matches delegate 'System.EventHandler'".   Here is my event handling... protected void AdhocJobGridView_PageIndexChanged(object sender, GridViewPageEventArgs e){ try { AdhocJobGridView.DataSource = wsBaseInfoArray; AdhocJobGridView.PageIndex = e.NewPageIndex; AdhocJobGridView.DataBind(); }catch (Exception ex) {throw ex; }   Here is my aspx... <asp:GridView ID="AdhocJobGridView...

How I could Make user controls to take The new value from updated web form page?
I have webform Page That I change values in classess throeugh it but on calling the "User control"pages It dosent responed to the changing the Question is How I could Make IT to take The new value from updated web form page? Declare a public property in the user control and set it from the page.Example:  User controlPublic Property ChangeName() As String   Get           return custName.text   End Get   Set (byval value as String)         custNa...

Web resources about - Problem: Parent Control cannot pick up child control values in pages that use new 2.0 features - asp.net.web-forms

Resources last updated: 11/29/2015 11:18:13 PM