How to pass simple variable created in Asp.Net to Extjs? Lets say a variable in aspx.cs :
public string Name = "ASP.Net";
How to connect it with Extjs, let say a :
Ext.create("Ext.panel.Panel",{
width:100,
width:100,
title: <%=Name %>
});
If I understand your problem correct you have a .aspx page where you include a .js file that contains your javascript code?
You can’t use server tags (
<%...%>). There are, however, a few things you can do. The easiest is probably to define a javascript variable in your .aspx page and set the value from your server side variable. Then use that variable in your javascript. You can do that in this way:*.aspx.cs code:
*.aspx code:
*.js code:
Make sure that you define the javascript variable before the .js file is included.