ASPX
Code Behind
- protected bool ValidateDuplicate()
- {
- bool result = true;
- Material material = new Material();
- MaterialDataAccess materialDA = new MaterialDataAccess();
- if (hfdMode.Value.Equals("new") || hfdMode.Value.Equals("draft"))
- {
- material.Type = "N";
- }
- else if (hfdMode.Value == "update")
- {
- material.Type = "U";
- }
- material.RequestNo = hfRequestNo.Value;
- material.Description = tbxShortDescription.Text.ToUpper().Replace("'", "''");
- materialDA.Material = material;
- materialDA.ValidateCheck();
- if (!materialDA.Message.Text.Equals("SUCCESS"))
- {
- ClientScript.RegisterStartupScript(typeof(Page), "Confirm", "");
- string confirmValue = Request.Form["confirm_value"];
- if (confirmValue == "Yes")
- {
- // event occures
- }
- else
- {
- // do nothing
- }
- }
- return result;
- }
I have used above function in inside the button clicl after the success message come continue our further process if not come success to show the popup with yes/no if click no process is stop click no stop the process.but the above code the script is show after the process is completes how to do it?


Sagar Pandurang KapRank #606 · 4K reputationPosted Jan 24, 2018, 8:24 PM EST
Piyush AgarwalRank #1,377 · 1.2K reputationPosted Mar 8, 2018, 1:50 AM EST