客户端动态数据更改 [英] Dynamic data change on clientside

查看:118
本文介绍了客户端动态数据更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.
我正在做一个项目,对asp.net还是很陌生.方案是:
页面上有一个asp.net下拉列表.根据在下拉列表控件中所做的选择,另一个TextBox的内容将更改,而不会回发到服务器.这必须在客户端完成.
我该怎么做?谁能指导我入门教程?
有关种类信息...我正在将VisualStudio2008与.net framework 3.5配合使用
任何帮助将不胜感激.

Hello people.
I am working on a project and I am very new to asp.net.The scenario is:
There is a asp.net dropdownlist on a page. Based on the selection made in the dropdownlist control, another TextBox''s content will change with no post back to the server. This must be done on the client side.
How can I do it? Can anyone guide me to a beginners tutorial?
For kind info...I am using VisualStudio2008 with .net framework 3.5
Any help will be highly appreciated.

推荐答案

这可以通过不同的方式来实现.

1.使用javascript(纯粹是客户端)
2.使用AJAX

使用客户端脚本 [
This can be achieved in different ways.

1. Using javascript (purely client side)
2. Using AJAX

Take a look at the MSDN article on Working with Client-side Script[^]. Since you are new to asp.net, its worth spending sometime.

Coming to your question, set the onchange attribute in codebehind page as

ddl.Attributes["onchange"] = "javaScriptFunctoChangeTextbox();";



然后在javascript页面中添加javascript.



And you add the javascript in the aspx page.


这篇关于客户端动态数据更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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