Featured Articles

Decoration

All Stories

Wednesday, 14 July 2021

Convert Decimal Number / Currency To Words In C#.net

In this article we will she how we can convert the number or decimal number or currency into words using C#.net.  In this article we will cover below topics:

  1. Convert decimal number to words in c#.net
  2. Convert Numbers To Words In C#
  3. Convert Numeric Value Into Words (Currency) In C#
  4. Convert number with decimals (in currency) to words
  5. C# Number (Decimal) to word converter in Dollar

So for this first we you need a c# library to convert the decimal into words using c#.net in console application.  You can download the library code from here. You just need to include this code into your application.

Download 

Now we will prepare a console application and add the below code.

 

using System;

using System.Collections.Generic;

using System.IO;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using Aspdotnetpools.DecimalToWordExtension;

namespace ConsoleApp1

{

       class Program

       {

        static void Main(string[] args)

        {

            decimal val =Convert.ToDecimal(1000000.456);

               Console.WriteLine(DecimalToWordExtension.ToWords(val));

            Console.ReadLine();

        }

       }

}

 

 

In above code I have added the included Aspdotnetpools.DecimalToWordExtension into the project and then converted the word. Here is the output.

Convert Decimal Number / Currency To Words In C#.net


7/14/2021 - By Pranav Singh 0

Thursday, 8 July 2021

How to View/Display File After Uploading in App_Data In Asp.net Using C#.Net

In this article I will show you how you can display file or document or PDF file present in App_Data folder in browser in after uploading in asp.net application using C#.Net and VB.Net.

You May Also Like:

 How to Extract Text From PDF File Using C#.Net

Code to Export GridView to PDF in Asp.Net Using C# and Vb.Net


Suppose you have PDF file in you’re App_Data folder. Now follow the step to show the PDF file in your asp.net application.

Step 1:

In this step we will add PDF file in our App_Data folder.

App_data folder in asp.net

Step 2:

In this step we will add a new asp.net page on which we will display the App_Data folder.

Step 3:

Follow the below mention code to convert the PDF file into Byte array string.

     public void     PDFDisplay()

        {

            string fileFolderPath = "~/App_Data/professional-cloud-architect.pdf ";

            String file = Convert.ToBase64String(File.ReadAllBytes(Server.MapPath(fileFolderPath)));

            byte[] bytes = Convert.FromBase64String(bytePDF);

            Response.Clear();

            Response.ContentType = "application/pdf";

            Response.Buffer = true;

               Response.Cache.SetCacheability(HttpCacheability.NoCache);

            Response.BinaryWrite(bytes);

            Response.End();

            Response.Close();

        }

 

Here in above code I have first stored the App_Data folder file path in a string variable and after that converted it into base64bit string.

Now through the Response.BinaryWrite function the PDF file file have been displayed on the screen. Now run the application and check the output.


How to Open PDF Files in Web Brower Using ASP.NET


You May Also Like:

 iTextSharp To Create PDF In C#

Export Html To PDF In Asp.Net C#

7/08/2021 - By Pranav Singh 0

Monday, 5 July 2021

How To Get Selected Values Of CheckBoxList With Foreach/LINQ in ASP.NET C#?

In this article I will show you how you can get the selected value of your checkboxlist in your asp.net application using c#.net. in this I will use LINQ and for look to get the selected checkboxlist value your can get.   

How To Get Selected Values Of CheckBoxList With Foreach/LINQ in ASP.NET C#?


So first we will take a checkboxlist control and bind some value. 


     <asp:CheckBoxList ID="cblItemType" runat="server" RepeatDirection="Horizontal">

                <asp:ListItem>Item1</asp:ListItem>

                <asp:ListItem>Item2</asp:ListItem>

                <asp:ListItem>Item3</asp:ListItem>

            </asp:CheckBoxList>

 

Now here are the code:

With LINQ to get selected item value:

     List<string> selectedItem = cblItemType.Items.Cast<ListItem>()

                                                    .Where(li => li.Selected)

                                                    .Select(li => li.Value)

                                                    .ToList();

 

With Foreach:

