处理JQery事件和codebehiind之间的区别是什么? [英] what is the differece between handling event from JQery and from codebehiind?

查看:42
本文介绍了处理JQery事件和codebehiind之间的区别是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



如果我从JQuery处理并且如果我从代码隐藏中处理相同的效果,我会感到有点混淆。



例如,如果我想要隐藏我的单选按钮上的按钮选择索引已更改..如果我从代码后面和jquery执行此操作将会发生什么..

Hi,
I am bit confuse between what is the actual effect occur if i handle from JQuery and if i handle same from codebehind ..

Say for example if i want to hide button on my radio buttons selected index changed .. what will happend if i do this things one from code behind and from jquery ..

推荐答案

jQuery / Javascript - 客户端

代码隐藏 - 服务器端。



FYI

客户端与服务器端代码:什么是差异? [ ^ ]

使用&调用RegisterStartUpScript,RegisterClientScript和Client-Side Script [ ^ ]
jQuery/Javascript - Client side
Code-behind - Server side.

FYI
Client-Side vs. Server-Side Code: What’s the Difference?[^]
Use & Call RegisterStartUpScript, RegisterClientScript and Client-Side Script[^]


正如上面解决方案中的theraja所解释的那样,您应尽可能使用客户端脚本。



发布回发是为了让服务器知道客户端发生了什么,例如 AutoPostBack =true使用DropDownList根据所选值获取记录。



但是,你可以利用客户端脚本,例如如果要检查输入文本框的文本长度并提醒用户。在这里,不需要回发来测量文本的长度。所以你应该使用JQuery / JavaScript实现这样的要求。



问候......
As explained by thatraja in above solution,you should use client side scripting where possible.

Postback occurs in order to let the server know what happened at client side e.g. AutoPostBack="true" with DropDownList to fetch records based on selected value of it.

But,you can make use of client side scripts e.g. if you want to check length of the text entered into textbox and alert the user. Here,no postback is required to measure length of the text. So you should implement such requirement using JQuery/JavaScript.

Regards...


这篇关于处理JQery事件和codebehiind之间的区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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