|
Note: -In .NET 1.0 we had data
grid view control that was replaced in 2.0 with grid view.
-Data grid 1.1 control available in 2.0.
-Grid view is faster in performance.
-it also had a simplified use age.
-Dynamic nature.
-Have new features
*Note: We cannot drag and drop
a data grid but we have to go to the code and create.
Data grid in ASP.NET 2.0 can be created
just by writing data grid control creation code in source view
(because there is no drag and drop provided
by default)
Ex: <asp: Data Grid id=”dg1”runat=”server”/>
Grid view features
-Most featured rich control.
-Many built-in layouts for designing &dynamic
behavior.
-Supports sorting of data.
-Supports Paging of data.
-Supports Editing/Updating/Deleting of
data.
-Collection based approach is provided.
-Grid view with auto generates columns
true on properties that generate columns dynamically.
When data source is specified at run
time and it is by default is TRUE.
-we can assign different data objects tables
at runtime to provide different results.
- If auto generate columns is set to false
then we need to provide columns on our own.
-With auto generate columns true we can
really provide some4 automated sorting /paging tasks
also.
-Grid view when assigned to data source
control it automatically generates the code that is
required to show data. It internally
sets automate column is set to false.
-Enable sorting, enable paging.
-Grid view with data source controls –providing
additionally sorting paging.
|
Tuesday, 28 October 2014
GRID VIEW CONTROLS
Server side Java Script
![]() |
|
HTML Controls Class Hierarchy:
|
|
System. Object
|
|
System.Web.UI.Con
|
|
System.Web.UI.Con
|
|
System.Web.UI.Con
|
|
HTML Container Control
|
|
HTML Image
|
|
HTML Input Control
|
|
HTML Anchor
|
|
HTML Button
|
|
HTML Form
|
|
HTMLGeneric Control
|
|
HTML Image Button
|
|
HTMLInput Checkbox
|
|
HTML Input File
|
|
HTML Input Hidden
|
|
HTML Input Image
|
|
HTMLInputRadioButton
|
|
HTML Select
|
|
HTML Table
|
|
HTML Table Cell
|
|
HTML Table Row
|
|
HTML Text Area
|
|
HTML Input Text
|
VALIDATORS
|
(a) Compare field Validator:
Is a Control with compare feature.
Comparing one control with another control.
Properties:
(i) Control to Validate.
(ii) Control to Compare.
(iii) Operator.
(iv) Type.
(v) Error message.
EX:
To compare two Quantities or to compare
any data with another data we use these validators.lets take an
example of comparing two quantities.
|
![]() |
Quantity
|
|
Text Box1
|
|
Confirm Quantity Compare Validator.
Text Box2
|
|
Enter
|
|
<asp: Compare Validator id=Compare
Validator Control to validate “text Box2”
Control to Compare “Text Box1”Operator
=”Equal” Error Message=”Quantity mismatch”
Type=String Runat=”server”/>
|
|
Interview Point: Server side
control :-< asp: Text Box id=Text box1 runat=server/>
“asp:”in the above line is Tag
prefix.
“Text Box “is the Tag name.
Syntax: <tag prefix: tag
name<attributes>runat=server/>
|
|
(b) Control-Value
|
|
(i) Control to validate.
(ii) Value t Compare.
(iii) Type.
(iv) Operator.
(v) Error message.
(c) Control-Data type
(i) Control to validate.
(ii) Operator data type check.
(iii) Type.
(iv) Error Message.
|
![]() |
|
Regular Expression Validator
(Post.Pre name)
Mobile expression: - \d-->digits
\d{10}-->digits of 10
\d{1,10}-->between 1
to 10
\d{5,10}-->ranging 5
numbers only
\d{3} -\d{8} (ex: 040-23754526)
\ (A-Z){8}->8 alphabetic
characters are allowed
\ (a-z A-Z){8}-Caps &
Small
Note: Custom validator allows
users to write the logic for validating data and then takes care of displaying
an
error and form submission. Using
custom validator we can perform validation either in client or at server (if
needed both places).client side
means using javascript.And server side means using C#.NET.
Note:
ASP.NET controls perform by
default validations in the client on submission it also perform validation at
server. This is to ensure more
accuracy and also to avoid malfunctioning that may occur during submission of
data.
Custom validator allows user to implement client
side validation using java script.
|
|
Custom Validator
|
|
Client side java script
|
|
Server side java script
|
|
Client side JavaScript:
(1) Place the custom validator in the form and set the following
properties.
(i) Control to Validate
(ii) Error Message
(iii) Client validate function
(2) Go to ‘source’ view or ‘html’ view
and add script tag to it .inside script tag write “JavaScript” function
with “two parameters” these
two parameters specifies the object and the arguments are passed from control
to function or function to control
using which we can perform our required validations.
<script language=”JavaScript”>
Function f1(x, y).
x-is object.
Y-argument.
{
};
Ex: function check data(x, y)
{
If (y.value>10)
Y.Is Valid=True;
else
Y.Is valid=False;
|
Introduction
|
INTRODUCTION
|
|
ASP.NET
|
ASP.NET, the next version of
ASP, is a programming framework used to create enterprise-class Web
Applications. These applications
are accessible on a global basis leading to effecient information managment.
The advantages ASP.NET offers
is more than just the next version of ASP.
|
|
Why ASP.NET?
|
|
Since 1995, Microsoft has been
constantly working to shift it's focus from Windows-based platforms to the
Internet. As a result, Microsoft
introduced ASP (Active Server Pages) in November 1996. ASP offered the
efficiency of ISAPI applications
along with a new level of simplicity that made it easy to understand and use.
However, ASP script was an interpreted
script and consisted unstructured code and was difficult to debug and
maintain. As the web consists
of many different technologies, software integration for Web development was
complicated and required to
understand many different technologies. Also, as applications grew bigger in size
and became more complex, the
number of lines of source code in ASP applications increased dramatically and
was hard to maintain. Therefore,
an architecture was needed that would allow development of Web
applications in a structured
and consistent way.
|
|
The .NET Framework was introduced
with a vision to create globally distributed software with Internet
functionality and interoperability.
The .NET Framework consists of many class libraries, includes multiple
language support and a common
execution platform. It's a very flexible foundation on which many different
types of top class applications
can be developed that do different things. Developing Internet applications with
the .NET Framework is very easy.
ASP.NET is built into this framework, we can create ASP.NET applications
using any of the built-in languages.
|
|
Unlike ASP, ASP.NET uses the
Common Language Runtime (CLR) provided by the .NET Framework. This CLR
manages execution of the code
we write. ASP.NET code is a compiled CLR code instead of interpreted code
(ASP). CLR also allows objects
written in different languages to interact with each other. The CLR makes
developement of Web applications
simple.
|
|
Advantages Using ASP.NET
|
|
ASP.NET drastically reduces
the amount of code required to build large applications
ASP.NET makes development simpler
and easier to maintain with an event-driven, server-side
programming model
ASP.NET pages are easy to write
and maintain because the source code and HTML are together
The source code is executed
on the server. The pages have lots of power and flexibility by this
approach
The source code is compiled
the first time the page is requested. Execution is fast as the Web Server
compiles the page the first
time it is requested. The server saves the compiled version of the page for
use next time the page is requested
The HTML produced by the ASP.NET
page is sent back to the browser. The application source code you
write is not sent and is not
easily stolen
ASP.NET makes for easy deployment.
There is no need to register components because the
configuration information is
built-in
|
|
4
|
![]() |
|
The Web server continuously
monitors the pages, components and applications running on it. If it
noticies memory leaks, infinite
loops, other illegal software or activities, it seamlessly kills those
activities and restarts itself
ASP.NET validates information
(validation controls) entered by the user without writing a single line of
code
ASP.NET easily works with ADO
.NET using data-binding and page formatting features
ASP.NET applications run fater
and counters large volumes of users without performance problems
|
|
Differences between ASP.NET
and Client-Side Technologies
|
|
Client-side refers to the browser
and the machine running the browser. Server-side on the other hand refers
to a Web server.
|
|
Client-Side Scripting
|
|
Javascript and VBScript and
generally used for Client-side scripting. Client-side scripting executes in the
browser after the page is loaded.
Using client-side scripting you can add some cool features to your page.
Both, HTML and the script are
together in the same file and the script is download as part of the page which
anyone can view. A client-side
script runs only on a browser that supports scripting and specifically the
scripting language that is used.
Since the script is in the same file as the HTML and as it executes on the
machine you use, the page may
take longer time to download.
|
|
Server-Side Scripting
|
|
ASP.NET is purely server-side
technology. ASP.NET code executes on the server before it is sent to the
browser. The code that is sent
back to the browser is pure HTML and not ASP.NET code. Like client-side
scripting, ASP.NET code is similar
in a way that it allows you to write your code alongside HTML. Unlike client-
side scripting, ASP.NET code
is executed on the server and not in the browser. The script that you write
alongside your HTML is not sent
back to the browser and that prevents others from stealing the code you
developed.
|
Sales force Deployment Tool Eclipse IDE
Sales force Deployment Tool Eclipse IDE
Given below are advantage and limitation of tools which are used in code and configuration changes deployment from Sandbox to Production.
1. Force.com IDE/ Eclipse IDE
The Force.com IDE is a powerful client application for creating, modifying and deploying Force.com applications into production environment. Based on the Eclipse platform, it provides a comfortable environment for programmer’s familiar with integrated development environments, allowing you to code, compile, test, and package and deploy all from within the IDE itself.
The IDE also features an embedded schema explorer same as Sales force Explorer for a live view of your database and metadata components. Using the standard synchronization features of the IDE, you can create a project that enables multiple developers to develop against a shared source code repository.
Following are the advantages and disadvantage of tool.
Advantage:
- It provides a comfortable environment for programmers familiar with integrated development environments, allowing you to the code, compile, test, and package and deploy all from within the IDE itself.
- It provide the code editor following are features:
- Syntax highlighting for the Apex key words.
- Code assist for Apex system classes, user-defined classes, and schema objects.
- Click-to-line integration with errors and testing views.
- Unlimited undo and redo.
- Tabbed views of source code and XML metadata definition on app.
- We can validate the selected classes/trigger etc before deployment.
- Execute Anonymous view, which allows you to run the anonymous block of Apex on the server. Anonymous blocks help you to the quickly evaluate Apex on the fly, or to write scripts that change dynamically at runtime.
- Force.com IDE provides an Apex Test Runner view where you can test your methods to see which the tests are are passing or failing helpful in Test class.
- Metadata files are the text-based, they also can be compared using text diff tools, managed in a version control system such as CVS or Subversion, and even deployed from one Salesforce organization to another
- The Schema Explorer is the tool for browsing the objects and fields in a Force.com organization. The browser presents the logged-in user’s view of the Force.com database model, including object visibility, permissions, data types, lookup values and other information that is useful in developing applications on the Force.com platform.
- Project Synchronization working Online or Offline project.
- If deployment fail it will shows the errors with line number.
- A version control system allows you to track changes to a set of files over the time.
Disadvantage:
- It takes long time for loading and deployments which is initialization step of our project.
- We can’t run our visual force page GUI on browser.
- Detailed logs are not generated in Integrated Development Environment. For example system log file.
- We are not able to update user profiles using eclipse IDE. Like configuration changes not done in this tool.
Monday, 27 October 2014
Analytic Snapshots in Salesforce
An Analytic Snapshot helps us to create report on historical data.
Analytic Snapshots comprises of three things:
https://help.salesforce.com/apex/HTViewHelpDoc?id=data_about_analytic_snap.htm&language=en_US
Steps to set Analytic Snapshot:
1. Go to Setup --> Administration Setup --> Data Management --> Analytic Snapshot.
2. Click "Analytic Snapshot" button.
3. Select the Running User, Source Report and Target Object.
4. Click "Save & Edit Field Mappings" button.
5. Map the fields and click "Save" button.
6. Click "Edit" button in Schedule Analytic Snapshot related list.
7. Set the frequency and preferred start time and click "Save" button.
Email notification:
After clicking the link in email:
An analytic snapshot will fail during a scheduled run if:
Analytic Snapshots comprises of three things:
- A source Report of type Tabular or Summary
- A Custom Object with fields matching the columns in the source Report
- An Analytic Snapshot definition, which maps fields and schedules the snapshot runs
https://help.salesforce.com/apex/HTViewHelpDoc?id=data_about_analytic_snap.htm&language=en_US
Steps to set Analytic Snapshot:
1. Go to Setup --> Administration Setup --> Data Management --> Analytic Snapshot.
2. Click "Analytic Snapshot" button.
3. Select the Running User, Source Report and Target Object.
4. Click "Save & Edit Field Mappings" button.
5. Map the fields and click "Save" button.
6. Click "Edit" button in Schedule Analytic Snapshot related list.
7. Set the frequency and preferred start time and click "Save" button.
Email notification:
After clicking the link in email:
An analytic snapshot will fail during a scheduled run if:
- The source report includes more than 100 fields
- The source report was changed from summary to tabular
- The selected grouping level for a summary source report is no longer valid
- The running user does not have access to the source report
- The running user does not have the “Run Reports” permission
- The target object has more than 100 custom fields
- The target object contains validation rules
- The target object is included in a workflow
- The target object is a detail object in a master-detail relationship
- The target object runs an Apex trigger when new records are created on it
- The running user does not have the “Create” permission on the target object. Note that if the target object's status is In Development, the running user must have the “Customize Applications” permission.
Subscribe to:
Posts (Atom)










