How does the C # background computed value be assigned to the foreground
First defined in the background, example: public int ID, (to protected void Page_Load (object sender, EventArgs e),
You can then start the value in protected void Page_Load (object sender, EventArgs e) or get the value of the foreground input
Finally in the foreground JS var id= "<%=id%>";
- This is the value of the pass variable name.
- In HTML JS
- var srcurl = <%=getUrl%>;
- var srcurl = <%=getUrl%>;
- In the CS class file
- Public static string getUrl = "url";
- Public static string getUrl = URL;
- If you want to pass the value of a method
- In HTML JS
- var srcurl = <%=geturl ()%>;
- var srcurl = <%=geturl ()%>;
- C # code public static string GetUrl ()
- { return "returned value"; }
- Public static string GetUrl () {return value;}
How. NET passes the value of a variable to the foreground JS in the background