用户无法在运行时更改中继器控件中复选框的“选中属性" [英] Unable to Chenged the Checked Property of check box in repeater control at run time by user

查看:96
本文介绍了用户无法在运行时更改中继器控件中复选框的“选中属性"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在中继器控件中使用asp:checkbox控件,但是当我们运行项目并更改checkbox的cheked属性时,但在代码属性中却没有改变.
请帮帮我............

Upniwesh

解决方案

您可能被ASP假装为浏览器和服务器端代码中的存在"控件所迷惑.除非您将它们回发(使用页面回发或AJAX请求),否则在浏览器中使用JavaScript进行的任何更改都不会在服务器上存在.如果您希望这些复选框状态更改在服务器上注册,则要么需要提交表单,要么需要在更改后发送AJAX请求来处理和更新数据模型.


I am working with asp:checkbox control in repeater control but when we run the project and change the cheked property of checkbox but in code property does not change.
Please help me............

Upniwesh

解决方案

You are probably being fooled by ASP pretending that controls ''exist'' both in the browser and in your server-side code. Any changes you make with JavaScript in the browser don''t exist on the server unless you post them back (either with a page postback or an AJAX request). If you want those checkbox status changes to register on the server you either need to submit a form or you need to send an AJAX request when they are changed which you handle and update the data model.


这篇关于用户无法在运行时更改中继器控件中复选框的“选中属性"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