Search Forum
(57415 Postings)
Search Site/Articles

Archived Articles
712 Articles

C# Books
C# Consultants
What Is C#?
Download Compiler
Code Archive
Archived Articles
Advertise
Contribute
C# Jobs
Beginners Tutorial
C# Contractors
C# Consulting
Links
C# Manual
Contact Us
Legal

GoDiagram for .NET from Northwoods Software www.nwoods.com


              
Printable Version

IBuySpy Portal TextModule with C#
By Waheed Khan

Source code:  TextModule.zip

Requirements: .NET Framework 1.0/1.1

Level: Beginners to Intermediate
            Experience with IBuySpy Portal Framework.

Note: Click on image to enlarge them

 

Introduction:

What exactly is the Text Module for? IBuySpy Portal has an HtmlModule, which stores html content into a database. TextModule stores html content to the text file, and text file path into database. The reason for implementing this module is to minimize the traffic to the backend database SQL server and to avoid storing large html content into database. This module will also work with MS Access Database.

 

Implementation:

I'm assuming you should have some experience with IBuySpy Portal Framework, if not then follow these steps you should be able to install custom modules with IBuySpy Portal Framework.

1. Download the zip file and unzip in to the Temp folder.

2. Create the Text Folder under IBuySpy Portal folder (click here  to see the image).

3. Apply the security to the text folder (see security section).

4. From the zip file under DesktopModules folder, copy all these "EditTextModule.aspx, EditTextModule.aspx.cs, TextModule.ascx, TextModule.ascx.cs" files to the IBuySpy Portal DesktopModules Folder.

5. With all other files in a portal you should have these files "EditTextModule.aspx, EditTextModule.aspx.cs, TextModule.ascx, TextModule.ascx.cs" in a DesktopModules folder.

6. Compile and build your application.

7. Log In to the IBuySpy Portal with Admin access, go to Admin section and click on "Add New Module Type" and add TextModule module to the Portal Database (click here  to see the image). When you add a module to the database it is actually adding a module to the database table "ModuleDefinitions" (click here  to see the image).

8. Decide where and under which tab you want to setup this module. Go to database table "Modules" and setup your TextModule module (click here  to see the image).

9. With Admin access you should be able to edit the module settings (click here  to see the image) Add the path to the text file or html file and html content, update the changes and you are set to go. Take a look under the Text folder and you will see the text file has been created or updated, and if you look at the database table "Modulesettings" you will see the path to the text file (click here  to see the image).

10. Make sure you understand the relationship between "Modules", "Modulesettings", and "ModuleDefinitions" (click here  to see the image for relationships)

11. For an example I have included these files "honda.gif, kawasaki.gif, honda.htm, honda.txt, kawasaki.htm, and kawasaki.txt" under the Text Folder in a zip file.

ASP.NET pages will look like this. I have added this module to "Home and Product Info Tabs" (click on the image to enlarge it )

and

 

Security:

In IIS make sure you have read/write access to Text folder. (click here  to see the image). Also make sure ASP.NET account has a read/write/modify access to the Text folder. This access can be changed by right clicking on the Text folder in a Windows explorer (click here  to see the image).

 

Source Code:

This source code was compiled with .NET Framework 1.1 and Visual Studio .NET 2003

1. EditTextModule.aspx.htm

2. EditTextModule.aspx.cs.htm

3. TextModule.ascx.htm

4. TextModule.ascx.cs.htm

 

Reference: IBuySpy site www.asp.net

 


About the Author :

Waheed Khan is currently working with .NET Framework, SQL server 2000/7.0, C# language, ASP.NET, ADO.NET, XML, VB.NET and Visual Studio .NET in Windows 2003 server/2000 Server & professional. Also working towards to learn Mono in Linux environment and Borland C# Builder for .NET Framework.