200分,急问。为什么我的detalist在update是始终取到HtmlInputText的原有值,无法得到改变后的值

rbjojo 2004-11-15 12:06:38
点edit后INPUT btnStatusCode中显示123456,修改为9999后,点save,在 UpdateCommand中设置断点的结果发现StatusCode 还是取到的是123456,也就是修改后的值没有提交到服务器。
为什么?
在线等待,各位老大多谢了,已经好几天没有办法了

<EditItemTemplate>
<TABLE width=550 border=0 >
<TR>
<TD ><INPUT id=btnStatusCode runat=server size=5 value="<%#Container.DataItem(0)%>" runat="server"></TD>
<TD >
<INPUT id=btnDes runat=server size=48 value="<%#Container.DataItem(1)%>" runat="server"></TD>
<TD >
<asp:LinkButton id=Linkbutton3 runat="server" ForeColor="000077" CommandName="Update">SAVE</asp:LinkButton></TD>
</TABLE>
</EditItemTemplate>


Private Sub DataList1_UpdateCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataListCommandEventArgs) Handles DataList1.UpdateCommand


StatusCode = DirectCast(dli.FindControl("btnStatusCode"), HtmlInputText).Value
Description = DirectCast(dli.FindControl("btnDes"), HtmlInputText).Value

End Sub
...全文
97 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
吐司vivi 2004-11-15
  • 打赏
  • 举报
回复
同意一楼的
zhounet 2004-11-15
  • 打赏
  • 举报
回复
nowfox(雪域幽狐) 说的对
Eddie005 2004-11-15
  • 打赏
  • 举报
回复
绑定DataGrid的代码要放在
If Not IsPostBack) then


end if
里面,否则每次回传首先执行Page_Load,对DataGrid重新绑定,那么它里面的值肯定就恢复原状了
nowfox 2004-11-15
  • 打赏
  • 举报
回复
开始绑定数据的时候要在
if(!Page.IsPostBack)
里绑定哟
rbjojo 2004-11-15
  • 打赏
  • 举报
回复
搞定了多谢各位!
rbjojo 2004-11-15
  • 打赏
  • 举报
回复
可以具体一点吗
我是在aspx的html里面绑定的
具体怎么做?
Scott Worley Publisher: New Riders Publishing First Edition November 15, 2001 ISBN: 0-7357-1135-6, 730 pages Inside ASP.NET Here’s what reviewers are saying about Inside ASP.NET: About the Author Contributing Authors About the Technical Reviewers Acknowledgments Tell Us What You Think! Introduction Who Is This Book For? Contents of the Book I: Introducing ASP.NET 1. An Overview of ASP.NET ASP.NET The .NET Base Class Libraries ASP.NET Web Application Configuration Session and State Management Cache Management ASP.NET Web Application Development Layers Web Forms XML Web Services COM/COM+ Interoperability and Component Services ADO.NET Migration from Classic ASP to ASP.NET Globalization and Localization Enhanced Security 2. Developing Applications with ASP.NET Application Settings Files The Page Syntax Commonly Used Objects and Classes in ASP.NET Tracing ASP.NET Applications ASP.NET Migration Issues Summary 3. Configuring ASP.NET Applications Deploying the web.config Configuration File Using the Configuration Section Analyzing the system.web Configuration Sections Summary II: Core ASP.NET 4. Web Form-Based Development Introduction to Web Forms Web Form Architecture Separating Code from the User Interface Server Controls Validation Controls Summary 5. State Management in ASP.NET What Is State Management? Using ASP.NET Application State Management Summary III: ASP.NET and Data Access 6. Using ADO.NET in ASP.NET Applications Data Access from a Web-Based Perspective ADO and ADO.NET Working with the Main ADO.NET Objects Building Data-Oriented Web Forms Transaction-Enabled ASP.NET Applications Summary 7. Using XML in ASP.NET Applications XML Document Structure How XML Is Used in ASP.NET Other XML Technologies Using XML in Your Application Real-World Examples Summary IV: Advanced Technologies 8. XML Web Service Development in ASP.NET Introduction to XML Web Services Using the SOAP Toolkit with XML Web Services XML Web Service Discovery—Advertising Your Service Using an XML Web Service in ASP.NET Pages Summary 9. Securing ASP.NET Applications Overview of ASP.NET Security Features Applying Security in ASP.NET Applications Inside ASP.NET Security Other Security Considerations Summary 10. Using Component Services with ASP.NET What Are Component Services? Applying Component Services in an ASP.NET Application The business Object Using the business Object Serviced Components Summary 11. Using Messaging Services with ASP.NET Introduction to Messaging Systems Managing MSMQ Message Queues with Windows 2000 Architecture of the .NET Messaging Services Accomplishing Tasks Using MSMQ and .NET Summary 12. Using Directory Services with ASP.NET Introducing Directory Services How Does Active Directory Work? The Benefits of Active Directory Active Directory Technology Summary Summary 13. Localizing and Globalizing ASP.NET Applications What Is Localization? Localizing an ASP.NET Web Application Summary V: Advanced Web Forms 14. Cache Control in ASP.NET ASP.NET Cache Management Page Output Caching Fragment Caching (Partial Page Caching) Request Caching Summary 15. Creating User and Custom Controls for ASP.NET User Controls Introduction to Custom Controls Summary 16. Mobile Device Development with ASP.NET Wireless Application Protocol (WAP) Wireless Markup Language (WML) Enter ASP.NET Summary VI: Putting It All Together 17. Putting It All Together What Is ProjectPal? Installing the ProjectPal Application A Brief Application Walkthrough Application Architecture ProjectPal Service Layers ProjectPal Client Interfaces The ProjectPal Database The ProjectPal Components Inside the ProjectPal Code Summary VII: Appendixes A. An Overview of .NET Multiple Development Platforms Multiple Development Languages .NET Base Class Libraries Common Language Runtime (CLR) Common Type System (CTS) .NET Server Products B. ASP.NET Common Object Reference HttpContext Object (Context Intrinsic Control) The HttpApplication Class The HttpApplicationState Class (Application Intrinsic Object) The HttpSessionState Class ( Session Intrinsic Object) The HttpRequest Class (Request Intrinsic Object) The HttpResponse Class (Response Intrinsic Object) The Server Class ( HttpServerUtility ) SMTPMail API C. ADO Common Object Reference DataSet Object DataTable Object DataColumn Object DataRow Class DataRelation Object DataView Object DataRowView Class OLEDBDATA Objects SQLData … Objects D. HTML Server Control Reference HtmlForm Object— < form> Element HtmlInputText Object— < input> Element HtmlInputHidden Object— < input type=“hidden”> Element HtmlInputCheckbox Object— < input type=”checkbox”> Element HtmlInputRadioButton Object— < input type=“radiobutton”> Element HtmlInputFile Object— < input type=“file”> Element HtmlTextArea Object— < textarea> Element HtmlButton Object— < button> Element HtmlInputButton Object— < input type=“button”> Element HtmlAnchor Object— < a> Element HtmlImage Object— < img> Element HtmlInputImage Object— < input type=“image”> Element HtmlSelect Object— < select> and

62,074

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