Full Trust European Hosting

BLOG about Full Trust Hosting and Its Technology - Dedicated to European Windows Hosting Customer

European Ajax Hosting UK - HostForLIFE.eu :: How to Make Custom Alert Message with Ajax?

clock August 6, 2015 09:53 by author Peter

In this article, we are going to learn how to make custom Alert Message with Ajax. Some time we needed to make clone of windows alert message, however that alert message isn't permitting to change the header text. Here using Ajax model popup extender i'll show you how to make custom message box:
Add the user control file and ajaxtoolkit reference in your project.

Write the following code in ascx file.
<style type="text/css">
.MessageBoxPopUp
{
background-color:White;
border:solid 2px #99B4D1;
}

.MessageBoxButton
{
background-color: #A0A0A0;
border: solid 2px #B4B4B4;
color: Black;
font-weight:bold;
font-family:Verdana;
font-size:9pt;
cursor:pointer;
height: 20px;
width:70px;
display:none;
}
.MessageBoxHeader
{
height:17px;
font-size:10pt;
color:White;
font-weight:bold;
font-family:Verdana;
text-align:Left;
vertical-align:middle;
padding:3px 3px 3px 3px;
background-color:#3399FF;
border-bottom:2px solid #B4B4B4;
}
.MessageBoxData
{
height:20px;
font-size:8pt;
font-family:Verdana;
color:#3A4349;
text-align:Left;
vertical-align:top;
}
</style>
<script type="text/javascript">
function closeModelPopup(btn) {
// var mpe = document.getElementById("<%= mpeMessageBox.ClientID %>");
$find('mpeFirmMessageBox').hide();
}
</script>

<cc1:ModalPopupExtender ID="mpeMessageBox" runat="server" DynamicServicePath="" Enabled="True"
TargetControlID="btnTemp" PopupControlID="pnlMessageBox" BackgroundCssClass="modal"
PopupDragHandleControlID="pnlMessageBox" CancelControlID="btnCancel" BehaviorID="mpeFirmMessageBox">
</cc1:ModalPopupExtender>

<asp:Panel ID="pnlMessageBox" runat="server" Style="display: none; width: 300px;
height: 140px;" class="MessageBoxPopUp">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr class="MessageBoxHeader" style="height: 17px;">

<td colspan="2">
    <asp:Label ID="lblHeader" runat="server"></asp:Label>
</td>

<td align="right" style="padding: 2px 2px 0px 0px;">
    <%--<asp:UpdatePanel ID="upnCloseMessageBox" runat="server">
        <ContentTemplate>--%>
            <asp:ImageButton ID="imgBtnClose" runat="server" ImageUrl="~/Image/close_icon.png"
                 OnClientClick="closeModelPopup(this)" />
        <%--</ContentTemplate>
    </asp:UpdatePanel>--%>
</td>
</tr>

<tr>
<td colspan="2" style="height: 5px;">
</td>
</tr>
<tr style="height: 88px;">

<td style="vertical-align: top; padding-left: 5px;">
    <asp:Image ID="imgInfo" runat="server" ImageUrl="~/Image/information-balloon.png" Width="40px" />
</td>

<td class="MessageBoxData" colspan="2" style=" padding: 10px 5px 5px 5px;">
    <asp:Label ID="lblMessage" runat="server"></asp:Label>
</td>

</tr>
<tr style="vertical-align: bottom; height: 20px; padding: 0px 5px 5px 0px;">
<td style="width: 40px;">
</td>
<td align="right" style="width: 180px">
    <asp:Button ID="btnOk" runat="server" CssClass="MessageBoxButton" />
</td>

<td align="right">
    <asp:Button ID="btnCancel" runat="server" CssClass="MessageBoxButton" />
</td>
</tr>
</table>
</asp:Panel>

Now, add the following code in .cs file
public delegate void delegate_OkClick();
public event delegate_OkClick OnOkClick;
public string Header
{
set { lblHeader.Text = value; }
//set { lblHeader.InnerHtml = value; }
}

public string Message
{
set { lblMessage.Text = value; }
}

public Button CancelButton
{
get { return btnCancel; }
}

public Button OkButton
{
get { return btnOk; }
}

public AjaxControlToolkit.ModalPopupExtender MessageBox
{
get { return mpeMessageBox; }
}

protected void Page_Load(object sender, EventArgs e)
{
}

protected void btnOk_OnClick(object sender, EventArgs e)
{
//raise the event if not null
if (OnOkClick != null)
OnOkClick();
}
public void displayMessage(string message)
{
displayMessage(message, null);
}
public void displayMessage(string message, int? type)

{

lblHeader.Text = "Alert Message";
//lblHeader.InnerHtml = title;
lblMessage.Text = message;
btnCancel.Attributes["style"] = "display:block";
btnCancel.Text = "Ok";
mpeMessageBox.Show();
}


Your message box is ready, now you need to call from the aspx page where ever you need to show the message.
You need to add below line of code in
<%@ Register Src="~/Control/Alert.ascx" TagName="MessageBox" TagPrefix="mb" %>
<asp:ScriptManager runat="server" ID="s"></asp:ScriptManager>
<mb:MessageBox ID="ucMessageBox" runat="server"></mb:MessageBox>

And from the code behind cal the display message write the following code:
protected void btnClick_OnClik(object sender, EventArgs e)
{
ucMessageBox.displayMessage("Alert from Code");
}

HostForLIFE.eu AJAX Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.



HostForLIFE.eu Launches nopCommerce 3.60 Hosting

clock July 14, 2015 10:55 by author Peter

HostForLIFE.eu, a leading web hosting provider, has leveraged its gold partner status with Microsoft to launch its latest NopCommerce 3.60 Hosting support

