开发者

Converting any Jquery Plugin to .NET Server Control [closed]

开发者 https://www.devze.com 2023-02-11 05:39 出处:网络
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by edit开发者_JA
Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by edit开发者_JAVA技巧ing this post.

Closed 7 years ago.

Improve this question

What you should know if you need to convert a jquery plugin to .NET server control (.ascx).

Is there anybody have a good tutorial or would like his ideas what's best and how you should do it?


Check out the following link

jQuery Asp.net Controls by David Taylor

DJ-Jquery Web Controls for asp.net


I don't really think is possible, in general server controls are server side while by design jquery plugins are client side, why would you incapsulate what is already working server side into a server control which renders the same client side code?


There are many issues:

1) Self-registration of scripts and css - any server control should be completely self-contained, so it should be able to ensure its own resources are available

2) Naming container safety (e.g. you can't really hard-code references to server objects, or the code won't be reusable). You can't really get away with using Static client IDs, this would break naming container safety from the get-go. So you need a way to pass references to the client script dynamically.

3) Hooking with asp.net client event model, e.g. to update data passed from the server after partial postbacks, if you want them to work right in UpdatePanels

0

精彩评论

暂无评论...
验证码 换一张
取 消