we all know, AJAX means Asynchronous JavaScript and XML. It is a client-side script that communicates to and from a server/database without the need for a postback or a complete page refresh. The Ajax speeds up response time.

In other words, Ajax is the method of exchanging data with a server, and updating parts of a web page, without reloading the entire page.

Some of the Benefits of Ajax are:

Callbacks

Making Asynchronous Calls

User-Friendly

Improve the speed, performance and usability of a web application

Implementation of Ajax can be done in two way in ASP.Net Application:

using Update Panel and,

using jQuery

What Advances have Been Made to Ajax?

JavaScript is the client-side scripting language and XML is a mark-up language to define data. And we have, JSON(JavaScript Object Notation) is as another mark-up language to define data as well. JSON is much easier to use with JavaScript than XML. After the combination of JavaScript and Ajax, the XML Web Services are being replaced by JSON Web Services.

Another major advance to JavaScript and Ajax is the JavaScript object library called jQuery, which is the free, open-source software. It is a wrapper for JavaScript. jQuery is used to write the JavaScript to navigate and manipulate a page and make asynchronous Ajax callbacks.

Hence, Ajax callbacks have become standard programming practices by using jQuery and JSON Web Services for designing and developing web applications.

Demonstration: Implementation of Ajax using jQuery:

Step 1: Create a new Project and choose ASP.NET MVC web application.

Step 2: Just Ignore the built-in Models and Controllers and make your own model.

Here I am creating a model called “Students” having properties studentID, studentName and studentAddress as shown below:

Step 3: Lets create another model by inheriting the DbContext. It is a class that manages all the database operations, like database connection, and manages various entities of the Entity Model.

We can also say DbContext is a wrapper of ObjectContext. So, DbContext is a lightweight version of the ObjectContext and is exposes only the common features that are really required in programming.

Here I am creating a model called “StudentContext” as shown below:

Add “using System.Data.Entity;” that provides access to the core functionality of the entity framework.

Step 4: Now create a controller to written the code for inserting data into database, displaying data into view.

Here I am creating “Student” controller. Inside the Controller, I am creating an object of StudentContext for inserting and retrieving data from database. Also add the necessary namespace required.

Step 5: Now creating the action methods for Inserting and retrieving the data to/from the database.

Here I am creating an [HttpPost] action method “createStudent” for inserting the JSON-Formatted data to database. I am Using [HttpPost] attribute to Save/Post the data as below:

Similarly, I am also creating JSON method “getStudent” to retrieve data from database and return raw JSON data to be consumed by JavaScript in view as shown below:

Step 6: Now add a view to display the data and data inserting field. Here, I am adding a view named as “Index.cshtml”. Then, write the HTML codes for making the data input field, submit button and also for displaying the data in same page. You can use bootstrap classes for designing. Here I am using bootstrap. My designing code is as below:

Please enter the details below:

we can simply use the bootstrap class and call jQuery functions in ASP.NET MVC because during the project creation it will by default added to project and also

linked to the template.

Step 7: Now I will write the script for inserting the data as well as retrieve and display it to the view. Just after the HTML code finished add the script shown below:

we are using Ajax to refresh “tblStudent” so it refreshes only the particular table, rather than refreshing entire page. After clicking the “submitButton” the data from the input fields are taken in variable and redirected to action “createStudent” of “StudentController” to insert into the database. And, I have written a function “LoadData” to display the data from database to view continuously after inserting data. Inside “LoadData” function I am calling “getStudent” method which returns result in JSON and the JSON-Formatted data are presented in html by the underlying statements.

In above connectingString “StudentContext” is the name of class inherited from abstract Class “DbContext” in “StudentContext.cs” file. “RAVI-KANDEL” is the name of the Database Server and “Student” is the name of Database. Change “RAVI-KANDEL” with your Database Server name. Finally, run your application and navigate to Student controller. Also you can configure “RouteConfig.cs” and set the controller to “Student” for direct navigation to the Student controller when loading the application.

You can add the records and can see added data in the table after the form-control as shown below:

Also, you can open the database server and see the data stored in database over there.

Summary:
Threat Detection is an awesome feature, which helps to detect anomalous activities in the databases which indicates potential Security threats to the databases.
This feature “Threat Detection” is in preview and supported for Azure SQL Database.

This feature helps to provide new security layer enables the database Users to detect and respond to the potential threats by providing security alerts on anomalous actions. Users can easily suspicious events using Azure SQL Database Auditing to determine if they result from an attempt to access, exploit data in the database. That’s why Threat Detection makes it very simpler to address potential threats to database without the need to be a security expert or an Advanced security monitoring systems.

For Example:

SQL injection is one of the most common Web application security issues on the Internet, used to attack data-driven applications. Attackers take advantage of application vulnerabilities to inject malicious SQL statements into application entry fields, for modifying data in the database.
Therefore, the “Threat Detection” feature helps to detect certain anomalous database activities indicating potential SQL injection attempts.

Get started with SQL Database Threat Detection:

Step 1: Login to Azure portal, using the credential of your Subscription.

Step 2: Go to the configuration blade of the SQL Database that you want to monitor. In the Settings blade, select Auditing & Threat Detection.

Step 3: In the Auditing & Threat Detection configuration blade turn ON auditing, which will display the Threat detection settings. Also turn on Threat Detection(preview). Enter the email address in which you want to receive notifications and check the email service & co-administration box. Finally save it.

