Hi,
I have a javascript function (see below) that fires perform insert command for a data form. I am trying to pass the command argument of the button clicked to the ItemCommand event handler but somehow e.CommandArgument.ToString() tunrs out to be an empty string. Can anyone please guide me as to what i am doing wrong?
aspx:
function callSaveAll(sender,args) {
var object2 = $find("<%= OrderItemDataForm.ClientID%>");
if (object2._isItemInserted)
object2.fireCommand("PerformInsert", args._commandArgument);
}
.cs code:
protected void OrderItemDataForm_ItemCommand(object sender, RadDataFormCommandEventArgs e){
if (e.CommandName == "Cancel")
ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CancelEdit();", true);
if (e.CommandName == "PerformInsert")
{
if (Page.IsValid)
{
if (e.CommandArgument.ToString() == "SaveNew")
{
saveAndNewButtonClicked = true;
}
else if (e.CommandArgument.ToString() == "Save")
{
saveAndNewButtonClicked = false;
}
}
}
}