How to call a post function from partial view to api controller in c#

 View JS function:-

DownloadZipFile: function (filePath) {

                    var model = { FilePath: filePath};

                    $app.post('/Admin/DownloadZipFile', model).then(function (response) {

                        if (!response.status) {

                            $app.messageBox.error("File not found");

                        }

                    });

                }


API Controller:-

 public ActionResult DownloadZipFile(TemplateFileModel model)

{

// Code here

}

Share:

How to create temporary datatable and merge in dataset in c#

   //Dummy dataset

                    //DataSet ds = new DataSet();

                    //DataTable dt = new DataTable("MyTable");

                    //dt.Columns.Add("ConferenceId", typeof(string));

                    //dt.Columns.Add("ConversionFilePath", typeof(string));

                    //ds.Tables.Add(dt);

                    //DataRow dr = dt.NewRow();

                    //dr["ConferenceId"] = "A12345";

                    //dr["ConversionFilePath"] = "D:\\PDFeXpress_STORE\\Assets\\ConferenceeXpressdev\\RawPDF\\444FRAWPDFApproved.zip";

                    //dt.Rows.Add(dr);

                    //ds.Merge(dt);

                    //

Share:

Dotnet Tracking

 


Share:

Thursday, 21 October 2021

How to call a post function from partial view to api controller in c#

 View JS function:-

DownloadZipFile: function (filePath) {

                    var model = { FilePath: filePath};

                    $app.post('/Admin/DownloadZipFile', model).then(function (response) {

                        if (!response.status) {

                            $app.messageBox.error("File not found");

                        }

                    });

                }


API Controller:-

 public ActionResult DownloadZipFile(TemplateFileModel model)

{

// Code here

}

How to create temporary datatable and merge in dataset in c#

   //Dummy dataset

                    //DataSet ds = new DataSet();

                    //DataTable dt = new DataTable("MyTable");

                    //dt.Columns.Add("ConferenceId", typeof(string));

                    //dt.Columns.Add("ConversionFilePath", typeof(string));

                    //ds.Tables.Add(dt);

                    //DataRow dr = dt.NewRow();

                    //dr["ConferenceId"] = "A12345";

                    //dr["ConversionFilePath"] = "D:\\PDFeXpress_STORE\\Assets\\ConferenceeXpressdev\\RawPDF\\444FRAWPDFApproved.zip";

                    //dt.Rows.Add(dr);

                    //ds.Merge(dt);

                    //

Popular

Total Pageviews

Archive