This document provides instructions for creating a DotNetNuke module using LINQ to SQL. It describes setting up the development environment with DotNetNuke and Visual Studio, creating a database table, generating a LINQ to SQL class to access the database, and building the module interface with ASP.NET controls bound to a LINQ data source. The module allows users to view, insert, update and delete records in the database table through a GridView and FormView control.
This paper’s aim is to point out the RAD ( Rapid application development) elements present in the Microsoft’s MVC 3 and WCF 4.0 using Microsoft Visual Studio 2010. It will describe why creating a new web application using MVC 3 and WCF 4.0 is a easy and fast and also present simple ways to develop such applications.
Chapter 2 — Program and Graphical User Interface Designfrancopw
Chapter 2 introduces students to the major elements of the Visual Studio 2010 integrated development environment (IDE) while designing a graphical user interface mock-up. Topics include opening Visual Studio 2010, creating a Windows Forms Application project,adding objects to a Windows form, assigning properties to objects,aligning objects on the Windows form,and saving Visual Basic projects. The chapter also discusses how to apply GUI design principles and examines the first two phases of the program development life cycle (PDLC).
This paper’s aim is to point out the RAD ( Rapid application development) elements present in the Microsoft’s MVC 3 and WCF 4.0 using Microsoft Visual Studio 2010. It will describe why creating a new web application using MVC 3 and WCF 4.0 is a easy and fast and also present simple ways to develop such applications.
Chapter 2 — Program and Graphical User Interface Designfrancopw
Chapter 2 introduces students to the major elements of the Visual Studio 2010 integrated development environment (IDE) while designing a graphical user interface mock-up. Topics include opening Visual Studio 2010, creating a Windows Forms Application project,adding objects to a Windows form, assigning properties to objects,aligning objects on the Windows form,and saving Visual Basic projects. The chapter also discusses how to apply GUI design principles and examines the first two phases of the program development life cycle (PDLC).
Open microsoft visual studio/tutorialoutletMitchinson
FOR MORE CLASSES VISIT
tutorialoutletdotcom
1. Open Microsoft Visual Studio.NET.
2. Open the PayrollSystem website by clicking on it in the Recent Projects list, or by pulling down the File menu, selecting Open Website, navigating to the folder where you previously saved the PayrollSystem, and clicking Open.
Using prime[31] to connect your unity game to azure mobile servicesDavid Voyles
Using prime[31] to connect your unity game to azure mobile services. More info at my blog: http://davevoyles.azurewebsites.net/prime31-azure-plugin-win8-wp8-unity-games-part-3/
The tutorial describes the following topics in detail
CREATING AN ADF APPLICATION
DEPLOYING & RUNNING ADF APPLICATION ON WEBLOGIC SERVER
ADF DATA VISUALIZATION COMPONENTS
CREATING MORE COMPLEX BUSINESS COMPONENTS
CREATING MULTIPLE PAGE WEBSITES – PAGE FLOWS
CREATING JEE5 STATELESS SESSION EJBS
CREATING JAX-WS WEB SERVICES
ADDING THE NEW SERVICES INTO THE ADF APPLICATION
DATA VALIDATION (OPTIONAL)
Tutorial on how to load images in crystal reports dynamically using visual ba...Aeric Poon
This tutorial will show you how to create a Visual Basic 6 project which will generate a report using Seagate Crystal Reports 8.5 Developer Edition. You will save the path of the image files in a MS Access database where it is protected by password. This project will use an external Crystal Report file and will be previewed using Crystal Viewer control.
This Article explores the Test Automation challenges associated with the GridGain Control Centre (https://www.gridgain.com/).
The test framework is based on BDD/Selenide/Java/IntelliJ.
The exploratory tests look at five key User Journeys in the application.
Previous weeks work has been uploaded as well as any other pieces ne.docxkeilenettie
Previous weeks work has been uploaded as well as any other pieces needed.
Deliverables
All files are located in the subdirectory of the project. The project should function as specified: When you visit the Personnel form page (frmPersonnel.aspx), a record should be saved in the tblUserActivity table with the IP address, form name accessed (frmPersonnel), and the date accessed. When you click the View Activity button, you should see at least one record with this information. When the user goes to the frmPersonnel web form and enters data, the following business rules are to be enforced.
Fields may not be empty or filled with spaces. If any field is empty, turn that field background color to yellow and add to/create an error message to be shown in the error label.
The end date must be greater than the start date. If the end date is less than the start date turn both date fields yellow and add to/create an error message to be shown in the error label.
If all fields validate properly, then the session state items should be set properly and the user should see the frmPersonnelVerified form with all the values displayed. You will also add a new item to frmMain that will take the user to the new frmUserActivity form you added. Add the proper link and a hyperlinked image to allow the user to select this new option. Once you have verified that everything works, save your website, zip up all files, and submit it.
STEP 1: Step Title
1. Open Microsoft Visual Studio.NET.
2. Open the PayrollSystem website by clicking on it in the Recent Projects list, or by pulling down the File menu, selecting Open Website, navigating to the folder where you previously saved the PayrollSystem, and clicking Open.
3. Download the PayrollSystem_DB.accdb file from the Files section and save it on your local computer. (Note: your operating system may lock or block the file. Once you have copied it locally, right click on the file and select Properties and then Unblock if available). Then add it to the PayrollSystem website as follows: In Visual Studio, in the
Solution
Explorer click Website, Add Existing Item, then navigate to the PayrollSystem_DB.accdb file you downloaded, and click the Add button.
Make sure you select file types, which include *.accdb, *.accdb, etc. Otherwise, you will not be able to see the database file to select.
4. Now we need to create a new connection to the PayrollSystem_DB.accdb. To begin, click View Server Explorer.
5. When the Server Explorer toolbox appears, click the Connect to Database button.
6. When the Add Connection dialog appears, click the Change button. In the Change Data Source dialog, select MS Access Database File; Uncheck Always use this Selection; then click OK.
Press Continue to get the following screen.
7. Click the Browse button to navigate to the PayrollSystem_DB.accdb file in your website folder, then click Open. (NOTE: Be sure you select the PayrollSystem_DB.accdb file in your PayrollSystem website folder ...
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Creating a dot netnuke
1. Creating a DotNetNuke® Module using LINQ
to SQL
By defwebserver | 24 Jan 2008 | Unedited contribution
.NET3.5ASPASP.NETJavascriptCSS.NETHTMLDevAjaxLINQ
This tutorial will show you how to create a DotNetNuke module using LINQ to SQL.
Part of The HTML5 / CSS3 Zone
See Also
• More like this
• More by this author
Article Browse Code Stats Revisions Alternatives
4.61 (10 votes)
30
• Download LinqThings4Sale_01 - 5 KB
To use this tutorial you need:
1. Visual Studio Visual Web Developer Express 2008 (download) or Visual Studio
2008
2. DotNetNuke (download)
3. ASP.NET 3.5 (or higher) (download)
This tutorial will show you how to create a DotNetNuke module using LINQ to SQL.
This will greatly speed module development.
Also see:
Creating a DotNetNuke Module using LINQ to SQL (Part 2)
2. SETUP
Follow one of the the options below to install DotNetNuke and to create a
DotNetNuke Website:
Setting-up the Development Environment (using IIS)
Setting-up the Development Environment (without IIS)
Setting-up the Development Environment on Windows Vista (using IIS)
Install Visual Studio Express 2008 if you haven't already done so. (download)
Use Visual Studio 2008 to open DotNetNuke:
If using DotNetNuke 4.7 or lower, you will get a message like this:
Click Yes. This will add the needed changes to the web.config to allow LINQ to SQL to
run.
In Visual Studio, select "Build" then "Build Solution". You must be able to build it
without errors before you continue. Warnings are ok.
Are you Ready to Create the Module?
You must have a DotNetNuke 4 website up and running to continue. If you do not
you can use this link and this link to find help.
3. DotNetNuke is constantly changing as it evolves so the best way to get up-to-date
help and information is to use theDotNetNuke message board.
Create the Table
Log into the website using the Host account.
Click on the HOST menu and select SQL
Paste the following script into the box:
Collapse | Copy Code
CREATE TABLE ThingsForSale (
[ID] [int] IDENTITY(1,1) NOT NULL,
[ModuleId] [int] NOT NULL,
[UserID] [int] NULL,
[Category] [nvarchar](25),
[Description] [nvarchar](500),
[Price] [float] NULL
) ON [PRIMARY]
ALTER TABLE ThingsForSale ADD
CONSTRAINT [PK_ThingsForSale] PRIMARY KEY CLUSTERED
([ID]) ON [PRIMARY]
4. Select the "Run as Script" box and click "Execute".
Set Up The Module
If you haven't already opened the DotNetNuke site in Visual Studio (or Visual Web
Developer Express), select Filethen Open Web Site.
Select the root of the DotNetNuke site and click the Open button.
Right-click on the App_Code folder and select New Folder.
5. Name the folder LinqThings4Sale.
In the Solution Explorer, double-click on the web.config file to open it.
In the web.config file add the line:
<add directoryName="LinqThings4Sale" />
to the <codeSubDirectories> section. This is done to instruct ASP.NET that there
will be code created in a language other than VB.NET (which is the language of the
main DotNetNuke project).
Right-click on the App_Code folder and select Refresh Folder.
The LinqThings4Sale folder icon will now change to indicate that the folder is now
recognized as a special folder.
6. Create the LINQ to SQL Class
Right-click on the LinqThings4Sale directory located under
the App_Code directory and select Add New Item.
In the Add New Item window, select the LINQ to SQL Classes template,
enter LinqThings4Sale.dbml for theName and select Visual C# for
the Language. Click the Add button.
Wait a few minutes and the Object Relational Designer will open in the Edit
window.
7. From the toolbar, select View then Server Explorer.
In the Server Explorer, right-click on the root node (Data Connections) and
select Add Connection.
Enter the information to connect to the database the DotNetNuke site is running on.
This will not be the connection that the module will use when it runs (you will set
that connection in a later step). This is only a connection to allow you to use
the Object Relational Designer.Click the OK button.
8. When the connection shows up in the Server Explorer, click the plus icon to expand
it's object tree to display the tables.
9. Locate the ThingsForSale table.
Click on it and drag and drop it on the Object Relational Designer panel on the
left.
Click anywhere in the white space on the Object Relational Designer panel so that
theLinqThings4SaleDataContext properties show in the Properties window (you
can also select it from the drop-down in the properties window).
In the Connection drop-down select SiteSqlServer (Web.config). This instructs the
class to use the connection string of the DotNetNuke site that it is running on.
10. The connection properties should resemble the graphic on the right.
Close the LinqThings4Sale.dbl file. You should see a confirmation screen asking
you to save it. Click the Yes button.
11. The Data Access layer is now complete.
Create The Module
In the Solution Explorer, Right-click on the DesktopModules folder and
select New Folder.
Name the folder LinqThings4Sale.
Right-click on the LinqThings4Sale folder and select Add New Item.
12. From the Add New Item box, select the Web User Control template,
enter View.ascx for the Name, select Visual C# for the Language, and check the
box next to Place code in separate file.
When the View.ascx page opens, switch to source view and locate
the Inherits line.
Change it to:
DotNetNuke.Modules.LinqThings4Sale.View
Save the file.
Click the plus icon next to the View.ascx file in the Solution Explorer (under the
LinqThings4Sale directory) Double-click on the View.ascx.cs file to open it.
13. Replace all the code with the following code:
Collapse | Copy Code
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using DotNetNuke;
using DotNetNuke.Security;
using LinqThings4Sale;
namespace DotNetNuke.Modules.LinqThings4Sale
{
public partial class View : DotNetNuke.Entities.Modules.PortalModuleBase
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
14. Save the file. From the Toolbar, select Build then Build Page. The page should
build without errors.
Switch to the View.ascx file and switch to the Design View. From the Toolbox, in
the Data section, select theLinqDataSource control.
Drag the LinqDataSource control to the design surface of the View.ascx page.
Click on the options (right-arrow on the right side of the control) and
select Configure Data Source.
15. In the Configure Data Source box,
select LinqThings4Sale.LinqThings4SaleDataContext in the drop-down and click
the Next button.
The Configure Data Selection screen will show. Leave the default options.
16. Click the Where button.
On the Configure Where Expression screen:
• Select ModuleId in the Column drop-down
• Select = = in the Operator drop-down
• Select None for the Source drop-down
Click the Add button.
17. This instructs the LinqDataSource control to filter the results by ModuleId. Each
new instance of the module will have a different ModuleId. We will pass
this ModuleId to the LinqDataSource control in the code behind in a later
step. Click the OK button.
19. On the options for the LinqDataSource control, check the box next to Enable
Delete, Enable Insert, and Enable Update.
Drag a GiridView control from the Toolbox and place it under
the LinqDataSource conrol. On the options for theGridView control,
select LinqDataSource1 from the Choose Data Source drop-down.
The GridView will bind to the data source and create columns for the fields in the
table.
20. On the options for the GridView control, check the box next to Enable
Paging, Enable Sorting, Enable Editing, and Enable Deleting.
On the options for the GridView control, click the Edit Columns link.
21. Select the ID column in the Selected Fields section, and under
the BoundField properties section, change Visibleto False. Do the same for
the ModuleId and UserID fields. Click the OK button.
The GridView will now resemble the image on the right.
22. Drag a FormView control to the design surface and place it a few spaces below
the GridView (you will have to place a LinkButton control between them in a later
step).
On the options for the FormView control, select LinqDataSource1 on the Choose
Data Source drop-down. Click the Edit Templates link.
23. On the options for the FormView control, select InsertItem Template on
the Display
drop-down.
Switch to source view and replace the InsertItemTemplate section with the
following code:
Collapse | Copy Code
<InsertItemTemplate>
Category: <asp:DropDownList ID="DropDownList1" runat="server"
DataSource='<%# Eval("Category") %>'
SelectedValue='<%# Bind("Category") %>' EnableViewState="False">
<asp:ListItem>Home</asp:ListItem>
<asp:ListItem>Office</asp:ListItem>
<asp:ListItem>Electronics</asp:ListItem>
<asp:ListItem>Misc.</asp:ListItem>
</asp:DropDownList>
Price: $
<asp:TextBox ID="PriceTextBox" runat="server" Text='<%# Bind("Price")
%>' Width="56px"
CausesValidation="True" EnableViewState="False"></asp:TextBox><br />
<asp:RangeValidator ID="RangeValidator1" runat="server"
ControlToValidate="PriceTextBox"
ErrorMessage="Price must be greater than 0" MaximumValue="99999"
MinimumValue="1"></asp:RangeValidator>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="PriceTextBox"
ErrorMessage="A price is required"></asp:RequiredFieldValidator><br />
Description:<br />
<asp:TextBox ID="DescriptionTextBox" runat="server" Text='<%#
Bind("Description") %>'
MaxLength="499" TextMode="MultiLine" Width="286px"
EnableViewState="False"></asp:TextBox><br
/>
<asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True"
CommandName="Insert"
Text="Insert" OnClick="InsertButton_Click"></asp:LinkButton>
<asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False"
CommandName="Cancel"
Text="Cancel" OnClick="InsertCancelButton_Click"></asp:LinkButton>
24. </InsertItemTemplate>
Switch to design view, Select Edit Templates and then select InsertItem
Template and the form will resemble the image on the right.
On the options for the FormView control, click on End Template Editing.
25. In the Properties for the FormView, set the DefaultMode to Insert.
Also, in the Properties for the FormView, set Visible to False.
In the ToolBox, click on the LinkButton control.
26. Drag the control to the design surface and drop it between the GridView and
the FormView.
In the properties for the LinkButton (if you have a hard time selecting the
properties, switch to source view and double-click on "<asp:LinkButton"), set
the Text to Add My Listing.
Create the Code Behind
The View.ascx file should now resemble the image on the right. A few code behind
methods are now required to complete the module.
27. Code Behind for the LinqDataSource Control
We want to alter the behavior of the LinqDataSource control so that it only shows
the records for this particular instance of the module. In addition, when inserting a
record we want to insert the current ModuleId and the currentUserID. Right-click
on the LinqDataSource control and select Properties. The properties will show up
in theProperties window (if it doesn't, switch to source view and click
on "<asp:LinqDataSource").
28. Click on the yellow "lighting bolt" to switch to the "events" for the control
On the Inserted row type LinqDataSource1_Inserted and click away (or you can
just double-click in the box and the name will be inserted for you).
29. A method will be automatically "wired-up".
Add code so the method reads:
Collapse | Copy Code
protected void LinqDataSource1_Inserted(object sender,
LinqDataSourceStatusEventArgs e)
{
this.GridView1.DataBind();
}
(this method instructs the GridView to refresh itself after a record has been
inserted) On the Inserting row typeLinqDataSource1_Inserting and click away.
30. Add code so the method reads:
Collapse | Copy Code
protected void LinqDataSource1_Inserting(object sender,
LinqDataSourceInsertEventArgs e)
{
ThingsForSale ThingsForSale = (ThingsForSale)e.NewObject;
ThingsForSale.UserID =
Entities.Users.UserController.GetCurrentUserInfo().UserID;
ThingsForSale.ModuleId = ModuleId;
}
(this method casts "e" which is an instance of the object containing the data about to
be inserted, as a ThingsForSale object. It then sets the UserID and the
ModuleId. ) On the Selecting row typeLinqDataSource1_Selecting and click
away.
Add code so the method reads:
Collapse | Copy Code
protected void LinqDataSource1_Selecting(object sender,
LinqDataSourceSelectEventArgs e)
{
e.WhereParameters["ModuleId"] = ModuleId;
}
(this method passes the current ModuleId to the LinqDataSource control. You will
recall that a where clause was defined to expect a ModuleId to be passed.)
Code Behind for the Add My Listing link
Double-click on the Add My Listing link.
31. Add code so the method reads:
Collapse | Copy Code
protected void LinkButton1_Click(object sender, EventArgs e)
{
this.FormView1.Visible = true;
this.GridView1.DataBind();
}
(this method makes the entry form visible. )
Code Behind for the GridView
Right-click on the GridView control and select Properties. The properties will show
up in the Properties window (if it doesn't, switch to source view and click
on "<asp:GridView"). Switch to events and enterGridView1_RowDataBound for
the RowDataBound row and click away.
Add code so the method reads:
Collapse | Copy Code
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if ((e.Row.RowType == DataControlRowType.DataRow))
{
ThingsForSale ThingsForSale = ((ThingsForSale)(e.Row.DataItem));
if ((PortalSecurity.IsInRole("Administrators"))
|| (Entities.Users.UserController.GetCurrentUserInfo().UserID ==
(int)ThingsForSale.UserID))
{
e.Row.Cells[0].Enabled = true;
32. }
else
{
e.Row.Cells[0].Text = " ";
}
}
}
(this method casts "e" which is an instance of the object that contains the data for
the current row, as a ThingsForSale object. It then compares the UserID to the
UserID of the current user. If the UserID matches the current user or the current
user is an administrator it enables the first column on the GridView (this allows a
user to edit the row)).
Add Additional Methods to the Code behind
Add these two methods to the code behind:
Collapse | Copy Code
protected void InsertButton_Click(object sender, EventArgs e)
{
this.FormView1.Visible = false;
LinkButton1.Text = "Update Successful - Add Another Listing";
this.GridView1.DataBind();
}
protected void InsertCancelButton_Click(object sender, EventArgs e)
{
this.FormView1.Visible = false;
this.GridView1.DataBind();
}
(The events for these two methods was created when the code was pasted in the
earlier step) Alter thePage_Load method in the code behind so it reads:
Collapse | Copy Code
protected void Page_Load(object sender, EventArgs e)
{
if ((PortalSecurity.IsInRole("Registered Users") ||
PortalSecurity.IsInRole("Administrators")))
{
LinkButton1.Enabled = true;
}
else
{
LinkButton1.Text = "You must be logged in to add a Listing";
LinkButton1.Enabled = false;
}
}
(This code determines if the user is logged in and displays the Add Listing link if they
are).
Save the file. From the Toolbar, select Build then Build Page. The page should
build without errors.
33. Create The Module Definition
While logged into your DotNetNuke site as "host", in the web browser, from the
menu bar select "Host". Then select "Module Definitions".
Click the black arrow that is pointing down to make the fly-out menu to appear. On
that menu select "Create Module Definition".
In the Edit Module Definitions menu:
• Enter "LinqThings4Sale" for MODULE NAME
• Enter "LinqThings4Sale" for FOLDER TITLE
• Enter "LinqThings4Sale" for FRIENDLY NAME
• Enter "LinqThings4Sale" for DESCRIPTION
• Enter "01.00.00" for VERSION
Then click UPDATE
34. Enter "LinqThings4Sale" for NEW DEFINITION Then click "Add Definition"
Next, click "Add Control"
In the Edit Module Control menu:
35. • Enter "LinqThings4Sale" for TITLE
• Use the drop-down to select "DesktopModules/LinqThings4Sale/View.ascx"
for SOURCE
• Use the drop-down to select "View" for TYPE
Then click UPDATE
In the upper left hand corner of the website, under the PAGE FUNCTIONS menu
click ADD.
In the PAGE MANAGEMENT menu under PAGE DETAILS:
• Enter "LinqThings4Sale" for PAGE NAME
• Enter "LinqThings4Sale" for PAGE TITLE
• Enter "LinqThings4Sale" for DESCRIPTION
• Click the VIEW PAGE box next to ALL USERS
Then click UPDATE
36. From the MODULE drop-down select "LinqThings4Sale".
Then click ADD.
37. The module will now appear.
The tutorial is complete.
Note: In order to run this module on another DotNetNuke site, you need to install
ASP.NET 3.5 on the server and modify the web.config of the DotNetNuke site:
Change: the <system.codedom> section to:
Collapse | Copy Code
<system.codedom>
<compilers>
<compiler language="vb;vbs;visualbasic;vbscript"
type="Microsoft.VisualBasic.VBCodeProvider, System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
extension=".vb" warningLevel="4">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="OptionInfer" value="true"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
<compiler language="c#;cs;csharp" extension=".cs"
type="Microsoft.CSharp.CSharpCodeProvider,System,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
warningLevel="4">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>
Change: the <assemblies> section to:
Collapse | Copy Code
<assemblies>
<add assembly="Microsoft.VisualBasic,
Version=8.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A" />
38. <add assembly="System.Management, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A" />
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" />
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=B77A5C561934E089" />
<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089" />
</assemblies>
License
This article, along with any associated source code and files, is licensed under The
BSD License