0

I'm not even sure it's possible as I have not been able to find any documentation on the matter, but my goal is this: In Visual Studio 2012 (I imagine the process would probably apply to 2010 as well), I need to integrate my JavaScript web control into Visual Studio. Now, basically, I need a control in the toolbox which would generate following code when dropped on a form: In .ASPX file:

<table id="gridView1">

</table>

In JavaScript file of the same name (create it if needed, append if it already exists):

gridView1 = new GridView(tableOfContents, "gridView1", "checkbox");

The JS code in a separate file would be ideal, but having it embended in tags works too. Now, as you might have noticed, there are currently 3 arguments in the object's constructor: contents is first, then ID of the table, and then an optional argument (there's 4 of those). So, the last thing I need is for these arguments to be changeable using 'properties' editor of Visual Studio. That means that when I right-click the control in the designer and click 'Properties', I can change 'name' of the object, toggle between "checkbox" and "multiline" options of multiselect and whatnot, with these changes reflecting in the JS code.

I also can't use server-side events as I need this element to be accessible offline.

Now as I said, I do doubt that this is even possible in Visual Studio. However, I am hoping that there is something I have overlooked. If you have any suggestions, pointers or even know of documentation / book to solve this, please, let me know.

4

1 に答える 1

0

あなたが求めることはすべて確実に可能です。
読むことから始めることができます

方法: Visual Studio でカスタム ASP.NET サーバー コントロールを使用する

プロパティの設定方法:

サーバー コントロール コレクションのプロパティ

設計時に開発者に表示されるものを制御する

ASP.NET コントロール デザイナーの概要

これらを JavaScript に結び付けるには、ページやコントロールで行うのと同じように

ClientScriptManager.RegisterClientScriptBlock

于 2013-06-25T07:55:06.153 に答える