You need to Register for free and Login to post a message in the forum.

Forum

Subject: Add a dnn page by program
Prev Next
You are not authorized to post a reply.

Author Messages
thtang
Nuke Ace
Nuke Ace
Posts:54

04 Mar 2007 7:32 AM  
 

I would like to write a program to create a page with a text/html module (with text and images).

I have insert query in the following tables

Dim addSQL As SqlCommand
        Dim addTagSQL As SqlCommand

        Dim addTagMSQL As SqlCommand
        addTagSQL = New SqlCommand("insert into Tabs (TabOrder, PortalID, TabName, IsVisible, ParentID, Level, DisableLink, Title, IsDeleted, TabPath) values (3,0,'newsletter','true', 36,1,'False','Newsletter sent','False', '//Home//newsletter');select scope_identity()", DBConn)
        Dim tab_id As Int32 = Convert.ToInt32(addTagSQL.ExecuteScalar())

        Dim addModuleSQL As SqlCommand
        addModuleSQL = New SqlCommand("insert into Modules (ModuleDefID, ModuleTitle, AllTabs, IsDeleted, InheritViewPermissions, PortalID) values (96, 'MLHTML', 'False', 'False', 'True', 0);select scope_identity()", DBConn)
        Dim module_id As Int32 = Convert.ToInt32(addModuleSQL.ExecuteScalar())


        addTagMSQL = New SqlCommand("insert into TabModules (TabID, ModuleID, PaneName, ModuleOrder, CacheTime, Visibility, DisplayTitle, DisplayPrint, DisplaySyndicate) values (" & tab_id & ", " & module_id & ", 'ContentPane', 1,0,0, 'True', 'True', 'False')", DBConn)
        addTagMSQL.ExecuteScalar()


        addSQL = New SqlCommand("insert into Apollo_MLHTML(ModuleID, Locale, DesktopHTML, CreatedByUser, CreatedDate) values (" & module_id & ", 'en-US', '" & Me.editor.Value & "', " & "1, '" & Date.Now.ToShortDateString & "')", DBConn)
        addSQL.ExecuteScalar()

        addSQL.Dispose()
        DBConn.Dispose()

I can create a page with a module successfully. However, when i delete the page, it has errors and i checked the database, the records in tabs, tabsModule, Modules, apollo_mlhtml still exist. I would like to know if there are anything missing in the procedures?

Thank you

You are not authorized to post a reply.
Forums > DotNetNuke® > DotNetNuke® Questions > Add a dnn page by program



ActiveForums 3.7

Latest Forum Posts

Need UK Hosting by Liz
Hi,Not sure if this is the right place, but I am currently with Power DNN, and whilst I am a big fan...
RE: search not working by sanju_k1421
host==>admin search page that is set both limits min //max page reindex content button is ...
RE: No Access for me too by leesykes
hello,I have fixed the problem and I have given you a years access beginning from today December 2nd...
old skins for DNN 4.9.0 ? by clippy
Hello from France My question is about the videos for beginners, and specially n° 3; I'm working...
Web.config Error by derpir
HelloI got this error, does this seem familiar to you? Can anyone say how to fix this error?Error 98...
No Access for me too by ristori
I suscribe for the magazine novembre 2008 13. I receive this ticket from Paypal : Prix de l...
How can I list our offices by country by bluehoops
Hi everyone!Apologies if this is a simple question, but it is driving me nuts.I run a small ISV and ...
RE: DNN Creative vs FireFoX V3 by DavidWSnow
It now looks like the error'ing extension is StumbleUpon and it effects FireFox on some, but not all...
Issue 39 Authentication by DavidWSnow
I was glad to see you address this topic. When LiveId was first added to DNN, I tried to implement i...
RE: (catalook) Itempane changes on product pages ?? by Vilaplana
Hi, I think the problem is been caused by your skin and not by Catalook itself.  In the main page, C...
Yahoo Answers by cdtguru
Hey, i was wondering if anyone knew of a module that would create a similar system to Yahoo Answers...
(catalook) Itempane changes on product pages ?? by Gaz35
Hi , hi , I don’t know if you can help me , here is the site in question http...
RE: Virtual Pc 2007 help by jeff@zina.com
You need to get the Virtual PC's network set up.  Might check the Virtual PC news group: http://www...
DNNCreative Just Keeps Getting Better by jeff@zina.com
Kudos on issue 39, the article on importing large quantities of data was both timely for me and spot...
RE: Videos by clippy
Hello from France My question is about the videos for beginners, and specially n° 3; I'm working...
skinning trouble by derpir
HelloI have uploaded a skin to my DNN-website, but I want to make som changes. I have made some chan...
RE: Column width in UDT by VickySwift
In case anyone else is looking for the answer to this, I have been able to add the headers back in b...
RE: search not working by jncraig
Did you either reindex the site to turn on the scheduled task to do it?
RE: Template Issue by jncraig
No, you need to install your custom modules before you use the template.
RE: error message in registration page by jncraig
I'm not sure that you can avoid them, short of rewriting the module.You might want to investigate Dy...
DotNetNuke Modules
RSS Feeds