List<string> selectedItem = new List<string>();

                    foreach(ListItem item in cblItemType.Items)

                    {

                        if (item.Selected)

                        {

                               selectedItem.Add(item.Value);

                        }

                    }

 

Now run the article to check the output.

 

7/05/2021 - By Pranav Singh 0

Friday, 2 July 2021

How to Create/Build Registration From


This article will show you how you can create registration form in c#.net with SQL database. So in this article I have used Ms SQL server database. In this I will save the user login detail into sql table by using c#.net

7/02/2021 - By Pranav Singh 0

How To Build/Create a Login Form (CSS, jQuery For Asp.net, .Net Core and MVC Application)

In this article i will show you how you can create a responsive login form using css, HTML and jQuery.  For this article first we will create a web application and add a new page in it. Now we will design the login form.


So first we will add the below references into the page header. 


       <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" />

       <script src="https://code.jquery.com/jquery-1.12.4.js"></script>

    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

 

After adding this references we will design our login form. Please check the code.


        <div>

            <input type="button" value="Click to Open Login" class="ui-button ui-icon-alert" id="openloginform" />

        </div>

 

        <!-- This is your login form area-->

        <div id="dialog-form" title="LOGIN AREA">

            <p style="text-align: center;">

                <img src="Login-icon.png" width="150px" />

            </p>

            <p>

                <span  style="float: left; margin: 0 7px 0px 0;font-weight:bold;">Login Id</span>

                <input type="text" class="text" />

            </p>

            <p>

                <span style="float: left; margin: 0 7px 0px 0; font-size: 15px;font-weight:bold;">Password</span>

                <input type="password" class="text" />

            </p>

            <p>

                <input type="button" class="ui-button" value="Login" />

            </p>

        </div>

 

In above code i have added a button control. When user click on the button it will open the login form. Just below the button logon form html tag have been added.

Now we will add the jQuery code which make the login form open the an animated form inside the model popup window.


     $(function () {

            $("#dialog-form").dialog({

                autoOpen: false,

                show: {

                    effect: "blind",

                    duration: 1000

                }

            });

            $("#openloginform").on("click"function () {

                $("#dialog-form").dialog("open");

            });

        });

 

Now here is the complete code of the page. 


<!DOCTYPE html>

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

       <title>How to create a login form</title>

       <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" />

       <script src="https://code.jquery.com/jquery-1.12.4.js"></script>

       <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>

       <style>

        input[type=text]input[type=password] {

            width100%;

            padding12px 20px;

            margin8px 0;

            displayinline-block;

            border1px solid #ccc;

            box-sizingborder-box;

        }

       </style>

       <script>

        $(function () {

            $("#dialog-form").dialog({

                autoOpen: false,

                show: {

                    effect: "blind",

                    duration: 1000

                }

            });

            $("#openloginform").on("click"function () {

                $("#dialog-form").dialog("open");

            });

        });

       </script>

 

</head>

<body>

           <div>

            <input type="button" value="Click to Open Login" class="ui-button ui-icon-alert" id="openloginform" />

        </div>

 

        <!-- This is your login form area-->

        <div id="dialog-form" title="LOGIN AREA">

            <p style="text-align: center;">

                <img src="Login-icon.png" width="150px" />

            </p>

            <p>

                <span  style="float: left; margin: 0 7px 0px 0;font-weight:bold;">Login Id</span>

                <input type="text" class="text" />

            </p>

            <p>

                <span style="float: left; margin: 0 7px 0px 0; font-size: 15px;font-weight:bold;">Password</span>

                <input type="password" class="text" />

            </p>

            <p>

                <input type="button" class="ui-button" value="Login" />

            </p>

        </div>

</body>

</html>

 

 

Now we have done open the page in browser to check the output.

Hot to create a login form

Download

7/02/2021 - By Pranav Singh 0

Free Ebooks


About Us

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Contact Us

For writing article in this website please send request by your

GMAIL ID: dotnetpools@gmail.com

Bugs and Suggestions

As we all know that this website is for sharing knowledge and providing proper solution. So while reading the article is you find any bug or if you have any suggestion please mail us at contact@aspdotnet-pools.com.

Partners


Global Classified : Connectseekers.com
© 2014 aspdotnet-pools.com Designed by Bloggertheme9.
back to top