<% @ page language="c#" %>
<script language="c#" runat="server">
public void button(Object sender,CommandEvenArgs e){
string action1=e.CommandName;
string action2=e.CommandArgument.ToString();
nns.Text="您的动作是"+action1+"动作对象是"+action2;
}
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head><body>
<form runat="server">
<asp:Button id="button1" CommandName="踢" CommandArgument="足球" Text="动作1" runat="server" OnCommand="button" />
<asp:Button id="button2" CommandName="打" CommandArgument="篮球" Text="动作2" runat="server" OnCommand="button" />
<asp:Label id="nns" runat="server" />
</form>
</body>
</html>
==============================
错误信息是:
========================
Server Error in '/nns' Application.
--------------------------------------------------------------------------------Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0246: The type or namespace name 'CommandEvenArgs' could not be found (are you missing a using directive or an assembly reference?)Source Error: Line 1: <% @ page language="c#" %>
Line 2: <script language="c#" runat="server">
Line 3: public void button(Object sender,CommandEvenArgs e){
Line 4: string action1=e.CommandName;
Line 5: string action2=e.CommandArgument.ToString();
Source File: g:\aspnet\samples\button2.aspx Line: 3 Show Detailed Compiler Output:
d:\windows\system32\inetsrv> "D:\WINDOWS\Microsoft.NET\Framework\v2.0.40607\csc.exe" /t:library /utf8output /R:"D:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.3600.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"D:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.3600.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"D:\WINDOWS\Microsoft.NET\Framework\v2.0.40607\mscorlib.dll" /R:"D:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.3600.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"D:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.3600.0__b77a5c561934e089\System.Xml.dll" /R:"D:\WINDOWS\assembly\GAC_32\System.Data\2.0.3600.0__b77a5c561934e089\System.Data.dll" /R:"D:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.3600.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"D:\WINDOWS\assembly\GAC_MSIL\System.Web\2.0.3600.0__b03f5f7f11d50a3a\System.Web.dll" /R:"D:\WINDOWS\assembly\GAC_MSIL\System\2.0.3600.0__b77a5c561934e089\System.dll" /out:"D:\WINDOWS\Microsoft.NET\Framework\v2.0.40607\Temporary ASP.NET Files\nns\1d542f7b\5b2ff2b9\xsdijgao.dll" /D:DEBUG /debug+ /optimize- /warnaserror /w:1 /nowarn:1659 "D:\WINDOWS\Microsoft.NET\Framework\v2.0.40607\Temporary ASP.NET Files\nns\1d542f7b\5b2ff2b9\xsdijgao.0.cs" "D:\WINDOWS\Microsoft.NET\Framework\v2.0.40607\Temporary ASP.NET Files\nns\1d542f7b\5b2ff2b9\xsdijgao.1.cs"
Microsoft (R) Visual C# .NET Compiler version 8.00.40607.42
for Microsoft (R) Windows (R) .NET Framework version 2.0.40607
Copyright (C) Microsoft Corporation 2001-2003. All rights reserved.g:\aspnet\samples\button2.aspx(3,34): error CS0246: The type or namespace name 'CommandEvenArgs' could not be found (are you missing a using directive or an assembly reference?) Show Complete Compilation Source:
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.40607.42; ASP.NET Version:2.0.40607.42
<script language="c#" runat="server">
public void button(Object sender,CommandEvenArgs e){
string action1=e.CommandName;
string action2=e.CommandArgument.ToString();
nns.Text="您的动作是"+action1+"动作对象是"+action2;
}
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head><body>
<form runat="server">
<asp:Button id="button1" CommandName="踢" CommandArgument="足球" Text="动作1" runat="server" OnCommand="button" />
<asp:Button id="button2" CommandName="打" CommandArgument="篮球" Text="动作2" runat="server" OnCommand="button" />
<asp:Label id="nns" runat="server" />
</form>
</body>
</html>
==============================
错误信息是:
========================
Server Error in '/nns' Application.
--------------------------------------------------------------------------------Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0246: The type or namespace name 'CommandEvenArgs' could not be found (are you missing a using directive or an assembly reference?)Source Error: Line 1: <% @ page language="c#" %>
Line 2: <script language="c#" runat="server">
Line 3: public void button(Object sender,CommandEvenArgs e){
Line 4: string action1=e.CommandName;
Line 5: string action2=e.CommandArgument.ToString();
Source File: g:\aspnet\samples\button2.aspx Line: 3 Show Detailed Compiler Output:
d:\windows\system32\inetsrv> "D:\WINDOWS\Microsoft.NET\Framework\v2.0.40607\csc.exe" /t:library /utf8output /R:"D:\WINDOWS\assembly\GAC_MSIL\System.Drawing\2.0.3600.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"D:\WINDOWS\assembly\GAC_MSIL\System.Web.Services\2.0.3600.0__b03f5f7f11d50a3a\System.Web.Services.dll" /R:"D:\WINDOWS\Microsoft.NET\Framework\v2.0.40607\mscorlib.dll" /R:"D:\WINDOWS\assembly\GAC_MSIL\System.Web.Mobile\2.0.3600.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"D:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.3600.0__b77a5c561934e089\System.Xml.dll" /R:"D:\WINDOWS\assembly\GAC_32\System.Data\2.0.3600.0__b77a5c561934e089\System.Data.dll" /R:"D:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.3600.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll" /R:"D:\WINDOWS\assembly\GAC_MSIL\System.Web\2.0.3600.0__b03f5f7f11d50a3a\System.Web.dll" /R:"D:\WINDOWS\assembly\GAC_MSIL\System\2.0.3600.0__b77a5c561934e089\System.dll" /out:"D:\WINDOWS\Microsoft.NET\Framework\v2.0.40607\Temporary ASP.NET Files\nns\1d542f7b\5b2ff2b9\xsdijgao.dll" /D:DEBUG /debug+ /optimize- /warnaserror /w:1 /nowarn:1659 "D:\WINDOWS\Microsoft.NET\Framework\v2.0.40607\Temporary ASP.NET Files\nns\1d542f7b\5b2ff2b9\xsdijgao.0.cs" "D:\WINDOWS\Microsoft.NET\Framework\v2.0.40607\Temporary ASP.NET Files\nns\1d542f7b\5b2ff2b9\xsdijgao.1.cs"
Microsoft (R) Visual C# .NET Compiler version 8.00.40607.42
for Microsoft (R) Windows (R) .NET Framework version 2.0.40607
Copyright (C) Microsoft Corporation 2001-2003. All rights reserved.g:\aspnet\samples\button2.aspx(3,34): error CS0246: The type or namespace name 'CommandEvenArgs' could not be found (are you missing a using directive or an assembly reference?) Show Complete Compilation Source:
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.40607.42; ASP.NET Version:2.0.40607.42
解决方案 »
- 轻博客怎么设计?
- ASP.NET图片二进制存入数据库并取出显示
- 如何让textbox只能输入汉字
- 很急的问题!!
- 要将这样的代码 当字符串存入SQL数据库,具体说应该是 所有代码 有没通用的 转义类给个,或者说应该要转义哪些字符,给列出来。
- 什么叫工厂模式?
- 两个listbox 点按钮 左边移出 右边加入 最好客户端代码实现 不要刷新
- 概念问题:关于writer.AddAttribute(HtmlTextWriterAttribute.Style,pageStyle)
- 各位高手请帮忙!比较棘手的问题!请一定要看看,在先等待
- mvc如何在url末尾加反斜杠
- 怎样实现像控件树那样的图片导航栏,谢谢
- 怎样用asp.net和c#实现定时备份数据库(SQL Server2000)
改成public void button(Object sender, System.EvenArgs e)
应该是EventArgs
Line 2: <script language="c#" runat="server">
Line 3: public void button(Object sender, System.EvenArgs e){
Line 4: string action1=e.CommandName;
Line 5: string action2=e.CommandArgument.ToString();
还不可以阿。还是那个错误
少t
EventArgs
<script language="c#" runat="server">public void doupload(Object src,EventArgs e){
int num=Request.Files.Count;
char[] aa={'\\'};
string dirfilename;
string[] strfilename;
for(int i=0;i<num;i++){
HttpPostedFile htf=Request.Files[i];
strfilename=htf.FileName.Split(aa);
dirfilename=strfilename[strfilename.Length-1];
htf.SaveAs(Server.MapPath(".")+"\\"+dirfilename);
Addpanelcontrols(dirfilename);
}
}
public void Addpanelcontrols(string filename){
Label lblshow=new Label();
lblshow.Text=filename+"上传成功";
Panel1.Controls.Add(lblshow);
}
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<form Enctype="multipart/form-data" runat="server">
<input type="file" runat="server" id="uploadfile1"><br>
<input type="file" runat="server" id="uploadfile2"><br>
<input type="file" runat="server" id="uploadfile3"><br>
<input type="file" runat="server" id="uploadfile4"><br>
<input type="file" runat="server" id="uploadfile5"><br>
<input type="file" runat="server" id="uploadfile6"><br>
<input type="submit" OnServerClick="doupload" value="开始上传" runat="server"><br></form>
<hr>
<asp:Panel id="Panel1" runat="server" />
</body>
</html>
============================
错误是
==========================
Server Error in '/nns' Application.
--------------------------------------------------------------------------------Could not find a part of the path 'G:\aspnet\samples\'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'G:\aspnet\samples\'.Source Error:
Line 11: strfilename=htf.FileName.Split(aa);
Line 12: dirfilename=strfilename[strfilename.Length-1];
Line 13: htf.SaveAs(Server.MapPath(".")+"\\"+dirfilename);
Line 14: Addpanelcontrols(dirfilename);
Line 15: }
Source File: g:\aspnet\samples\multiupload.aspx Line: 13 Stack Trace:
[DirectoryNotFoundException: Could not find a part of the path 'G:\aspnet\samples\'.]
System.IO.__Error.WinIOError(Int32 errorCode, String str) +1479842
System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy) +935
System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) +112
System.IO.FileStream..ctor(String path, FileMode mode) +52
System.Web.HttpPostedFile.SaveAs(String filename) +92
ASP.multiupload_aspx.doupload(Object src, EventArgs e) in g:\aspnet\samples\multiupload.aspx:13
System.Web.UI.HtmlControls.HtmlInputButton.OnServerClick(EventArgs e) +111
System.Web.UI.HtmlControls.HtmlInputButton.RaisePostBackEvent(String eventArgument) +79
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +31
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5157
这个市那里出问题了呢,我写了一个单个上传得文件可以,多个上传久不行了。就抱这个错