AJAX ModalPopupExtender & Gridview row values

58 Views Asked by At

I've not really used the MPE before & currently have a need to, what I'm slightly confused about is losing reference to the initial control that triggers the function.

I have a gridview with a dropdownlist and onselectedindexchanged set to call a function when a value has been selected, when processed one value i grab is the RowID into a variable, out of 9 list items only one requires the pop up (Ok = proceed & Cancel = Return) & when this is triggered I lose all reference to the given grid row which is referenced via;

DropDownList ddlid = (DropDownList)sender;
GridViewRow gvrow = (GridViewRow)ddlid.NamingContainer;
RowID = (Int32.Parse(GridView1.DataKeys[gvrow.RowIndex].Values[0].ToString()));

Can anyone shed any light or have an idea on how I can keep track of the gridview row?

Thanks IchBinDicky

1

There are 1 best solutions below

0
IchBinDicky On

Used session object in the code behind (point of loss) in the end as it fit a few other issues I'd encountered at the same time;

        public static string TabIndxValue
        {
            get
            {
                object value = HttpContext.Current.Session["TabIndxValue"];
                return value == null ? "" : (string)value;
            }
            set
            {
                HttpContext.Current.Session["TabIndxValue"] = value;
            }
        }