Thursday 19 December 2013

What is Kendo UI?

Kendo UI is an HTML5, jQuery-based framework for building modern web apps. Advantages of using Kendo UI

a.       Fast And Responsive

Performance matters. One of the key bottlenecks in modern web development is network latency. The time it takes to make a request to the server and get the results can account for a huge portion of page load time, and with hit-and-miss mobile internet, the problem is magnified. 
With JavaScript development, this is achieved by sending JSON (or sometimes XML) data to the client instead of sending a mix of data and markup HTML. All HTML rendering happens in the browser, keeping communication with the server fast and to a minimum.

b.      Universal Front End Platform

ASP.NET may make certain front-end tasks “drag-and-drop easy,” but it may not be the best platform for raw service performance (too much overhead). Maybe a lightweight NodeJS server would be a better simple, fast service provider.
With a JavaScript/HTML5 front-end, you can test server-side performance and pick the best platform for the task. As long as JSON gets to the browser, your front-end is covered.

Friday 13 December 2013

How to Select the Tone in Text to Speech Conversion in Windows Forms



Today I am going to explain how we can select tone when we are converting text to speech.

In the previous article Converting Text To Speech in Windows Forms I have demonstrated the way we can get audio output to the typed text in windows forms. Now I’ll demonstrate how we can select the tone that reads the given text.

First drag a combo box onto the form. Then add two values into the combo box i.e. Female and Male.

In the code page write a condition in the button click event. Check which of the following values are selected? The condition can be as follows

if (comboBox1.SelectedItem == "Female")

If the condition is satisfied then the female voice is selected.
Here we will write the Speaker hints as follows

Thursday 12 December 2013

How to clear browser cache in ASP.NET

In this article I will explain How to clear browser cache in ASP.NET?

Many of us know that when we browse, history is stored in the form of Cookies and when we press back button the page will be loaded from that browser Cookie. We may face some problems with this.

Here is a Simple code to avoid this type of Problem. 

Paste this code in Page load of Master Page so that whenever you click on Browser back Button Entire Page will be loaded from the Code.

Use below C# code for expire browser cache.

Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1));
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetNoStore();

What is the ASP.NET AJAX Control Toolkit?



           In this article I will explain what is the ASP.NET AJAX Control Toolkit?  The ASP.NET AJAX Control Toolkit is an open-source project built on top of the Microsoft ASP.NET AJAX framework.

           The AJAX Control Toolkit contains more than 30 controls .It is a joint effort between Microsoft and the ASP.NET AJAX community that provides a powerful infrastructure to write reusable, customizable and extensible ASP.NET AJAX extenders and controls, as well as a rich array of controls that can be used out of the box to create an interactive Web experience.

 AJAX Control Toolkit easily creates rich, interactive web pages. The main important controls are. 

1.       AutoComplete
2.       Calendar
3.       FilteredTextBox
4.       ModalPopup
5.       TextBoxWatermark
6.       Tabs

Converting Text To Speech in Windows Forms



Today am going to explain how we can convert the given text to voice output using C#.NET in Windows forms project.

Take a new project in windows forms. We have to add speech reference. Right click on the ‘References’ and add System.Speech dll.

In the designer page take a textbox and a button. In the code page add the following namespaces

using System.Speech;
using System.Speech.Synthesis;

Declare a new class called SpeechSynthesizer

Define an object to this class

How to use Ajax Tabcontainer in asp.net?



In this article I will explain how to use Ajax Tabcontainer in asp.net.

Every Tab container contains multiple Tab Panels. We can declare our asp controls between the Tab Panels.

One more thing don't hesitate to learn the post completely after seen the length of the post because it's huge for looking but nothing is there just design only the page contains 3 TabPanels that's why code is more and it's very easy to work with TabContainer

Now we can see how we can use ajax tab container in our application First add AjaxControlToolkit reference to your application and add 

<%@ Register Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" tagPrefix=" ajaxtoolkit " %>

Sunday 8 December 2013

How to Disable Cut, Copy, Paste Options On a Textbox in C#.Net


                       
Today am going to explain how to disable cut, copy, paste options on a text box using ASP.NET.

