Hi,
i have written this code for javascript
<script type="text/Javascript" language ="javascript" >
function SomeFunction(ctl)
{
if (confirm("Are you sure?"))
{
document.getElementById(ctl).value = "Ok";
return true;
}
else
{
document.getElementById(ctl).value = "Cancel";
return true;
}
}
</script>
protected void Page_Load(object sender, EventArgs e)
{
btnDelete.Attributes.Add("OnClientClick", "return SomeFunction('" + HiddenResult.ClientID + "')");
}
protected void btnDelete_Click(object sender, EventArgs e)
{
if (HiddenResult.Value == "OK")
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "test", "alert('put code here')", true);
}
else
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "test", "alert('Do Nothing')", true);
}
HiddenResult.Value = "";
}
but it still not working ... showing alert Do Nothing... means hidden field value not set.