Step 4: Explore anomalous database activities upon detection of a suspicious event like SQL Injection etc. You will receive an email notification upon detection of anomalous database activities.
The email will provide information on the suspicious security event including the nature of the anomalous activities, database name, server name and the event time.
In addition, it will provide information on possible causes and recommended actions to investigate and mitigate the potential threat to the database.

Step 5: In the email, click on the Azure SQL Auditing Log link,
which will launch the Azure portal and show the relevant Auditing records around the time of the suspicious event.

Step 6: Click on the audit records to view more details on the suspicious database activities such as SQL statement, failure reason and client IP.

Also, You can click Open in Excel to open a pre-configured excel template to import and run deeper analysis of the audit log around the time of the suspicious event. in Recent Excel, Power Query and the Fast Combine setting is required.

Provide the connection string name and click next. In the next step you need to choose the objects for your model. Make sure to choose the table that you created earlier, Provide the namespace and then click on next. Then Build the project once.

Choose the Model Class, Data Context Class and enter the Controller Name as well.

Click the Add.

Go to the App_Start Folder and inside “RouteConfig.cs” change the Controller name “Home” to the Controller name that you entered earlier, It will help redirect you directly towards the Particular Controller Operations.

Finally, Run it into the browser. Now you are able to Create, Read, Update, Delete the records.

Also look to the database field you have created to see the data is saved there or not,

Then, In the SQL Database blade, Provide the Informations as shown below:

Database Name: The name of database you want to create.Subscription: Choose your available Subscription.Resource Group: Either use existing resource group or create new one.Select Source: Choose the database you want, Here I choose Blank Database.Server: You can choose existing database server if available, else create new one, I am creating new. To create New server do similar as shown in the New Server Blade.

Pricing tier: Choose the size and price of database that is suitable for you.Collation: Which one you want.

Then, Pin it to dashboard for easy access and click on create, It will take some time to deploy Database.

After database is successfully deployed, its wizard will open automatically as shown below:

Now, SQL Database has been successfully created in Azure.

Then to connect it through SQL Server Management Studio follow the steps:

We need to add client machine IP to the fire wall so, go to Tools as shown below:

Click on open in Visual Studio, go to configure your Firewall. Firewall Setting blade will appears. Click on Add Client IP and then Save, as shown below:

Now,

Open SQL Server Management Studio:Server Type: Database EngineServer Name: Enter the name that you created earlier in Azure.Authentication: SQL Server AuthenticationLogin: Username that you set earlier while creating database in Azure.Password: Password that you set earlier while creating database in Azure.

Then, Click on connect.

You will be redirected to another preview, which seems as shown below:

Step 10: Choose the Model name that you made when making the entity, also choose the context name that you made earlier and enter the content name that you want. In my case, I have as shown below:

Step 11: Go to RouteConfig inside App_Start and change the controller name to the one that you made earlier and enter the action method name that you want to call when the page loads. In my case, I have shown as below:

Step 12: Finally, run it in the browser. then you will get the view as shown below now you can create, add, delete menu there and go through it for proper operation as you need.

Thank you for you time! Keep visiting my website for more other blogs.

When you create a web app, Azure assigns it to a sub-domain of azurewebsites.net. For example, if your web app is named exploreitnepal, the URL is exploreitnepal.azurewebsites.net. Azure also assigns a virtual IP address. For a production web app, you probably want users to see a custom domain name. And We can use Azure credits to buy Custom Domains and host it as well. This feature is not possible from the Dreamspark pass of Azure. This Blog explains how to buy and configure a custom domain with Web Apps.

Note:

For instructions on using Traffic Manager to load balance traffic to a web app, use the selector at the top of this article to select the Traffic Manager specific steps.

Custom domain names cannot be used with Free web app. You must configure your web app for Shared, Basic, or Standard mode, which may change how much you are billed for your subscription.

If you don’t have a domain name for your web app, you can easily buy one on Azure Portal. During the purchase process you can choose to have WWW and root domain’s DNS records be mapped to your web app automatically. You also can manage your domain right inside Azure Portal.

In the Web Apps tab, click the name of your web app. In my case, I am using “exploreitnepal” as shown below:

Click on Setting there, a new blade will appears as shown below:

Scroll down the blade and then select Custom domains and SSL as shown below:

Then click on the Buy Domain in “Custom domains and SSL” blade as shown below:

In the Buy Domains blade, use the text box to type the domain name you want to buy and hit Enter. The suggested available domains will be shown just below the text box. Select what domain you want to buy. You can also purchase multiple domains at once. Then, Click the Contact Information as shown below:

Fill the domain’s Contact Information form and Click on OK.

Now you can choose to,

“Auto renew” your domain every year

Opt-in for “Privacy protection” which is included in the purchase price for FREE

“Assign default host names” for WWW and root domain to the current Web App.

Click the Select on Buy Domains blade, then you will see the purchase information on Purchase confirmation blade. If you accept the legal terms and click Buy, your order will be submitted and you can monitor the purchasing process on Notification.

Domain purchase can take few minutes to complete. After getting the similar view as shown below, be sure that your domain has been bought.

Stay tuned for my next blog, where I will be talking about the Domain Name Configuration.