3. Exploring and designing the created sandboxed visual web part:

- Now after the project is created, the Solution Explorer contains the
default visual web part named "SandboxedVWP". It
also has
the presence of the Features and Package
nodes. A
feature organizes the application in a way that
SharePoint Foundation understands. Features can be deployed to SharePoint
Foundation at the site or web level. The package
contains features and other assets used when you deploy
solutions to SharePoint Foundation.

We can change the default Feature1 name by renaming
it to "SandboxedFeature" by clicking on the F2 function key or right clicking on it and selecting
"rename":

- We can change the
feature
scope by double clicking on the "SandboxedFeature" renamed default
feature, then choosing from the Scope choices. We'll select
the
Site scope feature:

- Let's explore the sandboxed visual web part by opening the "Elements.xml"
file under "SandboxedVWP":

Grouping" web parts is one of the best practices that we
have to follow for better management and organization of web parts, so,
set the "Group" property in the Elements.xml file of web part to make sure the web parts comes under a specific group
(ex: Value="MSSharePointTips"). This will make easier to find the web part
from the SharePoint site.

- We can change the Title and Description for the sandboxed visual web part
by editing the "Title" & "Description" properties in the "SandboxedWP.webpart" file:

- Let's design our visual web part by opening the
"SandboxedWP.ascx" design user control and add a "TextBox"
and "Button":

- Double click on the "Click Me" button to go to the btn_click event handler at
the "code behind" file: