如何在DNN下用過jQuery?在子產品設計時用定義<asp:TextBox id=“txtName" .... />,結果在輸出時id變成了dnn_ctr381_EditDeviceDeploy_txtName,之前寫jQuery時使用的$("#txtName")當然不對了,不知如何解決的?
這種方式會比較難于管理,還有可以改進為現在服務端把所有的ClientID都打包成一個JS對象,之後再用戶端調動,你可以google一下這種方法。
幾個可以參考的網頁:
<a href="http://www.bitethebullet.co.uk/DNN_Module_and_jQuery.aspx">http://www.bitethebullet.co.uk/DNN_Module_and_jQuery.aspx</a>
<a href="http://jquidnn.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=29465">http://jquidnn.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=29465</a>
Using jQuery with ASP .NET
<a href="http://dotnetslackers.com/articles/ajax/using-jquery-with-asp-net.aspx">http://dotnetslackers.com/articles/ajax/using-jquery-with-asp-net.aspx</a>
<a href="http://www.west-wind.com/presentations/jquery/jquerypart2.aspx#PageLevelCallbacks">http://www.west-wind.com/presentations/jquery/jquerypart2.aspx#PageLevelCallbacks</a>
<a href="http://www.dotnetnuke.com/Default.aspx?tabid=795&forumid=111&postid=342418&scope=posts#342418">http://www.dotnetnuke.com/Default.aspx?tabid=795&forumid=111&postid=342418&scope=posts#342418</a>
JSON.NET
<a href="http://james.newtonking.com/projects/json-net.aspx">http://james.newtonking.com/projects/json-net.aspx</a>