回我有一個簡單的頁面,按照以下:ASP.net後面的代碼,並從C#
Default.aspx的
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<html>
<body>
<form method="POST" action="Default.aspx">
Enter Number: <input type="text" name="cNum" value="7707744436276244" /><br />
<input type="submit" value="Submit" />
</form>
</body>
</html>
和後面的代碼Default.aspx.cs
using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
public string ServerSideVariable;
protected void Page_Load(object sender, EventArgs e)
{
string n = String.Format("{0}", Request.Form['cNum']); ERROR Here<--- too many character in character literall....
string pval = "Passed value";
ServerSideVariable = pval;
}
}
爲什麼發生錯誤?
另外我打算在後面的代碼中實現與數據庫連接並將響應返回給ASP.net,任何人都知道這是如何完成的?
任何人都知道如何將C#(後面的代碼)的值從ASP.net(或向上病房)傳遞回來,只是簡單地在asp.net中引用var?還是頂部的XML文件需要將其拉出? – codejunkie 2012-02-02 18:50:54
ADO。淨沒有做oracle PL/SQL – codejunkie 2012-02-02 20:32:25