Sunday, March 11, 2012

How to show message box with update panel in asp.net


 ScriptManager.RegisterStartupScript(TxtMobileNumber,typeof(Page), "Open Window", "alert('Mobile Number Already Exists')", true);

Saturday, March 10, 2012

GET LATEST INDEX OF CHECKBOX LIST


  string lastValue = string.Empty;
    int lastIndex=0;

        foreach (ListItem listitem in chkSec.Items)
        {
            if (listitem.Selected)
            {
                int thisIndex = chkSec.Items.IndexOf(listitem);

                if (lastIndex < thisIndex)
                {
                    lastIndex = thisIndex;
                    lastValue = listitem.Value;
                }
            }
        }