European Recommended Windows and ASP.NET Spotlight Hosting Partner, HostForLIFE.eu, has announced the availability of new hosting plans that are optimized for the latest update of the NopCommerce 3.60 hosting technology.

HostForLIFE.eu supports NopCommerce 3.60 hosting on their latest Windows Server and this service is available to all their new and existing customers. nopCommerce 3.60 is a fully customizable shopping cart. It's stable and highly usable. nopCommerce is an open source ecommerce solution that is ASP.NET (MVC) based with a MS SQL 2008 (or higher) backend database. Their easy-to-use shopping cart solution is uniquely suited for merchants that have outgrown existing systems, and may be hosted with your current web hosting. It has everything you need to get started in selling physical and digital goods over the internet.

HostForLIFE.eu Launches nopCommerce 3.60 Hosting

nopCommerce 3.60 is a fully customizable shopping cart. nopCommerce 3.60 provides new clean default theme. The theme features a clean, modern look and a great responsive design. The HTML have been refactored, which will make the theme easier to work with and customize , predefined (default) product attribute values. They are helpful for a store owner when creating new products. So when you add the attribute to a product, you don't have to create the same values again , Base price (PAngV) support added. Required for German/Austrian/Swiss users, “Applied to manufacturers” discount type and Security and performance enhancements.

HostForLIFE.eu hosts its servers in top class data centers that is located in Amsterdam, London, Paris, Seattle (US) and Frankfurt (Germany) to guarantee 99.9% network uptime. All data center feature redundancies in network connectivity, power, HVAC, security, and fire suppression. All hosting plans from HostForLIFE.eu include 24×7 support and 30 days money back guarantee.

All hosting plans from HostForLIFE.eu include 24×7 support and 30 days money back guarantee. The customer can start hosting their NopCommerce 3.60 site on their environment from as just low €3.00/month only. HostForLIFE.eu is a popular online Windows based hosting service provider catering to those people who face such issues. The company has managed to build a strong client base in a very short period of time. It is known for offering ultra-fast, fully-managed and secured services in the competitive market. Their powerful servers are specially optimized and ensure NopCommerce 3.60 performance.

For more information about this new product, please visit http://hostforlife.eu/European-nopCommerce-36-Hosting



AngularJS Hosting - HostForLIFE.eu :: How to Custom DropDown Control Using Bootstrap and AngularJS?

clock July 2, 2015 10:47 by author Peter

When we wish to develop a web-based application using AngularJs, it usually needs a dropdown control with some extra features like search text and then on. however like classic ASP.NET, always a ready-made control isn't available in the AngularJs Framework. but really, if we would like to create a custom dropdown control, we are able to produce it easily. using this article, we'll find out how to create a custom dropdown control.

For that, we are going to first open Visual Studio and make a blank ASP.NET web application. we then have to be compelled to install some Nuget packages like AngularJs, Bootstrap and Angular UI.

Now produce a html file named DropDown.html. it's the template file for the dropdown directive. in this file, add the following code:
<div class="btn-group" dropdown is-open="status.isopen" style="width:{{DropDownParam.Width}};"> 
<div style="float:left;width:100%;"> 
<input type="text" class="form-control" style="width:90%;" ng-disabled="DropDownParam.Disabled" 
id="{{TextControlID}}" placeholder="{{DropDownParam.placeholder}}" value="{{SelectText}}"  
ng-model="SelectText" ng-change="toggleDropdown();" ng-model-options="{debounce:1000}"> 
<button type="button" class="btn btn-primary dropdown-toggle" dropdown-toggle ng-disabled="DropDownParam.Disabled" 
id="{{ButtonControlID}}" ng-click="fnShowDropDown();"> 
<span class="caret"></span> 
</button> 
</div> 
<ul class="dropdown-menu" role="menu" style="height:{{DropDownParam.height}};overflow:auto;overflow-x:hidden;width:95%;"> 
<li ng-repeat="item in DropDownParam.source | filter: {Text : SelectText}" data-ng-click="selectItem(item)"> 
<a><span tabindex="-1" style="cursor:pointer;" data-ng-click="selectItem(item)">{{item.Text}}</span></a> 
</li> 
</ul> 
</div>  


Now add another file named "DemoDropDown.html" that shows the functionality of the dropdown control. in that file, we will use the reference of Angular.min.js file and bootstrap.js file. Also, we will use the reference of the bootstrap.css file. Write the following code in this HTML file:
<!DOCTYPE html> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<title>Drop Down Demo</title> 
<script src="../RefScript/angular.min.js"></script> 
<script src="../RefScript/ui-bootstrap.min.js"></script> 
<script src="../PageScript/CustomCtrlApp.js"></script> 
<script src="../DirectiveScript/DropDown.js"></script> 
<script src="../PageScript/DropDownDemo.js"></script> 

<link href="../RefStyle/bootstrap.min.css" rel="stylesheet" /> 
</head> 
<body ng-app="CustomCtrlApp"> 
<div ng-controller="DropDownDemo"> 
<h2>{{Heading1}}</h2> 
<div> 
<table style="width:100%;column-span:all;" cellpadding="5" cellspacing="10" > 
<tr> 
<td style="width:40%;">Basic Drop Down </td> 
<td style="width:60%;"><ng-drop-down dropdown-setting="ComboSetting" callbackfunction="fnChange"></ng-drop-down></td> 
</tr> 
<tr> 
<td colspan="2"> 
<span>Select Item : {{SelectText}}</span> 
</td> 
</tr> 
<tr> 
<td colspan="2"> 
<input type="button" value="Get Text" ng-click="fnGetText();" /> 
<input type="button" value="Get Text" ng-click="fnGetValue();" /> 
<input type="button" value="Clear Selection" ng-click="fnClearItem();" /> 
<input type="button" value="Clear Combo" ng-click="fnClear();" /> 
<input type="button" value="Enable Combo" ng-click="fnEnable(true);" /> 
<input type="button" value="Disable Combo" ng-click="fnEnable(false);" /> 
</td> 
</tr> 
<tr> 
<td><input type="text" ng-model="SetValue" /></td> 
<td> 
<input type="button" value="Set Item by Value" ng-click="fnSetItem();" /> 
<input type="button" value="Set Item by Index" ng-click="fnSetIndex();" /> 
</td> 
</tr> 
</table> 
</div>        
</div> 
</body> 
</html>  

