ASP.Net/Request/Variables Passing
Версия от 15:30, 26 мая 2010; (обсуждение)
Pass varaible between pages (C#)
<%@ Page Language="c#" %>
<html>
<body>
<%;
string Name = "Sniff";
string Age = "23";
%>
<a href="birthday2.aspx?name=<% Response.Write(Name); %>&age=<%
Response.Write(Age); %>">Click here</a>
</body>
</html>
<%--
<%@ Page Language="c#" %>
<html>
<body>
<center>
<%
string Name = Request.QueryString["Name"];
string Age = Request.QueryString["Age"];
%>
<h1>Happy Birthday <% Response.Write(Name); %></h1>
<h3>May the next
<% Response.Write(Age); %>
years be as good!</h3>
</center>
</body>
</html>
--%>