diff --git a/ej2-asp-core-mvc/spreadsheet/open-save.md b/ej2-asp-core-mvc/spreadsheet/open-save.md index 867bbebe97..763b1534df 100644 --- a/ej2-asp-core-mvc/spreadsheet/open-save.md +++ b/ej2-asp-core-mvc/spreadsheet/open-save.md @@ -59,18 +59,20 @@ Find the below table for the beforeOpen event arguments. N> * Use `Ctrl + O` keyboard shortcut to open Excel documents.
* The default value of the [allowOpen](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Spreadsheet.Spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_AllowOpen) property is `true`. For demonstration purpose, we have showcased the [allowOpen](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Spreadsheet.Spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_AllowOpen) property in previous code snippet. -### Open an external URL excel file while initial load +### Open an excel file using a file uploader -You can achieve to access the remote excel file by using the [`created`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Spreadsheet.Spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_Created) event. In this event you can fetch the excel file and convert it to a blob. Convert this blob to a file and `open` this file by using Spreadsheet component open method. +If you explore your machine to select and upload an excel document using the file uploader, you will receive the uploaded document as a raw file in the `success` event of the file uploader. In this `success` event, you should pass the received raw file as an argument to the Spreadsheet's `open` method to see the appropriate output. + +The following code example shows how to import an excel document using file uploader in spreadsheet. {% if page.publishingplatform == "aspnet-core" %} {% tabs %} {% highlight cshtml tabtitle="CSHTML" %} -{% include code-snippet/spreadsheet/open-url/tagHelper %} +{% include code-snippet/spreadsheet/open-uploader/tagHelper %} {% endhighlight %} {% highlight c# tabtitle="Opencontroller.cs" %} -{% include code-snippet/spreadsheet/open-url/opencontroller.cs %} +{% include code-snippet/spreadsheet/open-uploader/opencontroller.cs %} {% endhighlight %} {% endtabs %} @@ -78,26 +80,26 @@ You can achieve to access the remote excel file by using the [`created`](https:/ {% tabs %} {% highlight razor tabtitle="CSHTML" %} -{% include code-snippet/spreadsheet/open-url/razor %} +{% include code-snippet/spreadsheet/open-uploader/razor %} {% endhighlight %} {% highlight c# tabtitle="Opencontroller.cs" %} -{% include code-snippet/spreadsheet/open-url/opencontroller.cs %} +{% include code-snippet/spreadsheet/open-uploader/opencontroller.cs %} {% endhighlight %} {% endtabs %} {% endif %} -### To add custom header during open +### Open an external URL excel file while initial load -You can add your own custom header to the open action in the Spreadsheet. For processing the data, it has to be sent from server to client side and adding customer header can provide privacy to the data with the help of Authorization Token. Through the [`beforeOpen`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Spreadsheet.Spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_BeforeOpen) event, the custom header can be added to the request during open action. +You can achieve to access the remote excel file by using the [`created`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Spreadsheet.Spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_Created) event. In this event you can fetch the excel file and convert it to a blob. Convert this blob to a file and `open` this file by using Spreadsheet component open method. {% if page.publishingplatform == "aspnet-core" %} {% tabs %} {% highlight cshtml tabtitle="CSHTML" %} -{% include code-snippet/spreadsheet/open-header/tagHelper %} +{% include code-snippet/spreadsheet/open-url/tagHelper %} {% endhighlight %} {% highlight c# tabtitle="Opencontroller.cs" %} -{% include code-snippet/spreadsheet/open-header/opencontroller.cs %} +{% include code-snippet/spreadsheet/open-url/opencontroller.cs %} {% endhighlight %} {% endtabs %} @@ -105,26 +107,142 @@ You can add your own custom header to the open action in the Spreadsheet. For pr {% tabs %} {% highlight razor tabtitle="CSHTML" %} -{% include code-snippet/spreadsheet/open-header/razor %} +{% include code-snippet/spreadsheet/open-url/razor %} {% endhighlight %} {% highlight c# tabtitle="Opencontroller.cs" %} -{% include code-snippet/spreadsheet/open-header/opencontroller.cs %} +{% include code-snippet/spreadsheet/open-url/opencontroller.cs %} {% endhighlight %} {% endtabs %} {% endif %} -### Open excel file into a read-only mode +### Open an excel file using a hosted web service in AWS Lambda -You can open excel file into a read-only mode by using the [`openComplete`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Spreadsheet.Spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_OpenComplete) event. In this event, you must protect all the sheets and lock its used range cells by using `protectSheet` and `lockCells` methods. +Before proceeding with the opening process, you should deploy the spreadsheet open/save web API service in AWS Lambda. To host the open/save web service in the AWS Lambda environment, please refer to the following KB documentation. + +After deployment, you will get the AWS service URL for the open and save actions. Before opening the Excel file with this hosted open URL, you need to prevent the default file opening process to avoid getting a corrupted file on the open service end. The spreadsheet component appends the file to the `formData` and sends it to the open service, which causes the file to get corrupted. To prevent this, set the `args.cancel` value to `true` in the [`beforeOpen`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Spreadsheet.Spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_BeforeOpen) event. After that, you will get the selected file in the `beforeOpen` event argument. Then, convert this file into a base64 string and send it to the open service URL using a fetch request. + +On the open service end, convert the base64 string back to a file and pass it as an argument to the workbook `Open` method. The open service will process the file and return the spreadsheet data in JSON format. You will then receive this JSON data in the fetch success callback. Finally, use the `openFromJson` method to load this JSON data into the spreadsheet component. + +The following code example shows how to open an Excel file using a hosted web service in AWS Lambda, as mentioned above. + +{% if page.publishingplatform == "aspnet-core" %} + +``` + + + + + +``` + +{% elsif page.publishingplatform == "aspnet-mvc" %} + +``` +@Html.EJS().Spreadsheet("spreadsheet").OpenUrl("https://xxxxxxxxxxxxxxxxxx.amazonaws.com/Prod/api/spreadsheet/open").AllowOpen(true).BeforeOpen("beforeOpen").Render() + + +``` + +{% endif %} + +### Open an excel file from Base64 string data + +In the Syncfusion Spreadsheet component, there is no direct option to open data as a `Base64` string. To achieve this, the `import()` function fetches the `Base64` string, converts it to a Blob, creates a File object from the Blob, and then opens it using the `open` method in the spreadsheet. + +The following code example shows how to open the spreadsheet data as base64 string. {% if page.publishingplatform == "aspnet-core" %} {% tabs %} {% highlight cshtml tabtitle="CSHTML" %} -{% include code-snippet/spreadsheet/open-readonly/tagHelper %} +{% include code-snippet/spreadsheet/base-64-string/tagHelper %} {% endhighlight %} -{% highlight c# tabtitle="Opencontroller.cs" %} -{% include code-snippet/spreadsheet/open-readonly/opencontroller.cs %} +{% highlight c# tabtitle="OpenController.cs" %} +{% include code-snippet/spreadsheet/base-64-string/opencontroller.cs %} {% endhighlight %} {% endtabs %} @@ -132,28 +250,26 @@ You can open excel file into a read-only mode by using the [`openComplete`](http {% tabs %} {% highlight razor tabtitle="CSHTML" %} -{% include code-snippet/spreadsheet/open-readonly/razor %} +{% include code-snippet/spreadsheet/base-64-string/razor %} {% endhighlight %} -{% highlight c# tabtitle="Opencontroller.cs" %} -{% include code-snippet/spreadsheet/open-readonly/opencontroller.cs %} +{% highlight c# tabtitle="OpenController.cs" %} +{% include code-snippet/spreadsheet/base-64-string/opencontroller.cs %} {% endhighlight %} {% endtabs %} {% endif %} -### Open an excel file using a file uploader - -If you explore your machine to select and upload an excel document using the file uploader, you will receive the uploaded document as a raw file in the `success` event of the file uploader. In this `success` event, you should pass the received raw file as an argument to the Spreadsheet's `open` method to see the appropriate output. +### Open excel file into a read-only mode -The following code example shows how to import an excel document using file uploader in spreadsheet. +You can open excel file into a read-only mode by using the [`openComplete`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Spreadsheet.Spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_OpenComplete) event. In this event, you must protect all the sheets and lock its used range cells by using `protectSheet` and `lockCells` methods. {% if page.publishingplatform == "aspnet-core" %} {% tabs %} {% highlight cshtml tabtitle="CSHTML" %} -{% include code-snippet/spreadsheet/open-uploader/tagHelper %} +{% include code-snippet/spreadsheet/open-readonly/tagHelper %} {% endhighlight %} {% highlight c# tabtitle="Opencontroller.cs" %} -{% include code-snippet/spreadsheet/open-uploader/opencontroller.cs %} +{% include code-snippet/spreadsheet/open-readonly/opencontroller.cs %} {% endhighlight %} {% endtabs %} @@ -161,10 +277,10 @@ The following code example shows how to import an excel document using file uplo {% tabs %} {% highlight razor tabtitle="CSHTML" %} -{% include code-snippet/spreadsheet/open-uploader/razor %} +{% include code-snippet/spreadsheet/open-readonly/razor %} {% endhighlight %} {% highlight c# tabtitle="Opencontroller.cs" %} -{% include code-snippet/spreadsheet/open-uploader/opencontroller.cs %} +{% include code-snippet/spreadsheet/open-readonly/opencontroller.cs %} {% endhighlight %} {% endtabs %} {% endif %} @@ -218,20 +334,18 @@ The following code snippet demonstrates how to configure the deserialization opt {% endtabs %} {% endif %} -### Open an excel file from Base64 string data - -In the Syncfusion Spreadsheet component, there is no direct option to open data as a `Base64` string. To achieve this, the `import()` function fetches the `Base64` string, converts it to a Blob, creates a File object from the Blob, and then opens it using the `open` method in the spreadsheet. +### Add custom header during open -The following code example shows how to open the spreadsheet data as base64 string. +You can add your own custom header to the open action in the Spreadsheet. For processing the data, it has to be sent from server to client side and adding customer header can provide privacy to the data with the help of Authorization Token. Through the [`beforeOpen`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Spreadsheet.Spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_BeforeOpen) event, the custom header can be added to the request during open action. {% if page.publishingplatform == "aspnet-core" %} {% tabs %} {% highlight cshtml tabtitle="CSHTML" %} -{% include code-snippet/spreadsheet/base-64-string/tagHelper %} +{% include code-snippet/spreadsheet/open-header/tagHelper %} {% endhighlight %} -{% highlight c# tabtitle="OpenController.cs" %} -{% include code-snippet/spreadsheet/base-64-string/opencontroller.cs %} +{% highlight c# tabtitle="Opencontroller.cs" %} +{% include code-snippet/spreadsheet/open-header/opencontroller.cs %} {% endhighlight %} {% endtabs %} @@ -239,10 +353,10 @@ The following code example shows how to open the spreadsheet data as base64 stri {% tabs %} {% highlight razor tabtitle="CSHTML" %} -{% include code-snippet/spreadsheet/base-64-string/razor %} +{% include code-snippet/spreadsheet/open-header/razor %} {% endhighlight %} -{% highlight c# tabtitle="OpenController.cs" %} -{% include code-snippet/spreadsheet/base-64-string/opencontroller.cs %} +{% highlight c# tabtitle="Opencontroller.cs" %} +{% include code-snippet/spreadsheet/open-header/opencontroller.cs %} {% endhighlight %} {% endtabs %} {% endif %} @@ -401,45 +515,85 @@ N> * Use `Ctrl + S` keyboard shortcut to save the Spreadsheet data as Excel file
* The default value of [allowSave](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Spreadsheet.Spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_AllowSave) property is `true`. For demonstration purpose, we have showcased the [allowSave](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Spreadsheet.Spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_AllowSave) property in previous code snippet.
* Demo purpose only, we have used the online web service url link. -### To send and receive custom params from client to server +### Save an excel file using a hosted web service in AWS Lambda -Passing the custom parameters from client to server by using [`beforeSave`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Spreadsheet.Spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_BeforeSave) event. +Before proceeding with the save process, you should deploy the spreadsheet open/save web API service in AWS Lambda. To host the open/save web service in the AWS Lambda environment, please refer to the following KB documentation. -{% if page.publishingplatform == "aspnet-core" %} - -{% tabs %} -{% highlight cshtml tabtitle="CSHTML" %} -{% include code-snippet/spreadsheet/custom-params/tagHelper %} -{% endhighlight %} -{% highlight c# tabtitle="CustomParamsController.cs" %} -{% include code-snippet/spreadsheet/custom-params/customParamsController.cs %} -{% endhighlight %} -{% endtabs %} - -{% elsif page.publishingplatform == "aspnet-mvc" %} - -{% tabs %} -{% highlight razor tabtitle="CSHTML" %} -{% include code-snippet/spreadsheet/custom-params/razor %} -{% endhighlight %} -{% highlight c# tabtitle="CustomParamsController.cs" %} -{% include code-snippet/spreadsheet/custom-params/customParamsController.cs %} -{% endhighlight %} -{% endtabs %} -{% endif %} +After deployment, you will get the AWS service URL for the open and save actions. Before saving the Excel file with this hosted save URL, you need to prevent the default save action to avoid getting a corrupted excel file on the client end. The save service returns the file stream as a result to the client, which can cause the file to become corrupted. To prevent this, set the `args.cancel` value to `true` in the [`beforeSave`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Spreadsheet.Spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_BeforeSave) event. After that, convert the spreadsheet data into JSON format using the `saveAsJson` method in the `beforeSave` event and send it to the save service endpoint URL using a fetch request. -### To add custom header during save +On the server side, the save service will take the received JSON data, pass it to the workbook `Save` method, and return the result as a base64 string. The fetch success callback will receive the Excel file in base64 string format on the client side. Finally, you can then convert the base64 string back to a file on the client end to obtain a non-corrupted Excel file. -You can add your own custom header to the save action in the Spreadsheet. For processing the data, it has to be sent from client to server side and adding customer header can provide privacy to the data with the help of Authorization Token. Through the [`fileMenuItemSelect`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Spreadsheet.Spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_FileMenuItemSelect) event, the custom header can be added to the request during save action. +The following code example shows how to save an Excel file using a hosted web service in AWS Lambda, as mentioned above. {% if page.publishingplatform == "aspnet-core" %} {% tabs %} {% highlight cshtml tabtitle="CSHTML" %} -{% include code-snippet/spreadsheet/save-header/tagHelper %} -{% endhighlight %} -{% highlight c# tabtitle="CustomHeaderController.cs" %} -{% include code-snippet/spreadsheet/save-header/CustomHeaderController.cs %} + +``` + + + + + +``` + {% endhighlight %} {% endtabs %} @@ -447,31 +601,90 @@ You can add your own custom header to the save action in the Spreadsheet. For pr {% tabs %} {% highlight razor tabtitle="CSHTML" %} -{% include code-snippet/spreadsheet/save-header/razor %} -{% endhighlight %} -{% highlight c# tabtitle="CustomHeaderController.cs" %} -{% include code-snippet/spreadsheet/save-header/CustomHeaderController.cs %} + +``` +@Html.EJS().Spreadsheet("spreadsheet").SaveUrl("https://xxxxxxxxxxxxxxxxxxxxxxxxx.amazonaws.com/Prod/api/spreadsheet/save").AllowSave(true).BeforeSave("beforeSave").Render() + + +``` + {% endhighlight %} + {% endtabs %} {% endif %} -### To change the PDF orientation +### Save data as a Base64 string -By default, the PDF document is created in **Portrait** orientation. You can change the orientation of the PDF document by using the `args.pdfLayoutSettings.orientation` argument settings in the [`beforeSave`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Spreadsheet.Spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_BeforeSave) event. +In the Spreadsheet control, there is currently no direct option to save data as a `Base64` string. You can achieve this by saving the Spreadsheet data as blob data and then converting that saved blob data to a `Base64` string using `FileReader`. -The possible values are: +> You can get the Spreadsheet data as blob in the [saveComplete](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.spreadsheet.spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_SaveComplete) event when you set the `needBlobData` as **true** and `isFullPost` as **false** in the [beforeSave](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.spreadsheet.spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_BeforeSave) event. -* **Portrait** - Used to display content in a vertical layout. -* **Landscape** - Used to display content in a horizontal layout. +The following code example shows how to save the spreadsheet data as base64 string. {% if page.publishingplatform == "aspnet-core" %} {% tabs %} {% highlight cshtml tabtitle="CSHTML" %} -{% include code-snippet/spreadsheet/pdf-orientation/tagHelper %} +{% include code-snippet/spreadsheet/base-64-string/tagHelper %} {% endhighlight %} -{% highlight c# tabtitle="pdfOrientationController.cs" %} -{% include code-snippet/spreadsheet/pdf-orientation/pdfOrientationController.cs %} +{% highlight c# tabtitle="OpenController.cs" %} +{% include code-snippet/spreadsheet/base-64-string/opencontroller.cs %} {% endhighlight %} {% endtabs %} @@ -479,10 +692,10 @@ The possible values are: {% tabs %} {% highlight razor tabtitle="CSHTML" %} -{% include code-snippet/spreadsheet/pdf-orientation/razor %} +{% include code-snippet/spreadsheet/base-64-string/razor %} {% endhighlight %} -{% highlight c# tabtitle="pdfOrientationController.cs" %} -{% include code-snippet/spreadsheet/pdf-orientation/pdfOrientationController.cs %} +{% highlight c# tabtitle="OpenController.cs" %} +{% include code-snippet/spreadsheet/base-64-string/opencontroller.cs %} {% endhighlight %} {% endtabs %} {% endif %} @@ -536,22 +749,45 @@ The following code snippet demonstrates how to configure the serialization optio {% endtabs %} {% endif %} -### To save data as a Base64 string +### Send and receive custom params from client to server -In the Spreadsheet control, there is currently no direct option to save data as a `Base64` string. You can achieve this by saving the Spreadsheet data as blob data and then converting that saved blob data to a `Base64` string using `FileReader`. +Passing the custom parameters from client to server by using [`beforeSave`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Spreadsheet.Spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_BeforeSave) event. -> You can get the Spreadsheet data as blob in the [saveComplete](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.spreadsheet.spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_SaveComplete) event when you set the `needBlobData` as **true** and `isFullPost` as **false** in the [beforeSave](https://help.syncfusion.com/cr/aspnetcore-js2/syncfusion.ej2.spreadsheet.spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_BeforeSave) event. +{% if page.publishingplatform == "aspnet-core" %} -The following code example shows how to save the spreadsheet data as base64 string. +{% tabs %} +{% highlight cshtml tabtitle="CSHTML" %} +{% include code-snippet/spreadsheet/custom-params/tagHelper %} +{% endhighlight %} +{% highlight c# tabtitle="CustomParamsController.cs" %} +{% include code-snippet/spreadsheet/custom-params/customParamsController.cs %} +{% endhighlight %} +{% endtabs %} + +{% elsif page.publishingplatform == "aspnet-mvc" %} + +{% tabs %} +{% highlight razor tabtitle="CSHTML" %} +{% include code-snippet/spreadsheet/custom-params/razor %} +{% endhighlight %} +{% highlight c# tabtitle="CustomParamsController.cs" %} +{% include code-snippet/spreadsheet/custom-params/customParamsController.cs %} +{% endhighlight %} +{% endtabs %} +{% endif %} + +### Add custom header during save + +You can add your own custom header to the save action in the Spreadsheet. For processing the data, it has to be sent from client to server side and adding customer header can provide privacy to the data with the help of Authorization Token. Through the [`fileMenuItemSelect`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Spreadsheet.Spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_FileMenuItemSelect) event, the custom header can be added to the request during save action. {% if page.publishingplatform == "aspnet-core" %} {% tabs %} {% highlight cshtml tabtitle="CSHTML" %} -{% include code-snippet/spreadsheet/base-64-string/tagHelper %} +{% include code-snippet/spreadsheet/save-header/tagHelper %} {% endhighlight %} -{% highlight c# tabtitle="OpenController.cs" %} -{% include code-snippet/spreadsheet/base-64-string/opencontroller.cs %} +{% highlight c# tabtitle="CustomHeaderController.cs" %} +{% include code-snippet/spreadsheet/save-header/CustomHeaderController.cs %} {% endhighlight %} {% endtabs %} @@ -559,10 +795,42 @@ The following code example shows how to save the spreadsheet data as base64 stri {% tabs %} {% highlight razor tabtitle="CSHTML" %} -{% include code-snippet/spreadsheet/base-64-string/razor %} +{% include code-snippet/spreadsheet/save-header/razor %} {% endhighlight %} -{% highlight c# tabtitle="OpenController.cs" %} -{% include code-snippet/spreadsheet/base-64-string/opencontroller.cs %} +{% highlight c# tabtitle="CustomHeaderController.cs" %} +{% include code-snippet/spreadsheet/save-header/CustomHeaderController.cs %} +{% endhighlight %} +{% endtabs %} +{% endif %} + +### Change the PDF orientation + +By default, the PDF document is created in **Portrait** orientation. You can change the orientation of the PDF document by using the `args.pdfLayoutSettings.orientation` argument settings in the [`beforeSave`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.Spreadsheet.Spreadsheet.html#Syncfusion_EJ2_Spreadsheet_Spreadsheet_BeforeSave) event. + +The possible values are: + +* **Portrait** - Used to display content in a vertical layout. +* **Landscape** - Used to display content in a horizontal layout. + +{% if page.publishingplatform == "aspnet-core" %} + +{% tabs %} +{% highlight cshtml tabtitle="CSHTML" %} +{% include code-snippet/spreadsheet/pdf-orientation/tagHelper %} +{% endhighlight %} +{% highlight c# tabtitle="pdfOrientationController.cs" %} +{% include code-snippet/spreadsheet/pdf-orientation/pdfOrientationController.cs %} +{% endhighlight %} +{% endtabs %} + +{% elsif page.publishingplatform == "aspnet-mvc" %} + +{% tabs %} +{% highlight razor tabtitle="CSHTML" %} +{% include code-snippet/spreadsheet/pdf-orientation/razor %} +{% endhighlight %} +{% highlight c# tabtitle="pdfOrientationController.cs" %} +{% include code-snippet/spreadsheet/pdf-orientation/pdfOrientationController.cs %} {% endhighlight %} {% endtabs %} {% endif %}