For checking the ajax request one have to use the request handler component.
In Cake PHP to obtain the information about the HTTP request as a form of AJAX which are requested into your application for that the Component Request Handler is use...
Hi
If you want a condition where you can load another model inside you model. you can do as I code, see the example below
App::import('Model', 'MyModel'); $my_model = new MyModel();
Or you can write
$this->SomeModel->MyModel;...
Loading vendors usually means you are loading packages , so in CakePHP you can use:
App::import('Vendor','');
As an expample if you want to load a vendor named recurly which is saved in your app's Vendor folder and you want to access the...
"Creating a DropDownList from an Enum in ASP.NET MVC"
In this article I will try to explain, how can we bind an Enum to a DropDownList in ASP.NET MVC.
Let us understand it with the help of an example:
Step 1: Crea...
Updation in CakePHP is basically based on knowing the primary key(Id) of the records one wants to change/edit.
You can update a field in CakePhp by two ways:-
a)By using saveField method
$this->ModelName->id=$id;
$this->Mode...
Hello,
If you want to add CSV export component using cake php, for that you can do by following steps:-
First take the controller file and create an action, the code will go like this:-
<?php
class Export_my_dataController extend...
AngularJS directives are what controls the rendering of the HTML inside an AngularJS application, it also lets you to extends HTML by adding the directives.
In angular js directives are represented by prefix ng-
Some of the mostly used di...
Hello if you want to get last insert id or something equivalent to this you can try following steps:-
Lets take this example, Here I just inserted the field in column
$data = array('menuName' =$_REQUEST['menuname'])
$this->Menu...
Hello Friends,
This blog explains how to implement singleton design pattern in c#. So lets start with few basic things:--
What is Singleton ?
A singleton is a class which only allows one instance of itself to be created - and gives s...
Variable is a name. Variable name reserved an area which is allocated in memory.
In java each and every variable has some specific type, this specific type defines the size in variable's memory.
One should declare variables before used.
Eg. ...
Hello all
Working with SQL Server we have to copy data from multiple sources and from this purpose we can use SqlBulkCopy Class which helps us to bulk copy data from different data sources to SQL Server database. This class is present in the S...
CakePHP provides user to do advance view designing and making custom architecture for designing, for quick web developments. The CTP file extension is associated with the CakePHP. Ctp file contains template CakePHP template.
It is as same as a...
If you need to print the complete current url you can do following steps.
1. In the view file code will go like this:
<?php echo $this->here; ?>
This syntax'll give you the absolute url starting from hostname i.e. /controller/...
"Difference between Html.RenderPartial and Html.Partial"
Html.RenderPartial and Html.Partial both are the methods to render a Partial View in MVC Razor.
Following table shows the difference between these two:
...
Download the DropBox SDK from the https://www.dropbox.com/developers/sync/sdks/ios
add this sdk to Your project and also add some other Frameworks.
1. Foundation.framework
2. UIKit.framework
3. CoreGraphics.framework
4. QuartzCore.fra...
Hello all,
In asp.net we show our database records in tabular format using GridView control and to export that GridView Data to excel, we can use following code packet.
protected void gridViewExportToExcel()
{
if (GridView.Ro...
Hello all,
In asp.net we use DropDownList control which has multiple select items(options) from which we can select one.
We can either set the values of DropDownList list items by hard coding it or we can also bind the the select items and se...
Hello all,
In asp.net if we want to show JavaScript pop box from Code behind file (C# file), we can do that by using following block of code :
string script = "<script language='javascript'>alert('This is a JavaScript popup');</scr...
Hello all,
working with richtext editor at time we have to wrap any content with para tag.
To do that we have following code packet.
in HTML we have:
<div>
<ul>
<li><input type="submit" onclick="wrapWithP" /...
A module is a container for different part of an App which includes controller, services, filters, directives and many more.
We can also say that it is a collection of controllers, filters, services, directives, etc.
Syntax for creating a m...
"The partial view was not found or no view engine supports the searched locations."
While working on a Application of rendering Partial View in a parent View, I got the following Exception: "The partial view '~/Home/Par...
When there are one or more EditText in the activity, a soft keyboard automatically appears when the activity is launched, which hides some visible portion of the screen and we don't always have a requirement to automatically pop-up the soft inp...
"Partial View in Asp.Net MVC"
Key Features:
1. The View defined inside the parent View is called the Partial View.
2. It is same like a user control (.ascx) in Asp.Net.
3. The Partial View has access to the data of the parent View.
4. ...
To create a Facebook login using cakephp we need facebook app with appId, apiKey and secret key which are required for facebook login to work. Facebook connect and enables users to authenticate your application instantly with a Facebook Account.
...
I have a worksheet containing data in rows and columns and I want it change or rotate the data of row to column and vice-versa, for that I have to use feature named Transpose.
Lets learn this from example
As in below image my data in Colum...
hello
I want to send automatic server notifications (push) on every Sunday. Also is there any way how to activate the new links activate only after 24 hrs.
Fetching data from the database takes a lot time process. Eventually when you need to combine multiple tables in order to fetch the data, reducing database calls becomes very meaningful.
Although in CakePhp's model, by default if the associat...
"Custom Error pages in Asp.Net MVC"
In this article we will learn how to make custom error pages in Asp.Net MVC.
Getting Started:
By default if we get any exception while running our code, w...
When we perform any action on button click and many times we have seen that the keyboard is open and the further activities are going on. The opened keyboard looks very bad on the screen. So to over come this problem here is the method to close t...
Here's an example of a generic bind() function, applied directly to an anonymous event handler. The object in XML Request gets bound to its onreadystatechange() event. The search string variable is being pre-applied as well. when the parseMes...
Hello Friends, Asp.net MVC is now getting more popular day by day, So before dealing with MVC we need to understand some Do's and Dont's of it. This blog will help you to understand Do's and Dont's of ASP.NET MVC.
ASP.NET MVC Do's and Dont's ...
For some reasons Facebook doesnt provide profile picture with user info dictionary/data.
We need to fetch profile pic using graph api.
Once user is done with successful authentication he can use following snippet to get profile picture URL.
...
Entity framework provides numerous ways to batch delete the objects from Database. Below are the step for way 1 :
Load objects that has to be deleted in memory.
Remove the objects from context
And then save these changes. This statemen...
Hiii All..
Working with asp.net we use using statement to add name space to our code behind file (C# file) if we want to use any specific namespace, but if there are unused using statement that are present in your code than it can cause perfor...
Sometimes we need to send the email from iOS application for that we have to integrate MFMailComposeViewController in our application so that we can send email.
This program will help you to send email through your app using swift.
Steps Requ...
"Returning a file to View/Download in MVC"
In this article I will try to explain how to view and download a file in Asp.Net MVC Application.
Let us understand it with the help of the folowing example.
Getting Starte...
Hi Friends. My "Hello World" blog in MVC is taking some time ,so I thought that I should share some performance tips here. Some of them are followed by code and explanations and I believe that you'll find them useful.
Static Methods are Faste...
Contextual filters are much similar as regular filters in views. The only and main difference between them is in the way values are fetched. A contextual filter allows user to filter content based on dynamic information rather then setting a valu...
There are two predefined functions in PHP for applying user defined function on each element of an array.
1. array_walk() : array_walk() applied a user function on each element of an array. It returns TRUE on success and FALSE on failure. The...
We will learn here, how we can submit form data with the help of Ajax.
First step:-
Create index.html file and create a form with the three labels/fields:- Name,Email and Superhero Alias. Inside head tag we have included one css file and ...
To hide other menu items from ActionBar/Toolbar when SearchView is expanded or open you need to apply OnSearchClickListener on it.
On the onCreateOptionsMenu method set OnSearchClickListener like this:-
// hide other menu item when SearchView...
Hi ,
If you want to check the null values in NSDictionary then use the following code :
id value = [dict valueForKey:akey];
if (value == [NSNull null] || value == nil ||
value == NULL ||
value == Nil ||
[valu...
Email is any message distributed by electronic means.
For sending email from our application, we dont have to built email client from scratch. We can
implement existing one like Gmail, outlook etc.
We use ACTION_SEND action to launch an ex...
Hi all,
Here is an example how to format currency using Angular filters.
Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default symbol for current locale is used. - AngularJS
HTML:-
<body ng...
"Error - The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required."
While I was integrating Email functionality using Gmail SMTP Server in ...
" Send email with attachment using Gmail SMTP Server in ASP.Net. "
In this article I will discuss how to integrate the email functionality along with the attachment in a Asp.Net Application.
Getting Started:
Step ...
Hello All,
In MVC (Model, View and Controllers), to create a dropdownlist control we use HTML helpers which helps us to to create various HTML and server side controls.
A dropdownlist is a collection of objects of SelectListItem class in .n...
Android has reached to its current peak position in the mobile market by three factors - 1. Open Source to work. 2. Google's backing. 3. Application Ecosystem.
Recently, Google has launched new version of Android, Name, Android 5.0 Lollipop....
Hi if you are using php version 5.3 or greater then some functions are really very quick to write and use.
In this blog I am calculating the days between your given two dates.
This is by far the most accurate way of calculating the differenc...
Insertion in Linklist:- The Insertion of Element in Singly linklist at different places like: insertion at beginning, last and middle in the linklist. In below code I will show you how to insert the element in linklist at beginning, middle and la...