I have a public static method and I would like a message to be displayed if certain values are selected. This is in ASP.NET so adding using System.Windows.Forms;
causes problems because I am using using System.Web.UI.WebControls;
. So how do I create a message?
public static void UpdateSerialQtyRcvd(int SerNoID, int QtyRcvd)
{
if (SerNo.QtyRcvd != 1)
{
if (SerNo.Reason == "")
{
//message
}
}
}
Javascript behing the code:
function UpdateSerialQtyRcvd(sender, SerNoID, QtyRcvd) {
if (QtyRcvd < 0) {
alert("Qty Rcvd must be greater than 0");
}
else {
PageMethods.UpdateSerialQtyRcvdUserControl(SerNoID, QtyRcvd, OnUpdateSuccess, OnUpdateFail);
}
}
Calling the web method:
[WebMethod]
public static void UpdateSerialQtyRcvdUserControl(int SerNoID, int QtyRcvd)
{
JobDeliveryDebrief.UpdateSerialQtyRcvd(SerNoID, QtyRcvd);
}