Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. .cs file:
  2. public class xxModel:PageModel {
  3. ...
  4. public string UploadImage(string imageName) {
  5. var image = elseware.GetImage(imageName);
  6. string newPath = saveImage(image);
  7. return newPath;
  8. }
  9. }
  10.  
  11. .cshtml file:
  12.  
  13. var pollForImage = function (imageName) {
  14. var imagePath = @Model.UploadImage(imageName); //<== this is where it
  15. // fails.. I cannot get
  16. // the call to work with
  17. // a parameter..
  18. $("#image").attr("src", imagePath);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement