The .Net platform

by

The .Net platform:

The Net platform is a development framework created by Microsoft to provide a new programming interface to Windows applications, by integrating many technologies. The first version of the .net platform was released in April 2003[5]. However, the ideas behind.Net framework is to use a new strategy by enabling software as a service (SaaS).

 

The five main components of .Net Platform are Visual Studio .NET, .NET Enterprise Servers, .NET Framework, .NET Building Block Services, and Operating system on servers, at the top of the previous figure the bottom layer is the operation system (OS) such as windows XP, Windows Server and Windows CE [5]. The second layer on top of the OS layer is group of specialized server products, the required to develop large scale business applications, such as BizTalk Server, Exchange Server and SQL Server [5]. On the Top layer of the .NET is the development environment tool (IDE) Visual Studio, which is one of the best IDE on the development market, because of the feature that included in the visual studio make the development cycle easy to use. Also supporting many programming languages for example, C#.NET, VB.NET, F#, and more.

 History of ASP.NET MVC

The first release of ASP.NET was in 2002, at a time Microsoft company was trying to protect its position with controlling the market of desktop application development. At the same time, Microsoft realized the thread of the internet revolution on their technologies [3].

The following figure 2 showing the technology stack as it is showing then.

 

 

 

Using asp.net web forms Microsoft tried to support both the statelessness Hypertext Transfer Protocol (HTTP), also support the uncommon Hypertext Mark-up Language (HTML) at that time by many developers, by modeling the user interface (UI) and the server-side control object [3]. However, the huge support from Microsoft to build new technology to give the developer the ability to make web development just same as developing windows application, from this point Microsoft company opens a new door for the windows application developers called the world of web applications.

In General, the asp.net web form development as a principle was good, but the developer found it more complicated [3]. Because of,

  • View Stat weight: the actual amount of data transferring between the client and the server its was huge blocks, causing a slow loading for the web application.
  • Page life cycle: the code to link the front end with back end code to handle the event is part of the page life cycle it was very accurate and complicated.
  • Limited control over HTML: the ASP.net Server (IIS) is responsible to handle the rendering for the code, sometimes that causing failed to meet the standard HTML.
  • Low testability: the approach of the design was in asp.net web form was tightly coupled was not fitting for the unit test tools, that cause big effort on the developers.

The consequence for the last issues in the classic asp.net made Microsoft the find solution, Will demonstrate the solution as we are explaining the history of asp.net.[]

 

 

Sources:

[4] Steve Smith, 2018, Overview of ASP.NET Core MVC, Microsoft Corporation, [Online] Available at: https://docs.microsoft.com/en-us/aspnet/core/mvc/overview?view=aspnetcore-2.2 , [Accessed 01 May 2019].

[5] Hoang Lam, Thuan Thai, 2009, .Net Framework Essentials,3rd Edition, O’Reilly.

 

Android Application With SQL Server using Web Service Part 3

by

Welcome again, with Android SQL Server Web Service Connection.

In the last Article we stopped with many errors, I know that, don't worry again.

its just because of SOAP package, you need to include it to your project.

Just Change your Android Studio to Project and go to 

Your Application Name >App >Libs.... 

Just past SOAP package to this path.

after again page to Android.

Until now still you have same errors still, you need to add SOAP package to your Gradle

Gradle Scripts >build.gradle(Module: app)

just add this line(there is one more way to add but use this for now) :

compile files('libs/ksoap2.jar') 

The last thing you need to do is, add this code to Main Activity.

 

 

Now, We can say you can run your App.

Be happy,

 if you find any error just post it on the comment or text me to my facebook page.

 

Source Code: you can find it, in my GitHub Account.

Youtube Video on My Channel.

 

 

 

Android Application With SQL Server using Web Service Part 2

by

Hi, again to our second part from Android SQL server Web Service.    

After Create 2 Activities Home and log in.

will work on Login because it's our main jobs .

The design will look like this Photo :

I'm sure 100% you can do better than my design ;).

Code in XML .

Don't worry, if you can't copy the code. 

it's on My GitHub Account or First part from this tutorial. 

Eazy and simple till now.

Next Step, not that simple, in your Login Java Class. 

You need to declare and link your layout Component to you Java Code.

Same as this  Photo.

Now, 100% you will get errors in your code, because of  MyAsyncTask() Class, does not Exist, so declare it like this ,

private class MyAsyncTask extends AsyncTask<String,Void,String>
{
@Override
protected String doInBackground(String... strings) {}
protected void onPostExecute(String result) {}
}

 In the doInBackground method, will be the connection or create Connection String to your Database.

Add this code to :

protected void onPostExecute(String result) {}

 

part 3

Android Application With SQL Server using Web Service Part 1

by

Hi,

In this Article will talk about SQL Server, how to connect to SQL Server Live Database.

