Monday, February 29, 2016

Try Catch

For understanding the methodology of try  and catch in C# this link is very helpful.
See this link:
understanding try and catch

Wednesday, February 24, 2016

SS Technology

My facebook page. Go to this link. This page is helpful for you.

SS Technology

Join with this group. Explore knowledge.

SS Technology Group


Thank you for visiting my blog

Hide and Show a div

  <div class="row" id="receivablediv">

           

           
   </div>

<br />
            <div class="row" id="payablediv">

             
            </div>




 <script type="text/javascript">
        $(document).ready(function () {
           
            $("#payablediv").hide();
            $("#receivablediv").show();
  });

Tuesday, February 23, 2016

Adding background Images in your website

 <div class="jumbotron text-center" style="background-Image : url(~/Images/Company/banner2.JPG)">
        <h1>Company Name</h1>
        <p>Company Title</p>
     
    </div>

Saturday, February 20, 2016

Addition and Multiplication by C Programming

//Addition and multiplication of n numbers
#include<stdio.h>
int main()
{
    long n,count,num,a=0,m=1;
    /*Enter user choice of input*/
    printf("How many numbers you want to input: ");
    scanf("%ld",&n);
    /*Read n numbers*/
    printf("Please enter %ld numbers\n",n);
    for(count=1;count<=n;count++)
    {
        scanf("%ld",&num);
        a=a+num;
        m=m*num;
    }
    printf("Addition is %ld\n",a);
    printf("Multiplication is %ld",m);
    return 0;
}

Friday, February 19, 2016

Making DropDownList readonly

 <script type="text/javascript">
        $(document).ready(function () {

  $("#DropdownlistID").attr("disabled", "disabled");

    });
</script>

Structure of C Programming

Writing code in Code block software you need to start with this basic structure.


#include<stdio.h>

int main()
{




return 0;
}

Monday, February 15, 2016

What is resistance



Resistance is the opposition that a substance offers to the flow of electric current.  It is represented by the uppercase letter R.  The standard unit of resistance is the ohm, sometimes written out as a word, and sometimes symbolized by the uppercase Greek letter omega: Greek letter omega


Combining the elements of voltage, current, and resistance, Ohm developed the formula:
alt text
Where
  • V = Voltage in volts
  • I = Current in amps
  • R = Resistance in ohms


Saturday, February 13, 2016

Migration in ASP.NET MVC project

I developed my web application in code first approach. When I changed my model then I have run the following commands for changing database.

Enable-Migrations -ContextTypeName DemoDbContext // It's only for first time


add-migration InitialCreate

and then,
Update-Database

Why should we use TabIndex

I used tabIndex for readonly textbox. Because we don't need to focus readonly field when we use "tab" for one textbox to another textbox. It's very simple.

@Html.TextBoxFor(model => model.USERPC, htmlAttributes: new { id = "textidUserpc", @class = "form-control", @readonly = "readonly", tabIndex = "-1" })




Friday, February 12, 2016

Split Date and Time from DateTime

You can easily split date and time from a datetime. See this:


DateTime dtValue;  // load your date & time into this variable
TextBox1.Text = dtValue.ToString("yyyy-MM-dd");
TextBox2.Text = dtValue.ToString("HH:mm:ss");

Thursday, February 11, 2016

Uncaught Error: Bootstrap's JavaScript requires jQuery

Add updated jquery link upper part of all javascript file

such as :
    <script src="~/Scripts/jquery-2.2.0.min.js"></script>

The problem will be solved. 

Wednesday, February 10, 2016

Latitude and Longitude

I am using latitude and longitude for my project. See this:

  //Latitute & longitude
    <script src="http://maps.google.com/maps/api/js?sensor=false">
    </script>

    <script language="javascript" type="text/javascript">
        $(function () {
            navigator.geolocation.getCurrentPosition(showPosition);
            //navigator.geolocation.getCurrentPosition(showPosition, positionError);

            function showPosition(position) {
                var coordinates = position.coords;
                $("#lat").val(coordinates.latitude);
                $("#lon").val(coordinates.longitude);

                $("#latlonPos").val(
                    $("#lat").val() + "," + $("#lon").val()
                );
                $("#latlonRms").val(
                    $("#lat").val() + "," + $("#lon").val()
                );
            }
        });
    </script>

Date picker for getting year

<link href="~/Content/bootstrap_datepicker_css/datepicker.css" rel="stylesheet" />
<link href="~/Content/bootstrap_datepicker_css/datepicker3.css" rel="stylesheet" />





            $("#PatientYear").datepicker({
                format: "yyyy", // Notice the Extra space at the beginning
                viewMode: "years",
                minViewMode: "years",
                autoclose: true
            });



<script src="~/Scripts/bootstrap-datepicker.js"></script>





Autocomplete in ASP.NET MVC

Here is my autocomplete in a project. You can use this:
1. "txtCostPNM" is an id in the textbox where autocomplete needed
2. "TagSearch" method name and "CostPoolReport" controller name
3. COSTPNM and COSTPID returned from the method and then assign these values to the textbox

You need to make your own method. Here I just request data from view and catch data from controller for assigning the value.

$('#txtCostPNM').autocomplete(
            {
                source:function(request, response) {
                 
                    //var changedText2 = $("#txtcompid").val();
                    //var changedText3 = $("#TransactionDate").val();
                    $.ajax({

                        url:'@Url.Action("TagSearch", "CostPoolReport")',
                        type: 'GET',
                        cache: false,
                        data: { term: request.term},
                        dataType: 'json',
                        success: function (data) {
                            response($.map(data, function (item) {
                                return {
                                    label: item.COSTPNM,
                                    value: item.COSTPNM,
                                    id: item.COSTPID,
                               


                                };
                            }));
                        }
                    });
                },
                select:  function (event, ui) {
                    $('#txtCostPNM').val(ui.item.label);
                    $('#txtCostPID').val(ui.item.id);

               
                    //txtOneChanged();

                    //return false;
                },
                change: $('#txtCostPNM').keyup(_.debounce(txtOneChanged, 100)),
             
             

         

            });




   function txtOneChanged() {
            var changedText = $("#txtCostPNM").val();
            var txtBox = document.getElementById('txtCostPNM');
            var txtBox1 = document.getElementById('txtCostPID');
            $.getJSON(
                '/CostPoolReport/ItemNameChanged', { "ChangedText": changedText },
                function (result) {
                    txtBox.value = result.Costname;
                    txtBox1.value = result.Costpid;

                    //document.getElementById("txtCostPNM").focus();
                });
        }

Tuesday, February 9, 2016

Convert DateTime to Month-Year format in C#

 

string converttoString = Convert.ToString(changedtxt.ToString("dd-MMM-yyyy"));
string getYear = converttoString.Substring(9, 2);
string getMonth = converttoString.Substring(3, 3);
string Month = getMonth + "-" + getYear;//Dec-15 (Example)

Monday, February 8, 2016

What is ASP.NET MVC

Understanding ASP.NET MVC. It's helpful for you.


“M” “V” “C” stands for “MODEL” “VIEW” “CONTROLLER”. ASP.NET MVC is an architecture to develop ASP.NET web applications in a different manner than the traditional ASP.NET web development. Web applications developed with ASP.NET MVC are even more SEO (Search Engine) friendly.

see  Here.

Thank you