locked
How to reference to listview Control while in ModalpopupExtender? RRS feed

  • Question

  • User-1175871172 posted

    Hi guys,

    I have a modalpopupextender that has a button and a textbox.

    I want to retrieve the value for 

    listview.DataKeys[listview.Items[4].DataItemIndex].Value.ToString();

    But it seems that the listview is null when i tried to write this code in the modalpopupextender panel control.

    How do i get the parent page control to reference?

    Friday, May 23, 2014 7:00 AM

Answers

  • User-417640953 posted

    Hi random1990,

    Thank you post the issue to asp.net forum.

    Based on your description, I see you want to get the ListView Object which in the Panel control getting toget with a ModalpopupExtender.

    In the code behind, I suggest you use below code to get the ListView.

                ListView listview = (ListView)this.Panel1.FindControl("ListView1");
                if (listview != null)
                {
                   //your code ......            
                }

    If I misunderstand your issue, please feel free to back and share more information with us. Thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, May 25, 2014 11:02 PM