but this time will not .NET or Microsoft Tools to read or write andy data from our database.

Today will be Android Application.

will use Android Studio 2.3.3 or Higher for this Application.

So, how to connect to SQL database, its very simple not simple same as, .NET

maybe SOAP package will make it easy. 

Our Project will be Login  Application.

will content 2 parts :

1- ASP.NET Web Service.

  Youtube Link  GitHub Project . 

In this article, I'm not going to talk about Web Service.

2- Android Application, How to Login with Email and Password with Live SQL Database. 

 Youtube Link    GitHub Project 1 .  GitHub 2

Will have  2 Activities and Layouts. 

1- Main Activity or Home Activity this will be opened if the result of login True.

2* Login Activity, this one will have 2 EditText for Email and Password,

and sure one Button For Sign In. 

Let's Start our Android Application with creating a new project.

New Project

- Choose a name for your project.

-  Will Generate New Empty Activity and Layout.

So, this one will Be Home Activity as I mention it will open if the Email and Password True.

You can create any Text View and write in it Welcome or Hello World :).

-Let's create one more Activity and call it Login Activity, this will be for the main job.

 

 

part 2

 

jQuery Ajax ASP.NET MVC GET/Post Part 2 عربي

by

مره اخرى مع JQuery AJAX ASP.NET MVC   .

اليوم سوف نتحدث في المقالة التالية عن POST  . 

وكيف يتم استخدامها في ASP.NET MVC  .

POST

الشكل العام :

.post( url [, data ] [, success(data, textStatus, jqXHR) ] [, dataType ] )

هي على عكس Get  التي كانت تجلب البيانات من مكتن معين (قاعدة بيانات الخ..).

Post  ترسل البيانات إلى مكان محدد من صفحة الويب . 

الكوج التالي هو كود ارسال Name and Address  بشكل وهمي من ادارء إلى اخرى , عبر التابع التالي .

[HttpPost]
public string Submit(string Name, string Address)
{
    if (!String.IsNullOrEmpty(Name) && !String.IsNullOrEmpty(Address))
        //TODO: Save the data in database
        return "Thank you " + Name + ". Record Saved.";
    else
        return "Please complete the form.";
}

بعد التاكد من عدم ارسال بيانات فارغه . يتم اظهار الرسالة التالية :

Thank you   Name  . Record Saved.

وفي حال كان لا يوجد بيانات , تظهر رساله تطلب بادخالها :

Please complete the form.

 

الكود التالي من اجل صفحة الويب :

 

<p>
    Enter your name
    <br />
    @Html.TextBox("Name")
</p>
<p>
    Enter your address
    <br />
    @Html.TextBox("Address")
</p>
 
<input type="button" value="Save" id="Save" />
<span id="msg" style="color:red;"/>
 
<script type="text/javascript">
    $('#Save').click(function () {
        var url = "Subscription";
        var name = $("#Name").val();
        var address = $("#Address").val();
        $.post(url, { Name: name, Address: address }, function (data) {
            $("#msg").html(data);
        });
    })
</script>

لنحاول هذا المره , ان يكون الكود اكثر احترافيه .

ونستخدم Form  . كما في الشمل التالي : 

يجب علينا تعريف الحقول التاليه و في كلاس منفصل .

public class Subscription
{
    public string Name { get; set; }
    public string Address { get; set; }
}

 

والتعديل على الكود , ليستقبل من كلاس Subscrption  , .

[HttpPost]
public string SubmitSubscription(Subscription subs)
{
    if (!String.IsNullOrEmpty(subs.Name) && !String.IsNullOrEmpty(subs.Address))
        //TODO: Save the data in database
        return "Thank you " + subs.Name + ". Record Saved.";
    else
        return "Please complete the form.";
}

 

كود الويب سكون مختلف قليلا , حيث انه سيتم استخدام From  كما في الشكل التالي :

<form id="subscriptionForm" action="/Home/SubmitSubscription" method="post">
<p>
    Enter your name
    <br />
    @Html.TextBox("Name")
</p>
<p>
    Enter your address
    <br />
    @Html.TextBox("Address")
</p>
 
<input type="button" value="Save" id="Save" />
<span id="msg" style="color:red;"/>
</form>
 
@section Scripts{
    <script type="text/javascript">
        $('#Save').click(function () {
 
            var form = $("#subscriptionForm");
            var url = form.attr("action");
            var formData = form.serialize();
            $.post(url, formData, function (data) {
                $("#msg").html(data);
            });
        })
    </script>
}
 

تم اعطاء الفورم اسم subscriptionForm   حتى يسهل قراءة البيلنات منه في كود الجافا سكريبت .

لن يختلف شي عندي في وقت التنفيذ والناتج كما في الكود السابق . 

لكن هذه الطريقه جيدة من اجل قواعد البيانات ....

 

وشكرا ...