In our applications sometimes we need to disable cut, copy, paste options. It is mainly helpful when someone tries to paste the email/username and password fields. At that time for security reasons we have to disable these options. Now let’s see how can we do this in ASP.NET?

First take a text box.

<asp:TextBox ID="txtRead" runat="server"></asp:TextBox>

We have taken a new textbox and declared its name as txtRead.
Now declare three public property names as

oncopy
oncut
onpaste

Friday 6 December 2013

How to check internet connection using ASP.NET with JavaScript?



In this article I will explain how to check internet connection using ASP.NET with JavaScript

I have declared one javascript function for checking the internet connection.

Below JavaScript code is useful for check internet connection online or offline.

function checkNetconnection() {
            var status = navigator.onLine;
            if (status) {
                alert("online");
            } else {
                alert("offline");
            }
        }

Below is the code for aspx page design. We are using master page also. In this master page we have two content place holders. In first content place holder we placed JavaScript code and second content placed holder we placed one ASP Button.

How to Get All the Weeks into Drop Down list using C# .NET

                                  
Today I am going to explain how we can get all the weeks of a year into Dropdown list using C#.NET
In our application sometimes we may have a requirement to show all the weeks in the dropdown list. We can use C# .NET to get this functionality.

First declare a dropdown list in aspx page as follows

<table>
            <tr>
                <td>
                    <asp:DropDownList ID="ddlWeeks" runat="server" AutoPostBack="true">
                    </asp:DropDownList>
                </td>
            </tr>
        </table>

Now write the code to bind the values in aspx.cs page

First take a method. Here I have declared a method called GetWeeks()

public void GetWeeks()
        {
            try
            {

      }
            catch (Exception ex)
            {

            }
        }

Thursday 5 December 2013

3 tier architecture example in dotnet



In this article I will explain about uses of 3-Tier architecture and how to create and implement 3-tier architecture for our project in asp.net. 

 Uses of 3-Tier Architecture
  
1.    To make application more understandable (Flow of the code). 
2.    Easy to maintain, easy to modify application and we can maintain good look of architecture.
3.    If we use this 3-Tier application we can maintain our application in consistency manner.   

Basically 3-Tier architecture contains 3 layers

1.    Application Layer
2.    Business Logic Layer (BLL) 
3.    Data Access Layer (DAL)

How to set a particular page as Startup page in MVC project?


Today I am going to explain how to set a particular page as Startup page in MVC project.

In normal three tier architecture we will select an aspx page in the solution explorer. Then right click on the page and select set as start page in the menu items.

But in an MVC project we cannot set a page as set as start page.

In order to set that page as a startup page we need to write the code in Global.asax page.

Go to global.asax.cs page.

Create a method called Application_Start() and write the following code

protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);
        }
Now in RegisterRoutes method add the path info to the page.
public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{id}",
                defaults: new { id = RouteParameter.Optional }
            );

What is Early Binding and Late Binding in C#.NET and what is the Difference between Early Binding and Late Binding


In this article I will explain what is Early Binding and Late Binding in C#.NET and what is the Difference between Early Binding and Late Binding.

Polymorphism:

An operation may exhibit different behaviours in different instances.Polymorphism means same operation may behave differently on different classes.The behaviour depends on the data types used in the operation.
Polymorphism is extensively used in implementing Inheritance.

 In Polymorphism we have 2 different types those are

       -  Early Binding
       -  Late Binding

What is polymorphism and types of polymorphism in C#.NET?


In this article I will explain what is polymorphism and types of polymorphism in C#.NET.

Polymorphism means same operation may behave differently on different classes.
An operation may exhibit different behaviours in different instances.
The behaviour depends on the data types used in the operation.
Polymorphism is extensively used in implementing Inheritance.

 In Polymorphism we have 2 different types those are

       -  Overloading
       -  Overriding

Wednesday 4 December 2013

What is C#.NET?


