<%@ Page Language="C#" AutoEventWireup="true" CodeFile="hyfrcTest.aspx.cs" Inherits="views_v40_hyfrc_hyfrcTest" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<%
String oldValue = Request.Params["oldValue"];
String encryValue =""; if (oldValue != null)
{
encryValue = com.umpay.api.util.SignUtil.RSAEncrypt(oldValue);
}
%>
</head><body>
<form id="form1" action="hyfrcTest.aspx" runat="server">
<div>
<table>
<tr>
<td>请输入要加密的值:</td>
<td><input type="text" name="oldValue" value="<% =Request.Params["oldValue"]%>"/></td>
</tr>
<tr>
<td>加密后的值:</td>
<td><textarea name="encryValue" cols="5" rows="2"><%= encryValue%> </textarea></td>
</tr>
<tr>
<th nowrap="nowrap"></th>
<td nowrap="nowrap"><div ><input type="submit" value="提交" /></div></td>
</tr>
</table>
</div>
</form>
</body>
</html>“/MerPay30”应用程序中的服务器错误。编译错误说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。 编译器错误消息: CS0103: 当前上下文中不存在名称“encryValue”源错误:
行 29: <tr>
行 30: <td>加密后的值:</td>
行 31: <td><textarea name="encryValue" cols="5" rows="2"><%= encryValue%> </textarea></td>
行 32: </tr>
行 33: <tr>源文件: d:\cworkspace\MerPay40\MerPay30\views\v40\hyfrc\hyfrcTest.aspx 行: 31
显示详细的编译器输出:显示完整的编译源:
<head runat="server">
<title>Untitled Page</title>
<%
String oldValue = Request.Params["oldValue"];
String encryValue =""; if (oldValue != null)
{
encryValue = com.umpay.api.util.SignUtil.RSAEncrypt(oldValue);
}
%>
</head><body>
<form id="form1" action="hyfrcTest.aspx" runat="server">
<div>
<table>
<tr>
<td>请输入要加密的值:</td>
<td><input type="text" name="oldValue" value="<% =Request.Params["oldValue"]%>"/></td>
</tr>
<tr>
<td>加密后的值:</td>
<td><textarea name="encryValue" cols="5" rows="2"><%= encryValue%> </textarea></td>
</tr>
<tr>
<th nowrap="nowrap"></th>
<td nowrap="nowrap"><div ><input type="submit" value="提交" /></div></td>
</tr>
</table>
</div>
</form>
</body>
</html>“/MerPay30”应用程序中的服务器错误。编译错误说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。 编译器错误消息: CS0103: 当前上下文中不存在名称“encryValue”源错误:
行 29: <tr>
行 30: <td>加密后的值:</td>
行 31: <td><textarea name="encryValue" cols="5" rows="2"><%= encryValue%> </textarea></td>
行 32: </tr>
行 33: <tr>源文件: d:\cworkspace\MerPay40\MerPay30\views\v40\hyfrc\hyfrcTest.aspx 行: 31
显示详细的编译器输出:显示完整的编译源:
这样吗?
这样吗?
对,但是我还是建议你采用Code Behind方式,不要把服务端代码也写到aspx上
这样吗?这样完全不行
这样吗?这样完全不行
嗯,<% %>表示代码块,这样确实是不行的,
你还是把这个定义放到aspx.cs里吧
String oldValue = Request.Params["oldValue"];
String encryValue ="";
if (oldValue != null)
{
encryValue = com.umpay.api.util.SignUtil.RSAEncrypt(oldValue);
}
%>
protected void Page_Load(object sender, EventArgs e)
{
name = "ooooo";
}
是可以输出ooooo的我想你肯定是在Load之外对其赋值操作,那么由于页面的解析执行顺序,你的赋值操作将无效
这样吗?这样完全不行
嗯,<% %>表示代码块,这样确实是不行的,
你还是把这个定义放到aspx.cs里吧
谢谢,放到aspx.cs里吧,成功运行!
原来一直做jsp,一直用jsp的方式来写c#~~~~
</script>