colNames: [ 'ClientID' , 'Document Type' , 'Document Description' , 'View/Upload documents' ],
colModel: [
{
name: 'DocumentType' , index: 'DocumentType' , width: 30, editable: true ,
edittype: 'select' , editoptions: { value: ClientDocumentType }
},
name: 'DocumentName' , index: 'DocumentName' , width: 30, editable: true ,
edittype: 'file' , editoptions: {
enctype: "multipart/form-data"
},
formatter: 'showlink' ,
formatoptions: { baseLinkUrl: 'javascript:' , showAction: "ShowFile('" , addParam: "');" }
}
],
});
{
edit: true ,
add: true ,
del: true ,
search: false ,
refresh: true
},
//Edit functionality
{
},
//Add functionality
{
url: 'ClientMaster.aspx/InsertDocumentDetails' ,
closeAfterAdd: true ,
reloadAfterSubmit: false ,
closeAfterAdd: true ,
afterSubmit: function (options, postData, response) {
var filename = $( "#DocumentName" ).val();
var files = $( "#DocumentName" ).val();
$.fn.ajaxFileUpload
(
{
url: 'ClientMaster.aspx/InsertDocumentDetails' ,
secureuri: false ,
fileElementId: 'DocumentName' ,
dataType: 'json' ,
async: false ,
success: function (data, status) {
if ( typeof (data.error) != 'undefined' ) {
if (data.error != '' ) {
alert(data.error);
} else {
alert(data.msg);
}
}
},
error: function (data, status, e) {
debugger ;
alert(e);
}
}
);
return [ true , '' , false ];
}
},
//Delete functionality
{
}
});
}
//////////////////////////////////////////////////////
This is my web method which is not getting called:
[WebMethod]
public static void InsertDocumentDetails(
HttpPostedFileBase files
)
{
}
Please hot to call web method to upload file in database.