Now it's time to add our own JavaScript file. First, we need to create an Angular App file named "CustomCtrlApp.Js" and add the following code:
var CustomCtrlApp = angular.module('CustomCtrlApp', ['ui.bootstrap']);  

Next step, we will add another JavaScript file named "DropDown.js" that is the controller file of the dropdown directive to define the attribute, events and methods of the dropdown control. Then, write the following code:
CustomCtrlApp.directive("ngDropDown", [function () { 
this; 
return { 
restrict: "EA", 
scope: { 
DropDownSetup: '=dropdownSetting', 
callbackfunction: '=' 
}, 
templateUrl: '../HTMLTemplate/DropDown.html', 
controller: function ($scope, $element, $attrs) { 
$scope.DropDownParam = $scope.DropDownSetup.attribute; 
$scope.TextControlID = "txt" + $scope.DropDownSetup.attribute.id; 
$scope.ButtonControlID = "btn" + $scope.DropDownSetup.attribute.id; 
$scope.showDropDown = false; 
$scope.SelectText = ''; 

if ($scope.DropDownParam.Width != #ff0000) { 
var width = $scope.DropDownParam.Width.substr(0, $scope.DropDownParam.Width.length - 1); 
$scope.BoxWidth = Math.round(width * 0.95, 0) + '%'; 

else { 
$scope.BoxWidth = '95%'; 


if ($scope.DropDownParam.Enabled != undefined) { 
$scope.DropDownParam.Disabled = !$scope.DropDownParam.Enabled; 

else { 
$scope.DropDownParam.Disabled = false; 


if ($scope.DropDownSetup.events == undefined) { 
$scop.DropDownSetup.events = {}; 


$scope.fnShowDropDown = function () { 
if ($scope.DropDownParam.source.length > 0) { 
$scope.showDropDown = !$scope.showDropDown; 

else { 
$scope.showDropDown = false; 



$scope.selectItem = function (item) { 
$scope.SelectText = item.Text; 
$scope.DropDownSetup.attribute.Text = item.Text; 
$scope.DropDownSetup.attribute.Value = item.Value; 
$scope.showDropDown = false;                 
$scope.DropDownSetup.events.selectedIndexChange(item); 


function assignDropDownMethod() { 
$scope.DropDownSetup.method = { 
clearSelection: function () { 
    $scope.SelectText = ''; 
}, 
clear: function () { 
    $scope.DropDownParam.source = ''; 
    $scope.SelectText = ''; 
}, 
selectItemByValue: function (value) { 
    var result_obj = objectFindByKey($scope.DropDownParam.source, 'Value', value); 
    if (result_obj != null) { 
        $scope.selectItem(result_obj); 
    } 
}, 
selectItemByIndex: function (index) { 
    var result_obj = $scope.DropDownParam.source[index]; 
    if (result_obj != null) { 
        $scope.selectItem(result_obj); 
    } 
}, 
setEnable: function (param) { 
    $scope.DropDownParam.Disabled = !param; 




assignDropDownMethod(); 

function objectFindByKey(array, key, value) { 
for (var i = 0; i < array.length; i++) { 
if (array[i][key] === value) { 
    return array[i]; 


return null; 


$scope.fnHideDropDown = function () { 
$scope.showDropDown = false; 


$scope.status = { 
isopen: false 
}; 

$scope.toggleDropdown = function () { 
if ($scope.DropDownParam.source.length > 0) { 
$scope.showDropDown = !$scope.showDropDown; 
$scope.status.isopen = !$scope.status.isopen; 

else { 
$scope.showDropDown = false; 
$scope.status.isopen = false; 


}; 


}]);  

Run the project and check the output here.

HostForLIFE.eu AngularJS Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.



European PHP 5.6.1 Hosting - Using jQuery Ajax Call in PHP Script

clock June 30, 2015 09:37 by author Peter

Today, I will show you how to use jQuery Ajax Call in PHP Script Asynchronous JavaScript and XML (AJAX) is a format for higher and quicker response that's a lot of easy. Ajax is used for interactive communication with a database. Ajax is for browser-based applications. independent platform applications are utilized by Ajax. ajax is used to transfer information between the browser and also the web server. the following are methods that use Ajax.

beforeSend: once we send asking to the server then before that the beforeSend operate function excute.
<script type="text/javascript" language="javascript"> 
$("#btn").live("click",function(){ 
var fname = $("#fname").val(); 
var lname = $("#lname").val(); 
$.ajax({ 
 type:"POST", 
 url:"demo.php", 
 data:"fname="+fname+'&lname='+lname, 
 beforeSend: function(data){ 
    alert("this test"); 
 } 
}); 
}); 

</script>  


If the request successfully executed when the request finishes.
<script type="text/javascript" language="javascript"> 
$("#btn").live("click",function(){ 
var fname = $("#fname").val(); 
var lname = $("#lname").val(); 
$.ajax({ 
 type:"POST", 
 url:"demo.php", 
 data:"fname="+fname+'&lname='+lname, 
 complete:function(data){ 
    alert(data); 
 } 
}); 
}); 

</script>  

Data: Which data (string) value will be sent to the server.
<script type="text/javascript" language="javascript"> 
$("#btn").live("click",function(){ 
var fname = $("#fname").val(); 
var lname = $("#lname").val(); 
$.ajax({ 
 type:"POST", 
 url:"demo.php", 
 data:"fname="+fname+'&lname='+lname, 
}); 
}); 
</script>  


Success: When the following function is executed if the request succeeds.
<script type="text/javascript" language="javascript"> 
$("#btn").live("click",function(){ 
var fname = $("#fname").val(); 
var lname = $("#lname").val(); 
$.ajax({ 
 type:"POST", 
 url:"demo.php", 
 data:"fname="+fname+'&lname='+lname, 
 success:function(data){ 
    alert(data); 
 } 
}); 
}); 
</script>  


Write the following code to send data to a GET or POST method. The default value is GET.
POST method
<script type="text/javascript" language="javascript"> 
$("#btn").live("click",function(){ 
var fname = $("#fname").val(); 
var lname = $("#lname").val(); 
$.ajax({ 
 type:"POST", 
 url:"demo.php", 
 data:"fname="+fname+'&lname='+lname, 
 success:function(data){ 
    alert(data); 
 } 
}); 
}); 
</script>  


GET method
<script type="text/javascript" language="javascript"> 
$("#btn").live("click",function(){ 
var fname = $("#fname").val(); 
var lname = $("#lname").val(); 
$.ajax({ 
 type:"GET", 
 url:"demo.php", 
 data:"fname="+fname+'&lname='+lname, 
 success:function(data){ 
    alert(data); 
 } 
}); 
}); 
</script>  


url: Which the request is sent.
<script type="text/javascript" language="javascript"> 
$("#btn").live("click",function(){ 
var fname = $("#fname").val(); 
var lname = $("#lname").val(); 
$.ajax({ 
 type:"POST", 
 url:"demo.php", 
 data:"fname="+fname+'&lname='+lname, 
 success:function(data){ 
    alert(data); 
 } 
}); 
}); 
</script>  


Now, create a two file index.php

<script type="text/javascript" language="javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script> 
<script type="text/javascript" language="javascript"> 
$("#btn").live("click",function(){ 
var fname = $("#fname").val(); 
var lname = $("#lname").val(); 
$.ajax({ 
type:"POST", 
url:"demo.php", 
data:"fname="+fname+'&lname='+lname, 
success:function(data){ 
    alert(data); 
}   
});   
}); 
</script> 
First name: <input type="text" name="fname" id="fname"><br> 
Last name: <input type="text" name="lname" id="lname"><br> 
<input type="button" value="Submit" id="btn">  

Step 2:  Create a Demo.php file

<?php 
   echo $_POST["fname"]."---".$_POST["lname"]; 
?>

HostForLIFE.eu PHP 5.6.1 Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.



AngularJS Hosting - HostForLIFE.eu :: Create Signup and Login Page with AngularJS

clock June 23, 2015 07:48 by author Peter

In this article, I will tell you about how to Create Signup and Login Page with AngularJS. Here is the design:

Html code For Signup
This code in use a angularjs and bootstrap
<div class="form-horizontal" id="singup" name="myForm" ng-show="Registration" ng-hide="true"> 
<p style="margin-left: 185px; font-size: 200%; font-weight: bold"> 
New User Registration</p> 
<div class="form-group" style="margin-top: 30px"> 
<label class="col-sm-3 control-label"> 
Enter UserName</label> 
<div class="col-sm-4"> 
    <input type="text" id="uname" name="uname" ng-model="uname" placeholder="User Name" 
class="form-control" /> 
</div> 
</div> 
<div class="form-group" ng-show="edit5" ng-hide="false"> 
<label class="col-sm-3 control-label"> 
Address</label> 
<div class="col-sm-4"> 
    <textarea ng-model="add" name="add" id="add" class="form-control" placeholder="Enter Address"></textarea> 
</div> 
</div> 
<div class="form-group" ng-show="edit5" ng-hide="false"> 
<label class="col-sm-3 control-label"> 
Phone Number</label> 
<div class="col-sm-4"> 
    <input type="text" ng-model="phone" id="phone" placeholder="Phone Number" class="form-control" /> 
</div> 
</div> 
<div class="form-group" ng-show="edit5" ng-hide="false"> 
<label class="col-sm-3 control-label"> 
Education</label> 
<div class="col-sm-4"> 
    <select ng-model="edu" id="edus"> 
Select 
        <option value="BCA">BCA</option> 
        <option value="BBA">BBA</option> 
        <option value="BCOM">BCOM</option> 
        <option value="MCA">MCA</option> 
        <option value="MBA">MBA</option> 
        <option value="MCOM">MCOM</option> 
    </select> 
    <br /> 
</div> 
</div> 
<div class="form-group"> 
<label class="col-sm-3 control-label"> 
Gender</label> 
<div class="col-sm-4"> 
    <input type="radio" name="gender" ng-model="age" value="Male" /> 
Male 
    <input type="radio" name="gender" ng-model="age" value="Female" /> 
Female 
    <br /> 
    <tt id="gen" ng-hide="true">{{age | json}}</tt> 
    <br /> 
</div> 
</div> 
<div class="form-group" ng-show="edit5" ng-hide="false"> 
<label class="col-sm-3 control-label"> 
Password</label> 
<div class="col-sm-4"> 
    <input type="password" ng-model="pass" id="pass" placeholder="Enter Password" class="form-control" /> 
</div> 
</div> 
<div class="form-group" ng-show="edit5" ng-hide="false"> 
<label class="col-sm-3 control-label"> 
Re-Password</label> 
<div class="col-sm-4"> 
    <input type="password" ng-model="repass" id="repass" placeholder="ReEnter Password" 
class="form-control" /> 
</div> 
</div> 
<button type="button" class="btn btn-primary btn-lg" ng-click="saveUser()" style="margin-left: 150px;"> 
<span class="glyphicon glyphicon-save"></span>Registration 

</button> 
<button type="button" id="cbtn" class="btn btn-danger btn-lg" ng-click="cancel_r()"> 
Cancel  
<span class="glyphicon glyphicon-off"></span> 
</button> 
<br /> 
<br /> 
<br /> 
</div>

Here is the ASP.NET code for Signup. You should save data using webMethod:
<Services.WebMethod()> 
Public Shared Function SaveUser(ByVal uname As String, ByVal add As String, ByVal phone As String, ByVal edu As String, ByVal age As String, ByVal pass As String, ByVal repass As String) As String 
'Insert 
Dim Users As New StrategicAlliance2.User3 
Dim UsersDit1 As New StrategicAlliance2.UserRegistrationObject 
'Users.GetUserDetailsByID(id) 
UsersDit1.Username = uname 
UsersDit1.Address = add 
UsersDit1.Phone_No = phone 
UsersDit1.Education = edu 
UsersDit1.Gender = age 
UsersDit1.Password = pass 
UsersDit1.Re_Password = repass 
Users.InsertUserDetails(UsersDit1) 
End Function


The following Js Code is for Signup. The below code for saveUser Butoon click:
$scope.saveUser = function()  

strErrorMsg = ""; 
notEmpty(document.getElementById('uname'), '-Enter your UserName.'); 
notEmpty(document.getElementById('add'), '-Enter your Address'); 
notEmpty(document.getElementById('phone'), '-Enter your Phone Number'); 
notEmpty(document.getElementById('pass'), '-Enter Password'); 
notEmpty(document.getElementById('edus'), '-Enter Education'); 
notEmpty(document.getElementById('repass'), '-Enter Re-Password'); 
ValidMno(document.getElementById('phone'), '-Enter Valid Phone Number'); 
checkPass(document.getElementById('repass'), '-Password Not Match') 
if (strErrorMsg == '') 

$.ajax({ 
    type: "POST", 
    url: "UserLogin.aspx/SaveUser", 
    contentType: "application/json; charset=utf-8", 
    data: JSON.stringify({ 
        uname: $scope.uname, 
        fName: $scope.fName, 
        add: $scope.add, 
        phone: $scope.phone, 
        edu: $scope.edu, 
        age: $scope.age, 
        pass: $scope.pass, 
        repass: $scope.repass 
    }), 
    success: function(data)  
    { 
        alert("Registration Success"); 
        // window.location.href = "UserLogin.aspx"; 
        $scope.login = true; 
        $scope.Registration = false; 
        $scope.$apply(); 
    } 

}); 

}; 


Now, it's time to create Login Page
Html Code for Login. The following code in use a Angularjs & Bootstrap
<div class="form-horizontal" ng-show="login" ng-hide="false"><%--  
<a class="btn btn-info btn-lg" ng-click="UserR()" style="margin-left: 375px;"> 
    <span 
class="glyphicon glyphicon-user"></span>User Registration  
</a>--%> 
<h1 class="form-signin-heading text-muted" style="margin-top: 10px"> 
Sign In</h1> 
<div class="form-group" style="margin-top: 30px"> 
    <label class="col-sm-2 control-label"> 
User Name:</label> 
    <div class="col-sm-2"> 
        <input type="text" class="form-control" id="login_User" name="login_User" ng-model="login_User" 
placeholder="User Name" autofocus="" /> 
    </div> 
</div> 
<div class="form-group"> 
    <label class="col-sm-2 control-label"> 
Password:</label> 
    <div class="col-sm-2"> 
        <input type="password" class="form-control" id="login_Pass" name="login_Pass" ng-model="login_Pass" 
placeholder="Password" /> 
    </div> 
</div> 
<button type="button" class="btn btn-primary" ng-click="Login()" style="margin-left: 200px;"> 
    <span class="glyphicon glyphicon-log-in"></span>Sign In 

</button> 
<button type="button" class="btn btn-danger" ng-click="cancel()"> 
    <span class="glyphicon glyphicon-cancel"></span>Cancel 

</button> 
<br /> 
<a href="" style="font-size: 20px; color: Red; margin-left: 135px; margin-top: 20px" 
ng-click="UserR()">If you are not Registered Then click here </a> 
<br /> 
<p style="font-size: 20px; color: Blue; margin-left: 180px; margin-top: 10px"> 
One account is all you need 
</p> 
<p style="font-size: 16px; color: Black; margin-left: 90px;"> 
A single username and password gets you into everything Google. 
</p> 
<img style="margin-left: 75px" src="Images/logo_strip_sign_up_2x.png" height="50px" 
width="350px" /> 
</div> 


Code for Login with ASP.NET
The below code is to fatch data from database using webmethod and match with the entered data.
< Services.WebMethod() > Public Shared Function UserLogin() As StrategicAlliance2.UserRegistrationObject() 
Dim Users As New StrategicAlliance2.User3 
Dim details As New List(Of StrategicAlliance2.UserRegistrationObject) 
For Each dtrow As DataRow In Users.GetTableOfUserDetails.Rows 
Dim user As New StrategicAlliance2.UserRegistrationObject 
user.Username = dtrow("Username").ToString() 
user.Password = dtrow("password").ToString() 
details.Add(user) 
Next 
Return details.ToArray() 
End Function 


Js Code for Login
In this code in login button and cancel button
$scope.Login = function()  

strErrorMsg = ""; 
notEmpty(document.getElementById('login_User'), '-Enter your UserName.'); 
notEmpty(document.getElementById('login_Pass'), '-Enter your Password'); 
if (strErrorMsg == '')  

$.ajax({ 
type: "POST", 
contentType: "application/json; charset=utf-8", 
url: "UserLogin.aspx/UserLogin", 
data: "{}", 
dataType: "json", 
success: function(data)  

    for (var i = 0; i < data.d.length; i++)  
    { 
        User = data.d[i].Username; 
        Password = data.d[i].Password; 
        a = (User); 
        b = (Password); 
        if ($scope.login_User == a && $scope.login_Pass == b) { 
            window.location.href = "Default.aspx"; 
        } 
    } 
    if ($scope.login_Pass != b)  
    { 
        alert("Enter Valid ID And Password"); 
        $scope.login_User = ''; 
        $scope.login_Pass = ''; 
        $scope.$apply(); 
    } 

}); 

if (strErrorMsg != '') 

alert('\n' + strErrorMsg); 
} else  


}; 
$scope.cancel = function()  

$scope.login_User = ''; 
$scope.login_Pass = ''; 
}; 

HostForLIFE.eu AngularJS Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.



Ajax Hosting UK - HostForLIFE.eu :: How to call ASP.NET Page Method using jQuery AJAX ?

clock June 18, 2015 07:45 by author Peter

jQuery may be a powerful JavaScript library that permits you to call ASP.NET page method directly without any postback. you can call page method while not involving ScriptManager at all.

Creating page method:
First we've got to make page method, it ought to be declared as static with the [WebMethod] attribute.    [WebMethod]
    public static string GetDate()
    {
        return DateTime.Now.ToString();
    }

jQuery.ajax method:
           $.ajax({
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    url: "Default.aspx/MethodName",
                    data: "{}",
                    dataType: "json",
                    success: function (msg) {
                       //do something
                    }
                });

Type: the type of request the type ("POST" or "GET")
URL: A string containing the URL to that the request is sent.
ContentType: By default we've got to use "application/x-www-form-urlencoded; charset=UTF-8", when we sending information to server we've got to use this content type, that is okay for many cases.
Data: data send to be server, if data isn't a string it’ll be converted to query string.
DataType: the type of data that you are expecting back from the server.

Source code:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>jQuery AJAX call</title>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            // Add the page method call as an onclick handler for the div.
            $('#btnGetTime').click(function () {
                $.ajax({
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    url: "Default.aspx/GetDate",
                    data: "{}",
                    dataType: "json",
                    success: function (msg) {
                        alert('Current Time is ' + msg.d);
                    }
                });
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <input type="button" id="btnGetTime" value="Get Time" />
    </div>
    </form>
</body>
</html>

C# code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services;
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
    [WebMethod]
    public static string GetDate()
    {
        return DateTime.Now.ToString();
    }
}

Output:

HostForLIFE.eu AJAX Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.



AngularJS Hosting Europe - HostForLIFE.eu :: How to Create Strong Password for AngularJS Pages?

clock June 9, 2015 07:17 by author Peter

In this post, let me explain you how to create strong password for AngularJS. For choosing a password we need combination of special characters, Capital letter , small letters, digits etc to make it strong. Write the following code:

 

    <!DOCTYPE html> 
    <html> 
    <head> 
        <title>Strong Password for Angular UI Pages</title>            
        <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>   
        <script> 
            var app = angular.module("myApp", []); 
            app.controller("myCtrl", function ($scope) {        
                var strongRegularExp = new RegExp("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[[email protected]#\$%\^&\*])(?=.{8,})");        
                var mediumRegularExp = new RegExp("^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})");        
                $scope.checkpwdStrength = { 
                    "width": "150px", 
                    "height": "25px", 
                    "float": "right" 
                };        
                $scope.validationInputPwdText = function (value) { 
                    if (strongRegularExp.test(value)) { 
                        $scope.checkpwdStrength["background-color"] = "green"; 
                        $scope.userPasswordstrength = 'You have a Very Strong Password now'; 
                    } else if (mediumRegularExp.test(value)) { 
                        $scope.checkpwdStrength["background-color"] = "orange"; 
                        $scope.userPasswordstrength = 'Strong password, Please give a very strong password';  
                    } else { 
                        $scope.checkpwdStrength["background-color"] = "red"; 
                        $scope.userPasswordstrength = 'Weak Password , Please give a strong password'; 
                    }                  
};        
           }); 
        </script> 
    </head> 
    <body ng-app="myApp"> 
        <div ng-controller="myCtrl" style="border:5px solid gray; width:800px;"> 
            <div> 
                <h3>Strong Password for Angular UI Pages </h3> 
            </div> 
            <div style="padding-left:25px;">                  
<div ng-style="checkpwdStrength"></div> 
                <input type="password" ng-model="userPassword" ng-change="validationInputPwdText(userPassword)" class="class1" /> 
                <b> {{userPasswordstrength}}</b> 
            </div> 
            <br /> 
            <br /> 
            <br /> 
        </div> 
    </body> 
    </html> 

HostForLIFE.eu AngularJS Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.



FREE ASP.NET Hosting with Wordpress - HostForLIFE.eu :: How to Redirect browser to a sub directory with WordPress ?

clock June 3, 2015 06:11 by author Peter

In this tutorial, I will tell you about Redirect browser to a sub directory with WordPress. My site is running with WordPress in the sub directory blog of my domain. As a visitor, if you forget to enter /blog, this little index.php file in my root directory will redirect your browser to the sub directory. And here is the code that I used:

<?php
@include("sitefunctions.php");
/* Move page with 301 http status code*/
movePage(301,"http://www.mydomain.com/blog");
?>

You will need a sitefunction.php file with this content as well. The status code can be adjusted to your needs. Now, write the following code:
<?php
function movePage($num,$url){
  static $http = array (
       100 => "HTTP/1.1 100 Continue",
       101 => "HTTP/1.1 101 Switching Protocols",
       200 => "HTTP/1.1 200 OK",
       201 => "HTTP/1.1 201 Created",
       202 => "HTTP/1.1 202 Accepted",
       203 => "HTTP/1.1 203 Non-Authoritative Information",
       204 => "HTTP/1.1 204 No Content",
       205 => "HTTP/1.1 205 Reset Content",
       206 => "HTTP/1.1 206 Partial Content",
       300 => "HTTP/1.1 300 Multiple Choices",
       301 => "HTTP/1.1 301 Moved Permanently",
       302 => "HTTP/1.1 302 Found",
       303 => "HTTP/1.1 303 See Other",
       304 => "HTTP/1.1 304 Not Modified",      
       305 => "HTTP/1.1 305 Use Proxy",
       307 => "HTTP/1.1 307 Temporary Redirect",
       400 => "HTTP/1.1 400 Bad Request",
       401 => "HTTP/1.1 401 Unauthorized",
       402 => "HTTP/1.1 402 Payment Required",
       403 => "HTTP/1.1 403 Forbidden",
       404 => "HTTP/1.1 404 Not Found",
       405 => "HTTP/1.1 405 Method Not Allowed",
       406 => "HTTP/1.1 406 Not Acceptable",
       407 => "HTTP/1.1 407 Proxy Authentication Required",
       408 => "HTTP/1.1 408 Request Time-out",
       409 => "HTTP/1.1 409 Conflict",
       410 => "HTTP/1.1 410 Gone",
       411 => "HTTP/1.1 411 Length Required",
       412 => "HTTP/1.1 412 Precondition Failed",
       413 => "HTTP/1.1 413 Request Entity Too Large",
       414 => "HTTP/1.1 414 Request-URI Too Large",
       415 => "HTTP/1.1 415 Unsupported Media Type",
       416 => "HTTP/1.1 416 Requested range not satisfiable",
       417 => "HTTP/1.1 417 Expectation Failed",
       500 => "HTTP/1.1 500 Internal Server Error",
       501 => "HTTP/1.1 501 Not Implemented",
       502 => "HTTP/1.1 502 Bad Gateway",
       503 => "HTTP/1.1 503 Service Unavailable",
       504 => "HTTP/1.1 504 Gateway Time-out"
   );
   header($http[$num]);
   header ("Location: $url");
}
?>

WordPress with Free ASP.NET Hosting
Try our WordPress with Free ASP.NET Hosting today and your account will be setup soon! You can also take advantage of our Windows & ASP.NET Hosting support with Unlimited Domain, Unlimited Bandwidth, Unlimited Disk Space, etc. You will not be charged a cent for trying our service for the next 3 days. Once your trial period is complete, you decide whether you'd like to continue.



HostForLIFE.eu Proudly Launches Drupal 7.37 Hosting

clock June 1, 2015 09:35 by author Peter

European Windows and ASP.NET Spotlight Hosting Partner in Europe, HostForLIFE.eu, has announced the availability of new hosting plans that are optimized for the latest update of the Drupal 7.37 hosting technology.

HostForLIFE.eu hosts its servers in top class data centers that is located in Amsterdam (NL), London (UK), Paris (FR), Frankfurt(DE) and Seattle (US) to guarantee 99.9% network uptime. All data center feature redundancies in network connectivity, power, HVAC, security, and fire suppression. All hosting plans from HostForLIFE.eu include 24×7 support and 30 days money back guarantee. The customers can start hosting our Drupal site on our environment from as just low €3.00/month only.

Drupal is an open source content management platform powering millions of websites and applications. Thousands of add-on modules and designs let you build any site you can imagine. Drupal 7.37 Includes bug fixes and small API/feature improvements only (no major new functionality); major, non-backwards-compatible new features are only being added to the forthcoming Drupal 8.0 release. If you are looking for the right Windows ASP.NET Hosting provider that support Drupal 7.37, we are the right choice for you.

The 7.37 update also includes fixed a regression in Drupal 7.36 which caused certain kinds of content types to become disabled if we were defined by a no-longer-enabled module, removed a confusing description regarding automatic time zone detection from the user account form (minor UI and data structure change), allowed custom HTML tags with a dash in the name to pass through filter_xss() when specified in the list of allowed tags, allowed hook_field_schema() implementations to specify indexes for fields based on a fixed-length column prefix (rather than the entire column), as was already allowed in hook_schema() implementations, fixed PDO exceptions on PostgreSQL when accessing invalid entity URLs, added a sites/all/libraries folder to the codebase, with instructions for using it and added a description to the "Administer text formats and filters" permission on the Permissions page (string change).

HostForLIFE have hosted large numbers of websites and blogs until now. Our clients come from diverse backgrounds from all sectors of the economy. HostForLIFE.eu clients are specialized in providing supports for Drupal for many years. We are glad to provide support for European Drupal 7.37 hosting users with advices and troubleshooting for our client website when necessary.

HostForLIFE.eu is a popular online Windows based hosting service provider catering to those people who face such issues. The company has managed to build a strong client base in a very short period of time. It is known for offering ultra-fast, fully-managed and secured services in the competitive market. Our powerful servers are especially optimized and ensure Drupal 7.37 performance. We have best data centers on three continent, unique account isolation for security, and 24/7 proactive uptime monitoring.

For more information about this new product, please visit http://hostforlife.eu/European-Drupal-737-Hosting

About HostForLIFE.eu
HostForLIFE.eu is an European Windows Hosting Provider which focuses on the Windows Platform only. HostForLIFE.eu deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.

HostForLIFE.eu is awarded Top No#1 SPOTLIGHT Recommended Hosting Partner by Microsoft (see http://www.asp.net/hosting/hostingprovider/details/953). Our service is ranked the highest top #1 spot in several European countries, such as: Germany, Italy, Netherlands, France, Belgium, United Kingdom, Sweden, Finland, Switzerland and other European countries. Besides this award, we have also won several awards from reputable organizations in the hosting industry and the detail can be found on our official website.



AngularJS Hosting - HostForLIFE.eu :: How to Filtering and Sorting HTML Table Data With AngularJS?

clock May 27, 2015 08:08 by author Peter

Now, I am going to tell you about How to Filtering and Sorting HTML Table Data With AngularJS. There should be three cascading dropdowns to filter the data in the table. You should also be able to sort the table. And here is the following code:

    angular.module('tableApp', []) 
    .controller('tableCtrl', ['$scope', '$http', '$timeout',function($scope, $http)  
    {                
         $http.get('tableData/practionerData.json').success(function(data) 
         { 
             $scope.practionerData = data;                        
         } 
         ); 
         $http.get('tableData/practionerType.json').success(function(practionerdata) 
         { 
              $scope.practionerType = practionerdata;      
         }           
         );
         $http.get('tableData/practionersByType.json').success(function(practionersByType) 
         { 
               $scope.practionersByType = practionersByType;       
         }           
         );
         $http.get('tableData/OrganizationByPractioners.json').success(function(OrganizationByPractioners) 
         { 
               $scope.OrganizationByPractioners = OrganizationByPractioners;                
         }  
         ); 
      }   
    ]) 


Next step, I am going to populating the data in $scope with the JSON file. I can do it with the web service also. I can also post the scope data to the server with the web service. And here is the HTML page code:
    <!DOCTYPE html> 
    <html lang='en' ng-app='tableApp'> 
    <head>      
    <title>Table Example</title>     
        <script src='https://ajax.googleapis.com/ajax/libs/angularjs/1.2.9/angular.js'></script>     
        <script src='js/controller.js' type='text/javascript'></script> 
        <link href='style.css' type='text/css' rel='stylesheet' /> 
    </head>    
    <body ng-controller='tableCtrl'>   

   <div id="content">     
    <table id='practitioner_table'  > 
                       <tr> 
                <th colspan="7" style="text-align:right">         
                        <i class="fa fa-search">search  
                           <select ng-model="searchObj.practitionerType" ng-options="item.practitionerTypeID as item.practitionerTypeID for item in practitionerType"> 
                        <option value="">--Select--</option> 
                    </select> 
                              <select ng-disabled="!searchObj.practitionerType" ng-model="searchObj.practitioner_master_id" ng-options="item.practitioner_master_id as item.practitioner_name for item in practitionersByType| filter: {practitionerTypeID:searchObj.practitionerType}"> 
                        <option value="">--Select--</option> 
                    </select>        
                    <select ng-disabled="!searchObj.practitioner_master_id" ng-model="searchObj.organizationName" ng-options="item.organizationName as item.organizationName for item in OrganizationByPractitioners|filter:{practitioner_master_id:searchObj.practitioner_master_id}"> 
                        <option value="">--Select--</option> 
                    </select>        
                    </i>  
                    </th> 
               </tr>   
            <tr>          
                <th><a href="#" ng-click="predicate = 'practitionerType';reverse=!reverse">Practitioner Type</a> </th>           
                <th><a href="#" ng-click="predicate = 'practitioner_name';reverse=!reverse">Practitioner Name</a></th>  
                <th><a href="#" ng-click="predicate = 'organizationName';reverse=!reverse">Organization Name</a></th>                                      
               </tr>  
            <tr ng-repeat="practitioner in practitionerData | orderBy:predicate:reverse| filter: {practitionerType:searchObj.practitionerType,practitioner_master_id:searchObj.practitioner_master_id,organizationName:searchObj.organizationName}">           
              <td   ng-class-odd="'odd'" ng-class-even="'even'"> {{practitioner.practitionerType}}</td>            
                <td   ng-class-odd="'odd'" ng-class-even="'even'"> {{practitioner.practitioner_name}}</td>           
                <td   ng-class-odd="'odd'" ng-class-even="'even'"> {{practitioner.organizationName}}</td>                
           </tr>                      
    </table>   
    </div>     
    </body> 


Finally, I am populating the dropdown and table with scope data. Remember that the <select> tag and I am cascading the dropdowns using “filter” in “ng-options”. “ng-disabled” is used to keep the child dropdown disabled until the parent dropdown has the value.

AngularJS with Free ASP.NET Hosting

Try our AngularJS with Free ASP.NET Hosting today and your account will be setup soon! You can also take advantage of our Windows & ASP.NET Hosting support with Unlimited Domain, Unlimited Bandwidth, Unlimited Disk Space, etc.



About HostForLIFE.eu

HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.

We have offered the latest Windows 2012 Hosting, ASP.NET 4.5 Hosting, ASP.NET MVC 4 Hosting, and SQL 2014 Hosting.

Free ASP.NET Hosting - Europe

Tag cloud

Sign in