Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
143807 | Apr 5,2019 11:49 AM UTC | Apr 9,2019 01:31 PM UTC | ASP.NET Core | 3 |
![]() |
Tags: Signature |
@{
ViewData["Title"] = "Signature";
}
<h3>Sign here</h3>
<div class="frame">
<ej-signature id="mysign" height="400px" width="500" stroke-width="3" is-responsive="true" />
<input id="btnUpload" type="button" value="UploaddatatoDB" onclick="Uploaddata()" />
</div>
<script>
function Uploaddata() {
var target1 = $("#mysign").ejSignature("instance")._canvas[0].toDataURL()
var div = $("#mysign");
var canvas = div["children"]()[0];
image = canvas.toDataURL("image/png");
newimage = image.replace('data:image/png;base64,', '');
$.ajax({
type: 'POST',
url: '@Url.Action("Upload", "Home")',
data: {
target: newimage
},
success: function (data) {
alert("success" );
}
});
}
</script>
|
public class SignatureTask
{
public string DataValue { get; set; }
public string SaveValueObject { get; set; }
} |
[HttpPost]
public IActionResult Upload(string target)
{
SignatureTask obj = new SignatureTask();
// Saving the signature value in model object
obj.SaveValueObject = target;
return View();
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.