{"id":2024,"date":"2014-01-09T04:48:45","date_gmt":"2014-01-09T04:48:45","guid":{"rendered":"http:\/\/fanzung.com\/?p=2024"},"modified":"2014-01-09T07:27:29","modified_gmt":"2014-01-09T07:27:29","slug":"t%e1%ba%a1o-module-dnn","status":"publish","type":"post","link":"https:\/\/dongson.info\/?p=2024","title":{"rendered":"T\u1ea1o Module DNN"},"content":{"rendered":"<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"100%\">04-09-2008 11:31:48M\u1ed9t v\u00e0i kh\u00e1i ni\u1ec7m \u0111\u1ec3 th\u00f4ng su\u1ed1t ph\u00e1t tri\u1ec3n module dotnetnuke c\u00f3 ngh\u0129a l\u00e0 l\u00e0m c\u00e1i g\u00ec nh\u01b0 th\u1ebf n\u00e0o, k\u1ebft qu\u1ea3 ra sao ? T\u00fam l\u1ea1i \u0111\u01a1n gi\u1ea3n l\u00e0 th\u1ebf n\u00e0y :<\/p>\n<p>&#8211; Dotnetnuke l\u00e0 1 c\u1ed5ng th\u00f4ng tin portal.<br \/>\n&#8211; C\u00e1c y\u1ebfu t\u1ed1 c\u01a1 b\u1ea3n c\u1ee7a portal (c\u1ed5ng th\u00f4ng tin)<br \/>\n+ website &amp; website con<br \/>\n+ c\u00e1c trang (pages) tr\u00ean wwebsite<br \/>\n+ C\u00e1c v\u00f9ng (tr\u00ean 1 trang) g\u1ecdi l\u00e0 Pane<br \/>\n+ C\u00e1c porlet (ch\u1ee9a n\u1ed9i dung th\u00f4ng tin)<\/p>\n<p align=\"right\">\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"100%\">04-09-2008 11:44:06porlet : n\u00f4m na n\u00f3 l\u00e0 m\u1ed9t h\u00ecnh vu\u00f4ng tr\u00ean website ch\u1ee9a n\u1ed9i dung th\u00f4ng tin, nhi\u1ec1u h\u00ecnh vu\u00f4ng (porlet) gh\u00e9p l\u1ea1i ch\u00fang ta c\u00f3 1 trang web (web page), kh\u00f4ng bi\u1ebft \u0111\u1ecbnh ngh\u0129a webpage l\u00e0 c\u00e1i g\u00ec n\u1eefa ch\u1ec9 hy v\u1ecdng l\u00e0 anh em \u0111\u1ec1u hi\u1ec3u kh\u00e1i ni\u1ec7m c\u01a1 b\u1ea3n webpage.C\u00e1c website th\u00f4ng d\u1ee5ng t\u1ea1i vi\u1ec7t nam c\u00f3 3 kh\u1ed1i th\u00f4ng tin, menu b\u00ean tr\u00e1i, n\u1ed9i dung ch\u00ednh \u1edf gi\u1eefa v\u00e0 b\u00ean ph\u1ea3i l\u00e0 qu\u1ea3ng c\u00e1o, \u0111\u1ed1i t\u00e1c &#8230; 3 kh\u1ed1i th\u00f4ng tin tr\u00ean \u0111\u01b0\u1ee3c kh\u00e1i qu\u00e1t th\u00e0nh 3 Pane (v\u00f9ng). Nh\u01b0 v\u1eady ch\u00fang ta c\u00f3 kh\u00e1i ni\u1ec7m v\u00f9ng (Pane = ho\u1eb7c region th\u00ec c\u0169ng th\u1ebf), tr\u00ean 1 v\u00f9ng c\u00f3 th\u1ec3 ch\u1ee9a n Porlet.C\u00e1c v\u00f9ng c\u00f3 n\u1ed9i d\u00f9ng gh\u00e9p l\u1ea1i th\u00ec ch\u00fang ta c\u00f3 webpage : t\u01b0\u01a1ng \u0111\u01b0\u01a1ng v\u1edbi kh\u00e1i ni\u1ec7m page trong dotnetnuke.Nhi\u1ec1u page gh\u00e9p l\u1ea1i v\u1edbi nhau th\u00ec th\u00e0nh 1 website. Tuy nhi\u00ean c\u0169ng ph\u1ea3i n\u00f3i th\u00eam, kh\u00e1i ni\u1ec7m page tr\u00ean DNN r\u1ed9ng h\u01a1n nhi\u1ec1u.<\/p>\n<p>V\u00ed d\u1ee5<\/p>\n<p>http:\/\/thienan.vn\/tintuc\/tabid\/55\/id\/6\/Default.aspx<br \/>\nhttp:\/\/thienan.vn\/tintuc\/tabid\/55\/id\/8\/Default.aspx<br \/>\nhttp:\/\/thienan.vn\/tintuc\/tabid\/55\/id\/16\/Default.aspx<br \/>\nhttp:\/\/thienan.vn\/tintuc\/tabid\/55\/id\/19\/Default.aspx<br \/>\nhttp:\/\/thienan.vn\/tintuc\/tabid\/55\/id\/20\/Default.aspx<\/p>\n<p>l\u00e0 1 page c\u00f3 PageID=55.<br \/>\nTrong Page n\u00e0y, porlet ch\u00ednh gi\u1eefa hi\u1ec3n th\u1ecb n\u1ed9i dung = c\u00e1ch \u0111\u1ecdc trong CSDL tin t\u1ee9c c\u00f3 m\u00e3 6, 8, 16, 19, 20 &#8230;<\/p>\n<p>V\u00ec c\u00e1c porlet c\u00f3 c\u00e1i load \u0111\u1ed9ng theo URL, c\u00f3 c\u00e1i load t\u0129nh n\u00ean nhu c\u1ea7u c\u1ea7n c\u00f3 settings cho m\u1ed7i porlet. Settings l\u00e0 g\u00ec ? l\u00e0 ph\u1ea7n cho ph\u00e9p ng\u01b0\u1eddi d\u00f9ng ch\u1ec9 \u0111\u1ecbnh c\u00e1ch th\u1ee9c hi\u1ec3n th\u1ecb th\u00f4ng tin cho m\u1ed7i porlet.<\/p>\n<p>Quay l\u1ea1i v\u1edbi Page, ch\u00fang ta c\u00f3 th\u1ec3 th\u1ea5y kh\u00e1i ni\u1ec7m Page trong DNN \u0111\u01a1n gi\u1ea3n l\u00e0 c\u00e1i khung c\u00e1c Pane b\u1ed1 tr\u00ed ra sao, tr\u00ean m\u1ed7i Pane \u0111\u00f3 c\u00e1c porlet \u0111\u1eb7t v\u00e0 hi\u1ec3n th\u1ecb n\u1ed9i dung th\u1ebf n\u00e0o -&gt; Page l\u00e0 khung cho c\u00e1c v\u00f9ng (Pane, Region)<br \/>\n&#8212;<br \/>\nCoding for food<\/p>\n<p align=\"right\">\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"100%\">04-09-2008 11:50:49YAHOOMSNNh\u00ecn 2 h\u00ecnh b\u00ean tr\u00ean c\u1ee7a Yahoo v\u00e0 MSN, ch\u00fang ta c\u00f3 th\u1ec3 th\u1ea5y c\u00e1c mi\u1ebfng vu\u00f4ng r\u1ea5t gi\u1ed1ng nhau, m\u1ed7i mi\u1ebfng vu\u00f4ng \u0111\u00f3 l\u00e0 1 porlet, bao b\u00ean ngo\u00e0i m\u1ed7i porlet l\u00e0 1 container.<\/p>\n<p>Nh\u01b0 v\u1eady c\u00f3 th\u1ec3 th\u1ea5y container l\u00e0 c\u00e1i ch\u1ec9 d\u00f9ng \u0111\u1ec3 l\u00e0m \u0111\u1eb9p, n\u00f3 gi\u00fap c\u00e1c porlet c\u1ee7a website \u0111\u01b0\u1ee3c tr\u00ecnh b\u00e0y m\u1ed9t c\u00e1ch th\u1ed1ng nh\u1ea5t. C\u00e1i Container n\u00e0y kh\u00f4ng ph\u1ea3i l\u1eadp tr\u00ecnh, DNN \u0111\u00e3 l\u00e0m h\u1ed9. Ch\u00fang ta ch\u1ec9 l\u00e0m vi\u1ec7c vi\u1ebft c\u00e1ch hi\u1ec3n th\u1ecb c\u00e1i n\u1ed9i dung b\u00ean trong c\u00e1c container, vi\u1ec7c vi\u1ebft code hi\u1ec3n th\u1ecb n\u1ed9i dung b\u00ean trong l\u00e0 vi\u1ec7c vi\u1ebft module cho DNN.<br \/>\n&#8212;<br \/>\nCoding for food<\/p>\n<p align=\"right\">\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"100%\">05-09-2008 12:02:28\u0110\u1ec3 vi\u1ebft code cho 1 module ch\u00fang ta n\u00ean bi\u1ebft c\u1ea5u tr\u00fac module c\u1ee7a DNN- 1 Module c\u00f3 n Definitions<br \/>\n&#8211; 1 Definition c\u00f3 n ControlsTrong 1 module c\u00f3 2 Control \u0111\u1eb7c bi\u1ec7t, l\u00e0 c\u00e1c control c\u00f3 key = &#8220;&#8221; v\u00e0 key = &#8220;Settings&#8221;. Control key=(blank) th\u00ec ch\u00fang ta c\u00f3 th\u1ec3 th\u00eam n\u00f3 v\u00e0o 1 Page. Control c\u00f3 key=Settings l\u00e0 ph\u1ea7n thi\u1ebft l\u1eadp cho module.<\/p>\n<p>1 Module nh\u01b0 v\u1eady c\u00f3 th\u1ec3 c\u00f3 nhi\u1ec1u Control c\u00f9ng c\u00f3 key = blank, tuy nhi\u00ean khuy\u1ebfn c\u00e1o l\u00e0 ch\u00fang ta ch\u1ec9 n\u00ean d\u00f9ng 1.<br \/>\n&#8212;<br \/>\nCoding for food<\/p>\n<p align=\"right\">\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"100%\">05-09-2008 12:17:40\u0110\u1ec3 g\u1ecdi 1 usecontrol (t\u01b0\u01a1ng \u0111\u01b0\u01a1ng v\u1edbi 1 file ascx) ch\u00fang ta vi\u1ebft ch\u00fang ta d\u00f9ngDotNetNuke.Common.Globals.NavigateURL(PortalSettings.ActiveTab.TabID, &#8220;edit&#8221;, &#8220;mid\/&#8221; + this.ModuleId.ToString());Ch\u00fang ta n\u00ean \u0111\u1ec3 \u00fd r\u1eb1ng DNN c\u00f3 2 ch\u1ebf \u0111\u1ed9 ch\u00ednh, l\u00e0 ch\u1ebf \u0111\u1ed9 frontend (tr\u00ecnh di\u1ec5n presentation) v\u00e0 backend (ph\u1ea7n qu\u1ea3n l\u00fd administration)<\/p>\n<p>C\u00e2u l\u1ec7nh tr\u00ean cho ph\u00e9p ch\u00fang ta chui v\u00e0o ph\u1ea7n backend (qu\u1ea3n l\u00fd), cho ph\u00e9p ch\u00fang ta g\u1ecdi 1 control duy nh\u1ea5t l\u00e0 control c\u00f3 nhi\u1ec7m v\u1ee5 edit 1 tin t\u1ee9c.<\/p>\n<p>Url cho ph\u00e9p ch\u00fang ta truy c\u1eadp v\u00e0o t\u1ea7ng frontend (t\u1ea7ng tr\u00ecnh di\u1ec5n)<br \/>\nhttp:\/\/thienan.vn\/tintuc\/tabid\/55\/id\/19\/Default.aspx<\/p>\n<p>URL cho ph\u00e9p ch\u00fang ta v\u00e0o backend (t\u1ea7ng qu\u1ea3n l\u00fd)<br \/>\nhttp:\/\/localhost\/Home\/tabid\/36\/ctl\/admin\/mid\/378\/Default.aspx<\/p>\n<p>ch\u00fang ta xem x\u00e9t k\u1ef9 URL n\u00e0y<\/p>\n<p><strong>ctl\/admin\/mid\/378\/Default.aspx<\/strong><br \/>\n=&gt; ctl = &#8220;admin&#8221; (key) , mid = &#8220;378&#8221; (ModuleID)<br \/>\n=&gt; truy c\u1eadp v\u00e0o module c\u00f3 m\u00e3 378 \u0111\u1ecdc ra usercontrol (file ascx) c\u00f3 key = &#8220;admin&#8221;<\/p>\n<p>Nh\u01b0 v\u1eady c\u00f3 th\u1ec3 th\u1ea5y backend v\u00e0 frontend kh\u00e1c nhau \u1edf ch\u1ed7 backend c\u00f3 ph\u1ea7n <strong>&#8230;\/ctl\/xxx\/mid\/yyy&#8230;<\/strong><br \/>\nt\u1ee9c l\u00e0 c\u00f3 gi\u00e1 tr\u1ecb c\u1ee7a <strong>ctl<\/strong> v\u00e0 <strong>mid<\/strong><\/p>\n<p>c\u00e1c key th\u00f4ng d\u1ee5ng cho qu\u1ea3n l\u00fd tin t\u1ee9c<\/p>\n<p>key = &#8220;news_edit&#8221; s\u1eeda 1 tin t\u1ee9c<br \/>\nkey = &#8220;news_add&#8221; th\u00eam m\u1edbi 1 tin<br \/>\nkey = &#8220;news_publish&#8221; cho ph\u00e9p 1 tin \u0111\u01b0\u1ee3c \u0111\u0103ng hay kh\u00f4ng<br \/>\nkey = &#8220;news_delete&#8221; xo\u00e1 1 tin t\u1ee9c m\u1edbi<br \/>\nkey = &#8220;news_view&#8221; xem n\u1ed9i dung 1 tin<\/p>\n<p>Th\u00f4ng th\u01b0\u1eddng &#8220;news_view&#8221; -&gt; &#8220;&#8221; v\u00ec key = (blank) c\u00f3 ngh\u0129a l\u00e0 ch\u00fang ta c\u00f3 th\u1ec3 th\u00eam control n\u00e0y (porlet) v\u00e0o frontend (th\u00eam porlet v\u00e0o trang &#8211; webpage tr\u00ecnh di\u1ec5n n\u1ed9i dung)<br \/>\n&#8212;<br \/>\nCoding for food<\/p>\n<p align=\"right\">\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"100%\">05-09-2008 12:24:48C\u00e1c module \u0111\u01b0\u1ee3c vi\u1ebft v\u00e0 \u0111\u1eb7t trong th\u01b0 m\u1ee5c <strong>\\Website\\DesktopModules<\/strong>\u0110\u1ec3 vi\u1ebft 1 control ch\u00fang ta khai b\u00e1oC#<br \/>\npublic partial class news_admin : DotNetNuke.Entities.Modules.PortalModuleBase<\/p>\n<p>VB<br \/>\nPublic Partial Class EditHtml<br \/>\nInherits DotNetNuke.Entities.Modules.PortalModuleBase<\/p>\n<p>\u0110\u1ec3 ph\u1ea7n n\u00e0y kh\u00f4ng l\u1ed7i module c\u1ee7a b\u1ea1n ph\u1ea3i Reference \u0111\u1ebfn file dotnetnuke.dll (c\u00f2n reference l\u00e0 l\u00e0m th\u1ebf n\u00e0o th\u00ec c\u00e1c b\u00e1c t\u1ef1 t\u00ecm hi\u1ec3u)<\/p>\n<p>H\u00ecnh n\u00e0y m\u00e0 c\u00e1c b\u00e1c nh\u00ecn c\u00f2n kh\u00f4ng hi\u1ec3u th\u00ec anh em b\u00f3 tay r\u1ed3i.<br \/>\n&#8212;<br \/>\nCoding for food<\/p>\n<p align=\"right\">\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"100%\">05-09-2008 12:30:53Trong ph\u1ea7n setting ch\u00fang ta l\u00e0m nh\u01b0 sau :C#<br \/>\npublic partial class news_list_settings : DotNetNuke.Entities.Modules.ModuleSettingsBaseVB<br \/>\nPartial Public Class Settings<br \/>\nInherits DotNetNuke.Entities.Modules.ModuleSettingsBase<\/p>\n<p>Trong ascx settings n\u00e0y ch\u00fang ta ph\u1ea3i vi\u1ebft 2 h\u00e0m (b\u1eaft bu\u1ed9c)<\/p>\n<p>VB<br \/>\nPublic Overrides Sub LoadSettings()<br \/>\nC#<br \/>\npublic override void LoadSettings()<\/p>\n<p>v\u00e0<\/p>\n<p>C#<br \/>\npublic override void UpdateSettings()<br \/>\nVB<br \/>\nPublic Overrides Sub UpdateSettings()<\/p>\n<p>Trong n\u00e0y \u0111\u1ec3 ghi v\u00e0o CSDL ch\u00fang ta d\u00f9ng<\/p>\n<p>VB<br \/>\nDim objModules As New DotNetNuke.Entities.Modules.ModuleController<br \/>\nDim objModule As DotNetNuke.Entities.Modules.ModuleInfo = objModules.GetModule(ModuleId, TabId, False)<\/p>\n<p>&#8216;Update Tab Module Settings<br \/>\nobjModules.UpdateModuleSetting(ModuleId, &#8220;TEXTHTML_ReplaceTokens&#8221;, rblstReplaceTokens.SelectedValue)<\/p>\n<p>C#<br \/>\nDotNetNuke.Entities.Modules.ModuleController objModules = new DotNetNuke.Entities.Modules.ModuleController();<br \/>\nobjModules.UpdateModuleSetting(ModuleId, &#8220;newsid&#8221;, newsid.ToString());<br \/>\nobjModules.UpdateModuleSetting(ModuleId, &#8220;limits&#8221;, txtLimits.Text);<\/p>\n<p>\u0110\u1ecdc ra th\u00ec th\u1ebf n\u00e0o<\/p>\n<p>C#<br \/>\ntxtLimits.Text = ModuleSettings[&#8220;limits&#8221;].ToString();<br \/>\nVB<br \/>\nrblstReplaceTokens.SelectedValue = CType(ModuleSettings(&#8220;TEXTHTML_ReplaceTokens&#8221;), Byte)<br \/>\n&#8212;<br \/>\nCoding for food<\/p>\n<p align=\"right\">\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"100%\">05-09-2008 12:38:56Trong frontend (giao di\u1ec7n tr\u00ecnh di\u1ec5n) \u0111\u1ec3 l\u1ea5y n\u1ed9i dung c\u1ee7a setting ch\u00fang ta c\u0169ng d\u00f9ngstring limits= Settings[&#8220;limits&#8221;].ToString();<br \/>\nR\u1ed3i hi\u1ec3n th\u1ecb m\u1ecdi th\u1ee9 b\u00ecnh th\u01b0\u1eddng nh\u01b0 code ASP.NET.Th\u00f4ng th\u01b0\u1eddng anh em ch\u00fang ta d\u00f9ng repeater v\u00e0 c\u00e1c th\u1ee9 Label, Datagridview &#8230; \u0111\u1ec3 hi\u1ec3n th\u1ecb n\u1ed9i dung c\u1ea7n l\u00e0m.<\/p>\n<p>\u0110\u1ec3 module ch\u1ea1y ngon, dll c\u1ea7n ph\u1ea3i copy v\u00e0o th\u01b0 m\u1ee5c \/dotnetnuke\/bin\/ c\u00f2n l\u00e0m th\u1ebf n\u00e0o th\u00ec anh em t\u1ef1 nghi\u00ean c\u1ee9u nh\u00e1.<\/p>\n<p>T\u1ee9c l\u00e0 ch\u00fang ta s\u1ebd c\u00f3 <strong>\/dotnetnuke\/bin\/module.dll<\/strong><\/p>\n<p>Nh\u01b0 v\u1eady l\u00e0 \u0111\u1ee7 ki\u1ebfn th\u1ee9c \u0111\u1ec3 vi\u1ebft nh\u1eefng module \u0111\u1ea7u ti\u00ean r\u1ed3i, v\u00ed d\u1ee5 module Hello world.<\/p>\n<p>\u0110\u1ec3 vi\u1ebft c\u1ea7n th\u1ef1c hi\u1ec7n<\/p>\n<p>1\/ t\u1ea1o file ascx : hello.ascx<br \/>\n2\/ t\u1ea1o module = hello -&gt; def = &#8220;hello&#8221; -&gt; control key = blank control = hello.ascx<br \/>\n3\/ d\u1ecbch module Hello ra file hello.dll<br \/>\n4\/ copy file hello.dll v\u00e0o <strong>\/dotnetnuke\/bin\/hello.dll<\/strong><br \/>\n5\/ ch\u1ecdn 1 page b\u1ea5t k\u1ef3 r\u1ed3i add module hello v\u00e0o trang \u0111\u00f3.<br \/>\n&#8212;<br \/>\nCoding for food<\/p>\n<p align=\"right\">\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"100%\">15-09-2008 04:46:41Anh \u01a1i, em c\u00f3 down m\u1ea5y s\u00e1ch dotnetnuke v\u1ec1 nh\u01b0ng n\u00f3 to\u00e0n ti\u1ebfng anh, v\u00e0 c\u00e1i ph\u1ea7n vi\u1ebft module c\u1ee7a ng\u01b0\u1eddi ta to\u00e0n th\u1ea5y vi\u1ebft c\u00e1c th\u01b0 vi\u1ec7n ph\u1ee5c v\u1ee5 v\u00e0o th\u01b0 m\u1ee5c app_code&#8230; c\u00f2n theo c\u00e1ch ti\u1ebfp c\u1eadn vi\u1ebft module c\u1ee7a anh th\u00ec t\u1ea1o ra m\u1ed9t project sau \u0111\u00f3 bi\u00ean d\u1ecbch v\u00e0 cop v\u00e0o, nh\u01b0ng em v\u1eabn m\u01a1 h\u1ed3 qu\u00e1, anh c\u00f3 th\u1ec3 h\u01b0\u1edbng d\u1eabn em m\u1ed9t c\u00e1ch ti\u1ebfp c\u1eadn \u0111\u1ec3 vi\u1ebft module tr\u00ean DNN, nh\u01b0 c\u00e1ch vi\u1ebft c\u00e1i CMS tr\u00ean forum c\u1ee7a m\u00ecnh ko a?Em c\u1ea3m \u01a1n anh tr\u01b0\u1edbc nh\u00e9!<\/p>\n<p align=\"right\">\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"100%\">26-02-2009 02:59:47Anh \u01a1i, em c\u00f3 down m\u1ea5y s\u00e1ch dotnetnuke v\u1ec1 nh\u01b0ng n\u00f3 to\u00e0n ti\u1ebfng anh, v\u00e0 c\u00e1i ph\u1ea7n vi\u1ebft module c\u1ee7a ng\u01b0\u1eddi ta to\u00e0n th\u1ea5y vi\u1ebft c\u00e1c th\u01b0 vi\u1ec7n ph\u1ee5c v\u1ee5 v\u00e0o th\u01b0 m\u1ee5c app_code&#8230; c\u00f2n theo c\u00e1ch ti\u1ebfp c\u1eadn vi\u1ebft module c\u1ee7a anh th\u00ec t\u1ea1o ra m\u1ed9t project sau \u0111\u00f3 bi\u00ean d\u1ecbch v\u00e0 cop v\u00e0o, nh\u01b0ng em v\u1eabn m\u01a1 h\u1ed3 qu\u00e1, anh c\u00f3 th\u1ec3 h\u01b0\u1edbng d\u1eabn em m\u1ed9t c\u00e1ch ti\u1ebfp c\u1eadn \u0111\u1ec3 vi\u1ebft module tr\u00ean DNN, nh\u01b0 c\u00e1ch vi\u1ebft c\u00e1i CMS tr\u00ean forum c\u1ee7a m\u00ecnh ko a?Em c\u1ea3m \u01a1n anh tr\u01b0\u1edbc nh\u00e9!<br \/>\nVi\u1ebft trong app_code th\u00ec m\u00ecnh code nhanh h\u01a1n do ko ph\u1ea3i build, m\u1ed7i l\u1ea7n ch\u1ea1y ch\u1ec9 vi\u1ec7c nh\u00e2n Ctrl+S l\u00e0 xong. Nh\u01b0ng c\u00e1ch n\u00e0y kh\u00f4ng ti\u1ec7n v\u00ec kh\u00f4ng ph\u00e2n ra \u0111\u01b0\u1ee3c c\u00e1c dll ri\u00eang r\u1ebd cho m\u1ed7i Project.<br \/>\nC\u00f2n vi\u1ebft theo ki\u1ec3u project th\u00ec build v\u00e0 ch\u1edd ch\u1ea1y h\u01a1i l\u00e2u nh\u01b0ng d\u1ec5 ki\u1ec3m so\u00e1t h\u01a1n v\u00ec m\u1ed7i project \u0111\u01b0\u1ee3c build th\u00e0nh 1 dll trong \\Bin<br \/>\n&#8212;<\/p>\n<p align=\"right\">\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"100%\">20-03-2009 05:19:31Nh\u00e2n ti\u1ec7n v\u1ea5n \u0111\u1ec1 vi\u1ebft module nh\u01b0 b\u1ea1n n\u00f3i \u1edf tr\u00ean c\u00f3 2 tr\u01b0\u1eddng h\u1ee3p,Cho m\u00ecnh h\u1ecfi c\u00e1i n\u00e0y nh\u00e9, m\u00ecnh m\u1edbi s\u1eed d\u1ee5ng DotNetNuke l\u1ea7n \u0111\u1ea7u ti\u00ean v\u00e0 m\u00ecnh s\u1eed d\u1ee5ng DotNetNuke 5.00.00.<br \/>\nM\u00ecnh th\u1ea5y vi\u1ebft module v\u00e0 add Module theo hai c\u00e1ch tr\u00ean \u0111\u1ec1u kh\u00f4ng \u1ed5n, n\u1ebfu vi\u1ebft module trong th\u01b0 m\u1ee5c App_code th\u00ec \u0111\u1eb1ng m\u00ecnh kh\u00f4ng t\u1ea1o \u0111\u01b0\u1ee3c ra dll do \u0111\u00f3 trong ph\u1ea7n codeb2 c\u1ee7a modle kh\u00f4ng debeg \u0111\u01b0\u1ee3c(l\u1ed7i The breakpoint currently will not be hit) v\u00e0 c\u00f2n vi\u1ebft code tr\u00ean project ri\u00eang r\u1ebd th\u00ec c\u0169ng add module \u0111\u01b0\u1ee3c v\u00ec c\u00e1c module n\u00f3 b\u1eaft ph\u1ea3i \u0111\u1eb7t trong th\u01b0 m\u1ee5c website\\DesktopModules do \u0111\u00f3 n\u1ebfu vi\u1ebft project ri\u00eang th\u00ec c\u0169ng kh\u00f4ng vi\u1ebft \u0111\u01b0\u1ee3c,<br \/>\nXin m\u1ecdi ng\u01b0\u1eddi gi\u00fap \u0111\u1ee1 nh\u00e9, ai c\u00f3 \u00fd ki\u1ebfn g\u00ec kh\u00f4ng nh\u1ec9?m\u00ecnh xin c\u00e1m \u01a1n nhi\u1ec1u.<br \/>\n&#8212;<\/p>\n<p align=\"right\">\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"100%\">20-03-2009 07:28:42Ch\u1ec9 c\u00f3 2 c\u00e1ch tr\u00ean<br \/>\nC\u00f2n c\u00e1ch n\u00e0o n\u1eefa \u0111\u00e2u<br \/>\nC\u1ea3 2 c\u00e1ch \u0111\u1ec1u debug \u0111\u01b0\u1ee3c h\u1ebft<br \/>\nKhi vi\u1ebft theo ki\u1ec3u project th\u00ec b\u1ea1n add existing website l\u00e0 local host tr\u01b0\u1edbc v\u00e0 \u0111\u1eb7t l\u00e0m start up project. Sau \u0111\u00f3 Add new project c\u1ee7a m\u00ecnh v\u00e0o<br \/>\nV\u1edbi m\u1ed7i project c\u1ee7a m\u00ecnh th\u00ec b\u1ea1n c\u1ea7n ch\u1ecdn th\u01b0 m\u1ee5c build c\u1ee7a project n\u1eb1m trong Bin c\u1ee7a dnn l\u00e0 xong. M\u1ed7i l\u1ea7n ch\u1ea1y \u1ea5n shift + f6 \u0111\u1ec3 d\u1ecbch. Sau \u0111\u00f3 v\u00e0o IE g\u00f5 \u0111\u1ecba ch\u1ec9 localhost ho\u1eb7c g\u00ec g\u00ec \u0111\u00f3. Mu\u1ed1n debug th\u00ec f5<br \/>\n&#8212;<br \/>\n<a href=\"http:\/\/www.yhoctuxa.vn\/\">http:\/\/www.yhoctuxa.vn\/<\/a><\/p>\n<p align=\"right\">\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"100%\">21-03-2009 03:31:08m\u00ecnh add module theo t\u1eebng c\u00e1ch m\u00e0 kh\u00f4ng \u0111\u01b0\u1ee3c, b\u1ea1n xem t\u1eebng b\u01b0\u1edbc m\u00ecnh l\u00e0m c\u00f3 g\u00ec sai kh\u00f4ng nh\u00e9 m\u00e0 sao m\u00ecnh kh\u00f4ng add \u0111\u01b0\u1ee3c module.<br \/>\nC\u00e0i IIS (Internet information service)<br \/>\n&#8211; C\u00e0i visual studio 2005<br \/>\n&#8211; C\u00e0i 2 b\u1ea3n Patch (v\u00e1 l\u1ed7i cho VS2005) theo \u0111\u00fang th\u1ee9 t\u1ef1<br \/>\n1\/ VS80-KB915364-X86-ENU.exe<br \/>\n2\/ WebApplicationProjectSetup.msi<br \/>\n&#8211; C\u00e0i \u0111\u1eb7t dotnetnuke 5.00.00 th\u00e0nh c\u00f4ng<br \/>\n&#8211; Open website tr\u00ean locallhost<br \/>\n\u0111\u1ebfn b\u01b0\u1edbc n\u00e0y coi nh\u01b0 l\u00e0 \u0111\u00e3 c\u00e0i \u0111\u1eb7t th\u00e0nh c\u00f4ng DNN 5.00.00 r\u1ed3i v\u00e0 m\u00ecnh add th\u00e0nh c\u00f4ng c\u00e1c module c\u00f3 s\u1eb5n trong DNN r\u1ed3i.C\u0169ng add th\u00e0nh c\u00f4ng modulle v\u00e0i l\u1ea7n nh\u01b0ng sau \u0111\u00f3 la\u1ecb kh\u00f4ng \u0111\u01b0\u1ee3c<br \/>\n* Th\u1eb1ng DNN 5.00 n\u00e0y c\u00f3 c\u1ea3 module template nh\u01b0ng trong di\u1ec5n \u0111\u00e0n kh\u00f4ng n\u00f3i \u0111\u1ebfn n\u00ean m\u00ecnh c\u0169ng kh\u00f4ng \u0111\u1ec1 c\u1eadp \u1edf \u0111\u00e2y, c\u00f2n Project m\u00ecnh add l\u00e0 Asp.Net Webplicationv\u00e0 sau \u0111\u00e2y l\u00e0 tr\u00ecnh t\u1ef1 c\u00e1c b\u01b0\u1edbc m\u00ecnh add module sau khi \u0111\u00e3 Open website DNN<br \/>\nB\u01b0\u1edbc 1:<br \/>\nv\u00e0o File -&gt; Add -&gt; New project<br \/>\nCh\u1ecdn ki\u1ec3u Project: Asp.Net Aplication<br \/>\nT\u00ean: Hello<br \/>\nLocation: &#8220;D:\\Hung Thinh\\Working Web\\DesktopModules&#8221;<br \/>\n&#8212;<\/p>\n<p align=\"right\">\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"100%\">21-03-2009 03:45:42B2: Xo\u00e1 file Default.aspx v\u00e0 file config trong Project HelloB3: Ch\u1ecdn \u0111\u01b0\u1eddng d\u1eabn Project Hello \u0111\u1eb7t v\u00e0o th\u01b0 m\u1ee5c bin trong Website DNN 5.00B4: Add Reference DotNetNuke.dll(ch\u1eafc ch\u1eafn ch\u1ec9 c\u1ea7n th\u1eb1ng n\u00e0y l\u00e0 \u0111\u1ee7)<\/p>\n<p>B5: Add control v\u00e0o Project Hello t\u00ean controll l\u00e0 Hello.ascx<\/p>\n<p>B6: Buile Project Hello<\/p>\n<p>=&gt; Build th\u00e0nh c\u00f4ng<\/p>\n<p>B\u01b0\u1edbc 7:F5 ch\u1ea1y website \u0111\u0103ng nh\u1eadp user Host th\u00e0nh c\u00f4ng<\/p>\n<p>B\u01b0\u1edbc 8:Ch\u1ecdn Host -&gt; Host Difinitions -&gt;ch\u1ecdn Create new Module<\/p>\n<p>B\u01b0\u1edbc 9: Next v\u00e0i l\u1ea7n Create new Module th\u00e0nh c\u00f4ng<\/p>\n<p>b\u01b0\u1edbc 10: Edit module v\u1eeba Creat New, th\u1ef1c hi\u1ec7n Add Difinition ,tr\u1ecf t\u1edbi \u0111\u01b0\u1eddng d\u1eabn control source)<\/p>\n<p>B\u01b0\u1edbc 11: Quay ra trang ch\u1ee7 t\u1ea1o m\u1ed9t trang b\u1ea5t k\u1ef3 Add Module.<\/p>\n<p>Trong combobox c\u00f3 t\u00ean module Hello hi\u1ec7n l\u00ean r\u1ed3i nh\u01b0ng khi add th\u00ec kh\u00f4ng th\u1ea5y n\u1eb1m l\u00ean trong trang<\/p>\n<p>c\u00f2n \u0111\u00e2y l\u00e0 to\u00e0n b\u1ed9 codeB2 c\u1ee7a control Helle<\/p>\n<p>Imports DotNetNuke<br \/>\nImports DotNetNuke.Services.Localization<br \/>\nImports DotNetNuke.Security<br \/>\nImports DotNetNuke.Security.Roles<br \/>\nImports System.Collections.Generic<\/p>\n<p>Partial Public Class Hello<br \/>\nInherits DotNetNuke.Entities.Modules.ModuleSettingsBase<br \/>\nImplements Entities.Modules.IActionable<\/p>\n<p>Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load<\/p>\n<p>End Sub<\/p>\n<p>#Region &#8220;Optional Interfaces&#8221;<\/p>\n<p>Public ReadOnly Property ModuleActions() As DotNetNuke.Entities.Modules.Actions.ModuleActionCollection Implements DotNetNuke.Entities.Modules.IActionable.ModuleActions<br \/>\nGet<br \/>\nDim Actions As New Entities.Modules.Actions.ModuleActionCollection<br \/>\nActions.Add(GetNextActionID, Localization.GetString(Entities.Modules.Actions.ModuleActionType.AddContent, LocalResourceFile), Entities.Modules.Actions.ModuleActionType.AddContent, &#8220;&#8221;, &#8220;&#8221;, EditUrl(), False, SecurityAccessLevel.Edit, True, False)<br \/>\nReturn Actions<br \/>\nEnd Get<br \/>\nEnd Property<\/p>\n<p>#End Region<\/p>\n<p>End Class<br \/>\n&#8212;<\/p>\n<p>M\u00ecnh \u0111\u00e3 m\u1ea5t kh\u00e1 nhi\u1ec1u th\u1eddi gian m\u00e0 kh\u00f4ng t\u00ecm \u0111\u01b0\u1ee3c ra l\u1ed7i n\u00e0y, b\u1ea1n xem m\u00ecnh l\u00e0m c\u00f3 thi\u1ebfu c\u00e1i g\u00ec kh\u00f4ng nh\u00e9, m\u00ecnh c\u1ea3m \u01a1n b\u1ea1n nhi\u1ec1u<\/p>\n<p align=\"right\">\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"100%\">23-03-2009 09:24:59B\u1ea1n nh\u1ea7m ch\u1ed7 nay<strong>Inherits DotNetNuke.Entities.Modules.ModuleSettingsBase<\/strong>Ph\u1ea3i l\u00e0<\/p>\n<p><strong>Inherits DotNetNuke.Entities.Modules.PortalModuleBase<\/strong><\/p>\n<p>Moi add duoc vao trang web<\/p>\n<p>Con cai ModuleSettingsBase chi danh cho settings th\u00f4i<\/p>\n<p>V\u1edbi l\u1ea1i b\u1ea1n vi\u1ebft code \u0111\u01a1n gi\u1ea3n th\u00f4i \u0111\u1ec3 c\u00f2n th\u1eed.<br \/>\nFile ascx<\/p>\n<p>&lt;%@ Control Language=&#8221;C#&#8221; AutoEventWireup=&#8221;true&#8221; CodeBehind=&#8221;hello.ascx.cs&#8221; Inherits=&#8221;helloworld.hello&#8221; %&gt;<br \/>\n&lt;asp:Label ID=&#8221;lblhello&#8221; runat=&#8221;server&#8221;&gt;&lt;\/asp:Label&gt;<\/p>\n<p>File cs<\/p>\n<p>using System;<br \/>\nusing System.Data;<br \/>\nusing System.Configuration;<br \/>\nusing System.Collections;<br \/>\nusing System.Web;<br \/>\nusing System.Web.Security;<br \/>\nusing System.Web.UI;<br \/>\nusing System.Web.UI.WebControls;<br \/>\nusing System.Web.UI.WebControls.WebParts;<br \/>\nusing System.Web.UI.HtmlControls;<\/p>\n<p>namespace helloworld<br \/>\n{<br \/>\npublic partial class hello : DotNetNuke.Entities.Modules.PortalModuleBase<br \/>\n{<br \/>\nprotected void Page_Load(object sender, EventArgs e)<br \/>\n{<br \/>\nlblhello.Text = &#8220;hello world&#8221;;<br \/>\n}<br \/>\n}<br \/>\n}<\/p>\n<p>Nh\u1edb th\u00eam n\u1eefa l\u00e0 khi c\u00e0i module th\u00ec ph\u1ea3i \u0111\u1eb7t key tr\u1eafng m\u1edbi hi\u1ec3n th\u1ecb tr\u00ean webpage \u0111\u01b0\u1ee3c<\/p>\n<p>Ch\u00fac b\u1ea1n vui v\u1ebb<\/p>\n<p align=\"right\">\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"100%\">23-03-2009 11:58:39c\u00e1m \u01a1n b\u1ea1n quanvd r\u1ea5t r\u1ea5t nhi\u1ec1u, nguy\u00ean nh\u00e2n c\u1ee7a m\u00ecnh l\u00e0 m\u00ecnh ko \u0111\u1eb7t key tr\u1eafng, ph\u1ea3i c\u00e1m \u01a1n b\u1ea1n nhi\u1ec1u l\u1eafm \u0111\u1ea5y v\u00ec c\u00e1i l\u1ed7i n\u00e0y ch\u1eafc ch\u1eb3ng bao gi\u1edd m\u00ecnh t\u00ecm \u0111\u01b0\u1ee3c ra.<br \/>\n&#8212;<\/p>\n<p align=\"right\">\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"100%\">02-04-2009 01:25:28Cho h\u1ecfi dnn h\u1ed7 tr\u1ee3 nh\u1eefng h\u1ec7 qu\u1ea3n tr\u1ecb CSDL n\u00e0o?<\/p>\n<p align=\"right\">\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"100%\">17-04-2009 02:21:08Chao moi nguoi .<br \/>\nMinh o tp HCM<br \/>\nMinh dang can 2 module DNN : quan ly tac vu &amp; quan ly cong van (ng\u00f4n ng\u1eef VB.NET v\u00e0 SQL Server)<br \/>\nGia ca thuong luong.<br \/>\nMoi chi tiet xin lien he : 0938411399 gap Tam<br \/>\n&#8212;<\/p>\n<p align=\"right\">\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"100%\">18-04-2009 01:17:38Chao moi nguoi .<br \/>\nMinh o tp HCM<br \/>\nMinh dang can 2 module DNN : quan ly tac vu &amp; quan ly cong van (ng\u00f4n ng\u1eef VB.NET v\u00e0 SQL Server)<br \/>\nGia ca thuong luong.<br \/>\nMoi chi tiet xin lien he : 0938411399 gap Tam<br \/>\n&#8212;B\u1ecdn m\u00ecnh \u1edf H\u00e0 N\u1ed9i. Kh\u00f4ng bi\u1ebft c\u00f3 h\u1ee3p t\u00e1c \u0111\u01b0\u1ee3c kh\u00f4ng ?<br \/>\n&#8212;<br \/>\n<a href=\"http:\/\/coder.awas.vn\" target=\"blank\">http:\/\/coder.awas.vn<\/a><br \/>\n<a href=\"http:\/\/mobile.awas.vn\" target=\"blank\">http:\/\/mobile.awas.vn<\/a><br \/>\n<a href=\"http:\/\/vtv.awas.vn\" target=\"blank\">http:\/\/vtv.awas.vn<\/a><br \/>\n<a href=\"http:\/\/baihatviet.awas.vn\" target=\"blank\">http:\/\/baihatviet.awas.vn<\/a><\/p>\n<p align=\"right\">\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"100%\">04-06-2009 02:40:41M\u00ecnh l\u00e0m th\u1ebf n\u00e0y:<br \/>\nC\u00e1ch \u0111\u1eb7t t\u00ean 1 module nh\u01b0 sau: [Tencongty].[Tenmodule], vd: Comeco.CMS1. New 1 Project (Asp.Net Web Application), ch\u1ecdn \u0111\u01b0\u1eddng d\u1eabn l\u01b0u d\u1ef1 \u00e1n t\u1ea1i &#8230;.\\DesktopModules\\CMS2. V\u00e0o properties of d\u1ef1 \u00e1n v\u1eeba t\u1ea1o \u0111\u1ec3:<br \/>\n&#8211; set ngay n\u01a1i l\u01b0u c\u00e1i dll s\u1ebd bi\u00ean d\u1ecbch v\u00e0o &#8230;&#8230;\\Website\\Bin<br \/>\n&#8211; S\u1eeda t\u00ean Assembly th\u00e0nh [Tenconty].Modules.[Tenmodule], vd: Comeco.Modules.CMS<\/p>\n<p>3. References t\u1edbi 2 c\u00e1i dll l\u00e0: DotNetNuke.dll v\u00e0 Microsoft.ApplicationBlocks.Data.dll<\/p>\n<p>4. X\u00f3a 2 c\u00e1i file default.aspx v\u00e0 web.config<\/p>\n<p>Ti\u1ebfp theo l\u00e0 t\u1ea1o module d\u1ef1a theo c\u00e1ch l\u00e0m of DNN&#8230;<\/p>\n<p>C\u1ea3m \u01a1n b\u00e1c aspnet, b\u00e1c r\u1ea5t nhi\u1ec7t t\u00ecnh!<br \/>\n&#8212;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>04-09-2008 11:31:48M\u1ed9t v\u00e0i kh\u00e1i ni\u1ec7m \u0111\u1ec3 th\u00f4ng su\u1ed1t ph\u00e1t tri\u1ec3n module dotnetnuke c\u00f3 ngh\u0129a l\u00e0 l\u00e0m c\u00e1i g\u00ec nh\u01b0 th\u1ebf n\u00e0o, k\u1ebft qu\u1ea3 ra sao ? T\u00fam l\u1ea1i \u0111\u01a1n gi\u1ea3n l\u00e0 th\u1ebf n\u00e0y : &#8211; Dotnetnuke l\u00e0 1 c\u1ed5ng th\u00f4ng tin portal. &#8211; C\u00e1c y\u1ebfu t\u1ed1 c\u01a1 b\u1ea3n c\u1ee7a portal (c\u1ed5ng th\u00f4ng tin) + website [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"k%e1%bb%b9-thu%e1%ba%adt","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-2024","post","type-post","status-publish","format-k-thut","hentry","category-k-thut","post_format-k-thut"],"_links":{"self":[{"href":"https:\/\/dongson.info\/index.php?rest_route=\/wp\/v2\/posts\/2024","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dongson.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dongson.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dongson.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dongson.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2024"}],"version-history":[{"count":6,"href":"https:\/\/dongson.info\/index.php?rest_route=\/wp\/v2\/posts\/2024\/revisions"}],"predecessor-version":[{"id":2031,"href":"https:\/\/dongson.info\/index.php?rest_route=\/wp\/v2\/posts\/2024\/revisions\/2031"}],"wp:attachment":[{"href":"https:\/\/dongson.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2024"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dongson.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2024"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dongson.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2024"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}