| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 820 人关注过本帖
标题:有一个小问题想请教各师哥师姐!
取消只看楼主 加入收藏
huangchao
Rank: 1
等 级:新手上路
帖 子:49
专家分:0
注 册:2006-6-13
收藏
 问题点数:0 回复次数:3 
有一个小问题想请教各师哥师姐!

<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="gb2312" %>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script runat="server">
void Botton1_Click(Object src,EventArgs e)
{
string DownListValue=DownList1.SelectedItem.Text;
labell.Text=DownListValue;
}
</script>
</head>
<body>
<form runat="server">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse:collapse" bordercolor="#111111" width="100%">
<tr>
<td width="100%" align="center" bgcolor="#ffff00">
DropDownList控件演示例子
</td>
</tr>
</table>
请选择一个青春组合:
<p>
<asp:DropDownList id="DownList1" runat="server">
<asp:ListItem>--请选择一个青春组合--</asp:ListItem>
<asp:ListItem>中国力量</asp:ListItem>
<asp:ListItem>漂亮宝贝</asp:ListItem>
<asp:ListItem>青春美少女</asp:ListItem>
<asp:ListItem>动感男孩</asp:ListItem>
</asp:DropDownList>
<p>
<asp:Button id="Botton1" Text="选择" Onclick="Botton1_Click" runat="server">
<br>
<br>
您选择的组合是:
<asp:label id="labell" Text="暂没有选择!" ForeColor="red" runat="server">

</form>
</body>
</html>
本人是一个初学者,提出的问题请不要见笑啊!本人实在看不出哪里有错啊,请各位师哥师姐帮帮忙!小弟在此谢谢了!

搜索更多相关主题的帖子: 师哥 师姐 
2006-12-05 13:10
huangchao
Rank: 1
等 级:新手上路
帖 子:49
专家分:0
注 册:2006-6-13
收藏
得分:0 

Server Error in '/' Application.
--------------------------------------------------------------------------------

Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Type 'System.Web.UI.WebControls.Button' does not have a public property named 'br'.

Source Error:


Line 34: <asp:Button id="Botton1" Text="选择" Onclick="Botton1_Click" runat="server">
Line 35: </form>
Line 36: <br>
Line 37: <br>
Line 38: 您选择的组合是:

Source File: /7.aspx Line: 36 这是报错原因


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210

2006-12-05 15:05
huangchao
Rank: 1
等 级:新手上路
帖 子:49
专家分:0
注 册:2006-6-13
收藏
得分:0 
刚才没有写上报错原因,实在不好意思啊!上面是显示页面报错原因!
2006-12-05 15:07
huangchao
Rank: 1
等 级:新手上路
帖 子:49
专家分:0
注 册:2006-6-13
收藏
得分:0 

Server Error in '/' Application.
--------------------------------------------------------------------------------

Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
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.ArgumentException: Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[ArgumentException: Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.]
System.Web.UI.ClientScriptManager.ValidateEvent(String uniqueId, String argument) +406
System.Web.UI.Control.ValidateEvent(String uniqueID, String eventArgument) +108
System.Web.UI.WebControls.DropDownList.LoadPostData(String postDataKey, NameValueCollection postCollection) +52
System.Web.UI.WebControls.DropDownList.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) +11
System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +413
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3388

刚才页面显示正确了,但是当我点击选择时,他又跳出这个错误来了,真不知道是什么原因!本人刚接触.net有很多不懂的地方,希望提出的问题不要笑话!~谢谢!
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210

2006-12-05 16:28
快速回复:有一个小问题想请教各师哥师姐!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019519 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved