ASP.NET Web繝輔か繝シ繝 螟画焚縺ョ蜿悶j謇ア縺譁ケ豕
窶サス.aspx.cs
public partial class MyForm : System.Web.UI.Page
{
縲// 繝「繧ク繝・繝シ繝ォ螟画焚
縲protected const string CONST_myValue = @"繧オ繝シ繝舌シ螟画焚1";
縲protected string mMyStr = @"繧オ繝シ繝舌シ螟画焚2";
縲protected void Page_Load(object sender, EventArgs e)
縲{
縲縲// 繧サ繝繧キ繝ァ繝ウ螟画焚
縲縲Page.Session["value"] = "繧サ繝繧キ繝ァ繝ウ螟画焚";
縲縲窶サ縲ASP.NET Web繝輔か繝シ繝 邨縺ソ霎シ縺ソ繧ェ繝悶ず繧ァ繧ッ繝縲榊盾辣ァ
縲}
}
窶サス.aspx
<%@ Page
縲Language="C#"
縲AutoEventWireup="true"
縲CodeBehind="ス.aspx.cs"
縲Inherits="ス.ス" %>
縲窶サ縲ASP.NET Web繝輔か繝シ繝 Page繝繧」繝ャ繧ッ繝繧」繝縲榊盾辣ァ
窶サASPX繝輔ぃ繧、繝ォ荳翫〒C#/VB縺ョ雉貅舌r謇ア縺蝣エ蜷医ッ<%ス%>縺ァ蝗イ繧
<%
縲// 繝ュ繝シ繧ォ繝ォ螟画焚
縲string myValue = "繝ュ繝シ繧ォ繝ォ螟画焚";縲
%>
<%=myValue %>
竊 繝ュ繝シ繧ォ繝ォ螟画焚
<%=CONST_myValue %>
竊 繧オ繝シ繝舌シ螟画焚1
<%=Session["value"] %>
竊 繧サ繝繧キ繝ァ繝ウ螟画焚
蝓九a霎シ縺ソ
<asp:Button ID="MyButton"
縲runat="server" Text="<%=myValue %>">
<script type="text/javascript">
縲var str = "<%=this.mMyStr%>";
縲竊 繧オ繝シ繝舌シ螟画焚2
</script>