none
Masterpage -> page ->usercontrol (DropDownList) RRS feed

  • Question

  • hello,

    I have a usercontrol inside a page. The usercontrol is a filter with a dropdownlist.

    To load the dropdownlist I need to get the value from the page and to load the page I need to get the selectedvalue of the dropdown list.

    The usercontrol is loaded after my page so I can't get the selectedvalue to display the information of the page.

    thank you for your help

    //usercontrol page
    private void SetDropDownList()
    {
                //List _Login, _Ssid : get from page
                           PartnerWebService.GetFamiliesResult resMain = partnerWS.GetFamilies(_Login, _Ssid);
    }
    //Page
     private void LoadDataCardholderContext()
            {
          //_CardholderNumber get from usercontrol dropdownlist     
                       CardholderWebService.GetMerchantCategorySummaryResult res = _CardholderWS.GetMerchantCategorySummary(_Login, _Ssid, _CardholderNumber, _StartPeriod, _EndPeriod);
    }

    Jennifer



    • Edited by jmy07 Tuesday, June 12, 2012 8:43 AM
    Monday, June 11, 2012 11:14 AM

Answers

  • After searching for a while I found out the solution by myself.

    I just use the PreRender in the main page to display the informaition, and the Load to load the variable I need to display the information.

    It looks like this.

    protected void Page_PreRender(object sender, EventArgs e)
    {  
                //Load
                if (!IsPostBack)
                {
                   LoadDataCardholderContext();     
           }
     }
    

    Hope this will save time to others.

    So to resume Page_Load ->usercontrol

    Page_Load -> page

    Page_Load -> master

    Page_Prerender -> Page

    • Marked as answer by jmy07 Tuesday, June 12, 2012 8:43 AM
    Tuesday, June 12, 2012 8:43 AM

All replies

  • For questions related to ASP.NET use the ASP.NET forum .  You should get more, better, and faster replies on the other forum.  That is where the best web heads hang out.

    Thanks, ahead of time.

    Rudy   =8^D


    Mark the best replies as answers. "Fooling computers since 1971."

    http://thesharpercoder.blogspot.com/

    Monday, June 11, 2012 3:33 PM
  • thank you  :)
    Tuesday, June 12, 2012 7:04 AM
  • you can create properties of master page and those are accessible in the content page.

    Mark Answered, if it solves your question and Vote if you found it helpful.
    Rohit Arora

    Tuesday, June 12, 2012 7:06 AM
  • even if i create properties in the page, my usercontrol is called after my page is load, and i need to get the selectedvalue of the dropdown list which is in the user control to display correctly the page.

    mean i could have access to the property but it would be empty.

    thanks

    Tuesday, June 12, 2012 7:10 AM
  • After searching for a while I found out the solution by myself.

    I just use the PreRender in the main page to display the informaition, and the Load to load the variable I need to display the information.

    It looks like this.

    protected void Page_PreRender(object sender, EventArgs e)
    {  
                //Load
                if (!IsPostBack)
                {
                   LoadDataCardholderContext();     
           }
     }
    

    Hope this will save time to others.

    So to resume Page_Load ->usercontrol

    Page_Load -> page

    Page_Load -> master

    Page_Prerender -> Page

    • Marked as answer by jmy07 Tuesday, June 12, 2012 8:43 AM
    Tuesday, June 12, 2012 8:43 AM