Hi Varkey,
I think the problem is just because when you using the
cmbGroup.Attributes.Add("onchange","return confirm('Are you sure you
want to leave without saving your change(s)?');");
, the dropdownlist's "onchange" event will end right after we make the
decision on the confirm dialog , so that the sequential "__doPostBack"
function is not called. I suggest you change your code to the below:
==============
private void Page_Load(object sender, System.EventArgs e)
{
string script =
@"
if(!confirm('Are you sure to postback?')){ return false};
";
lstItems.Attributes.Add("onchange",script);
}
===============
that means we only return false when the user choose "no", but let the
event continue if "yes" is choosen. This works well on my side, please let
me know if it also works on your side.
Hope helps. Thanks,
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)