In this article i will explain what is C#.NET?
         
            C# (pronounced "C-sharp") is an object-oriented programming language from Microsoft that aims to combine the computing power of C++ with the programming ease of Visual Basic. C# is based on C++ and contains features similar to those of Java.

            C# is designed to work with Microsoft's .Net platform. Microsoft's aim is to facilitate the exchange of information and services over the Web, and to enable developers to build highly portable applications. C# simplifies programming through its use of Extensible Markup Language (XML) and Simple Object Access Protocol (SOAP) which allow access to a programming object or method without requiring the programmer to write additional code for each step. Because programmers can build on existing code, rather than repeatedly duplicating it, C# is expected to make it faster and less expensive to get new products and services to market.

How to show tooltip in DropDownList items on Mouseover event in asp.net using C#


In this article I will how to show tooltip in DropDownList items on Mouseover event in asp.net using C#

First we need bind data to DropDownList. See the below code for binding data to DropDownList.

Void BindDataToDropDownList()
{
  DataSet ds=new DataSet();
                ds = objUserRegistrationManager.GetSubDivision();
                ddlSubDivision.DataSource = ds;
                ddlSubDivision.DataValueField = "SDO_CD";
                ddlSubDivision.DataTextField = "SDO_CD";
                ddlSubDivision.DataBind();
}

How to convert DataTable or DataSet data to arraylist using ASP.NET


In this article I will explain how to convert DataTable or DataSet data to arraylist using ASP.NET.

The below first method code is very useful for convert DataSet to arraylist. First we need to establish a connection to SQL server. And get data from database and bind data to DatSet after we convert dataset data to arraylist.

// DataSet to arraylist
public ArrayList DatasettoArrayList()
{
DataSet dsDataSet = new DataSet();
ArrayList list=new ArrayList();
using (SqlConnection con = new SqlConnection("Data Source=localhost;Initial Catalog=FirstSample; User ID=sa;Password=sa@123"))
{
using (SqlCommand cmd = new SqlCommand("select * from Employee ", con))
{
con.Open();
SqlDataAdapter da = new SqlDataAdapter(cmd);
da.Fill(dsDataSet);

foreach (DataRow dtrow in dsDataSet.Tables[0].Rows)
{
list.Add(dtrow);
}
}
}
return list;
}

How to get server path and how to create Directory in C#


In this article I will explain how to get server path and how to create Directory in C#.net

Write below for server path for specific folder.

string Images_Path = Server.MapPath("~/") + "\\Upload\\";

How to create Directory in C#

First we need to add below namespace in class file.

using System.IO;

Monday 2 December 2013

How create data table in ASP.NET? How to add data to Data table?


In this article I will explain how create datatable in ASP.NET? How to add data to Datatable?

First we need to add below namespace for DataTable.

using System.Data;

After we can declare datatable shown below.

DataTable dtVerifyMobileNo = new DataTable();

Below method is useful for Add columns to the data table.

  void CreateDynamicTableForEmpty()
        {
            dtVerifyMobileNo.Columns.Add("cons_ref");
            dtVerifyMobileNo.Columns.Add("mobile");
            dtVerifyMobileNo.Columns.Add("name");
        }

How to write code for grid row cancel event in KENDO UI ASP.NET MVC


In this article I will explain How to write code for grid row cancel event in KENDO UI ASP.NET MVC

Below code is use full for bind data to grid.

In events section we write a row cancel event.

@(Html.Kendo().Grid<KendoUIMvcApplication1.Models.GenerateDataCorrespondingToItem>()
                .HtmlAttributes(new { style = "width:100%;" })
                .Name("grid_#=ID#")
                .Columns(columns =>
                {
                    columns.Bound(o => o.ID).Width(5).Visible(false);
                    columns.Bound(o => o.date).Width(50).Format("{0:MM-dd}").Title("Date");
                    //columns.Bound(o => o.item).Width(90).Title("Item");
                    columns.Bound(o => o.comp).Width(50).Title("Company");
                   
                    columns.Command(command => { command.Edit().Text(" ").UpdateText(" ").CancelText(" "); }).Width(75);
                })
                .Editable(editable => editable.Mode(GridEditMode.InLine))
                .Events(events => events.DataBound("dataBound1").Cancel("OnCancel"))
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .PageSize(15)
                    .Events(events => { events.RequestEnd("RequestCompleted"); })
                    .Model(model =>
                           {
                               model.Id(o => o.ID);
                               model.Field(o => o.date).Editable(false);
                              
                           }
                            )
)
)