How can I display a messagebox in ASP.NET?

前端 未结 13 2151
死守一世寂寞
死守一世寂寞 2020-11-30 11:30

I want to show a message box on the successful save of any item. I googled it and tried different solutions, but none of them worked. Here is the code I am using:

         


        
13条回答
  •  感动是毒
    2020-11-30 11:56

    This code will help you add a MsgBox in your asp.net file. You can change the function definition to your requirements. Hope this helps!

    protected void Addstaff_Click(object sender, EventArgs e)    
        {   
     if (intClassCapcity < intCurrentstaffNumber)     
                    {                  
                MsgBox("Record cannot be added because max seats available for the " + (string)Session["course_name"] + " training has been reached");    
            }    
    else    
        {   
                sqlClassList.Insert();    
        }    
    }
    
    private void MsgBox(string sMessage)    
        {    
            string msg = "";    
            Response.Write(msg);    
        }
    

提交回复
热议问题