Click here to Skip to main content
15,885,097 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Question[Solved] Retrieve Session Array variable to Array variable in Class Library Project Pin
Member 1115418813-Nov-19 0:00
Member 1115418813-Nov-19 0:00 
AnswerRe: Retrieve Session Array variable to Array variable in Class Library Project Pin
Richard Deeming13-Nov-19 2:15
mveRichard Deeming13-Nov-19 2:15 
GeneralRe: Retrieve Session Array variable to Array variable in Class Library Project Pin
Member 1115418813-Nov-19 2:48
Member 1115418813-Nov-19 2:48 
GeneralRe: Retrieve Session Array variable to Array variable in Class Library Project Pin
Richard Deeming13-Nov-19 3:36
mveRichard Deeming13-Nov-19 3:36 
GeneralRe: Retrieve Session Array variable to Array variable in Class Library Project Pin
Member 1115418813-Nov-19 4:58
Member 1115418813-Nov-19 4:58 
Questionwhat is major difference between blazor server app and asp.net mvc razor app? Pin
Nitin S11-Nov-19 18:10
professionalNitin S11-Nov-19 18:10 
AnswerRe: what is major difference between blazor server app and asp.net mvc razor app? Pin
Mycroft Holmes11-Nov-19 20:20
professionalMycroft Holmes11-Nov-19 20:20 
GeneralRe: what is major difference between blazor server app and asp.net mvc razor app? Pin
Nitin S11-Nov-19 22:04
professionalNitin S11-Nov-19 22:04 
GeneralRe: what is major difference between blazor server app and asp.net mvc razor app? Pin
jkirkerx13-Nov-19 9:56
professionaljkirkerx13-Nov-19 9:56 
Questiongridview with dynamic dropdownlist control null exception Pin
Anand Solomon11-Nov-19 4:41
Anand Solomon11-Nov-19 4:41 
Questionvideo calling in asp.net Pin
Member 146439065-Nov-19 18:37
Member 146439065-Nov-19 18:37 
AnswerRe: video calling in asp.net Pin
F-ES Sitecore6-Nov-19 1:04
professionalF-ES Sitecore6-Nov-19 1:04 
AnswerRe: video calling in asp.net Pin
Blikkies6-Nov-19 1:28
professionalBlikkies6-Nov-19 1:28 
Questioni want show page numbers in bottom of the page like <1 2 3 4 5.......10 11 12> but it shows <1 2 3 4 5 6 to total> Pin
Member 134445211-Nov-19 20:17
Member 134445211-Nov-19 20:17 
AnswerRe: i want show page numbers in bottom of the page like <1 2 3 4 5.......10 11 12> but it shows <1 2 3 4 5 6 to total> Pin
Richard Deeming3-Nov-19 22:33
mveRichard Deeming3-Nov-19 22:33 
QuestionASP.Net Core Identity Pin
Mycroft Holmes28-Oct-19 13:11
professionalMycroft Holmes28-Oct-19 13:11 
AnswerRe: ASP.Net Core Identity Pin
jkirkerx30-Oct-19 13:10
professionaljkirkerx30-Oct-19 13:10 
GeneralRe: ASP.Net Core Identity Pin
Mycroft Holmes31-Oct-19 11:13
professionalMycroft Holmes31-Oct-19 11:13 
GeneralRe: ASP.Net Core Identity Pin
jkirkerx1-Nov-19 12:23
professionaljkirkerx1-Nov-19 12:23 
QuestionImporting Rows Into a List Pin
ibrahimayhans28-Oct-19 0:37
ibrahimayhans28-Oct-19 0:37 
QuestionASP maker 2018 Pin
Member 1292025327-Oct-19 11:23
Member 1292025327-Oct-19 11:23 
AnswerRe: ASP maker 2018 Pin
Richard MacCutchan27-Oct-19 22:19
mveRichard MacCutchan27-Oct-19 22:19 
QuestionDraw Shape in Canvas Pin
John_Ryder26-Oct-19 1:58
John_Ryder26-Oct-19 1:58 
AnswerRe: Draw Shape in Canvas Pin
Afzaal Ahmad Zeeshan26-Oct-19 9:19
professionalAfzaal Ahmad Zeeshan26-Oct-19 9:19 
Quote:
I need to generate shape on server side than return it back to canvas as I callback result.
Then that means that you process and return the result from the server, and have the client-side JavaScript render it. One of the way we can do that would be to remove the hardcoded values,
JavaScript
context.fillRect(30, 30, 70, 90);
Becomes,
JavaScript
let points = [ 30, 30, 70, 90 ];
context.fillRect(points[0], points[1], points[2], points[3]);
That is definitely one of the ways in which this can be done. Once you reach this point, you can see that this same array can be returned from a server. You can use jQuery's Ajax and request the content from the server,
JavaScript
$.ajax({
   url: '/points-generator',
   success: function(data) {
       // Assuming data is an array
       context.fillRect(data[0], data[1], data[2], data[3]);
   }
});
This assumes that you change your context variable to be a global variable so that it can be accessed from almost every function. Then, you can request the data from server using Ajax, and then render the data.

Read more on the MDN documentation for context and study the parameter-lists, and then generate the proper responses for your requests.

CanvasRenderingContext2D - Web APIs | MDN
jQuery.ajax() | jQuery API Documentation
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~

GeneralRe: Draw Shape in Canvas Pin
John_Ryder29-Oct-19 19:49
John_Ryder29-Oct-19 19:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.