Skip to main content

Posts

Showing posts from August, 2014

Featured Post

How to use Tabs in ASP.NET CORE

I want to show Components in a tabs , so first of all create few components. In this project we have three components, First View Component  public class AllViewComponent : ViewComponent     {         private readonly UserManager<ApplicationUser> _userManager;         public AllViewComponent(UserManager<ApplicationUser> userManager)         {             _userManager = userManager;         }         public async Task<IViewComponentResult> InvokeAsync()         {             List<StudentViewModel> allUsers = new List<StudentViewModel>();             var items = await _userManager.Users.ToListAsync();             foreach (var item in items)             {                 allUsers.Add(new StudentViewModel {Id=item.Id, EnrollmentNo = item.EnrollmentNo, FatherName = item.FatherName, Name = item.Name, Age = item.Age, Birthdate = item.Birthdate, Address = item.Address, Gender = item.Gender, Email = item.Email });             }            

Basics about JQUERY, Types of Selectors

To change the web page after rendered programmer has to change the coding done for the page and then refresh again. To manipulate a web page after it has been rendered without change the coding part, programmer often uses Jquery. Jquery library makes it easy to change the functionality of web page smoothly. Jquery library provides tools that enable user to interact with the page or to include animations on page. This article will describe about some basic elements of jquery library, later we will implement some functionality on the page with tools provided by the library. To user jquery library programmer must have a reference on the web page or layout file. Selecting an element/control on which programmer will perform some action, jquery library provides selectors. These selectors can select any element/control on the basis of their id, class or their type as per the requirement. Showing an alert just after loading of the page, jquery provides an in-built function. Programmer c

How to Create Layout page and set for View: MVC

After creating default MVC application in Visual Studio there is a default layout file has been added in shared folder under views having name _Layout.cshtml. This file is used to provide consistent look on all of the pages having default layout page set. Changes done in this file will set for all the pages/views under this layout. The above extension ".cshtml" is used only in case of Razor and this will be changed for aspx views. Programmer can even change this layout file as per requirements or can use multiple layout files according to the roles/group  defined. All the scripts, styles and custom files must be included in this layout file if necessary for all views. If Programmer don't want to use any layout for the view then "Layout = null" must be set in the view page. This feature can only be set for that particular view. Now to create new layout file programmer have to add new item as "MVC Layout Page(Razor)" and change the name if required

How to view DLL function and properties in visual studio

You are a developers and you want to create a new project. Lots of code are hidden behind the .dll file, its a symbol of good programmer. Learn how to hide code from user in asp.net(How to create .DLL file in asp.net).    A .DLL file contains some namespaces, class definition, methods and some properties. You want to view the functions used in that dll so you should go for Object browser, which is available in visual studio. Lets take a step to view the .DLL file in visual studio. Step-1: Right click on any .DLL file, Open selected file in Object Browser and press 'ok' Button. Step-2 : Expand the file, which is contain namespace and methods. Left panel contains files and right panel contains methods and properties and many more item which is related to selected file in left panel. So you can easily use namespace and their methods. Learn How to use this.

Bind the Text property of a Text Box to the value property of a Slider in windows phone

Its a very simple method to bind Text Box from slider control in the windows phone. You can use  Property="{Binding <source property>, ElementName=<Source Name>}"  this method. Lets take an simple example 1. Add one Silder and One Text Box control on windows phone phone. <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">                         <TextBox x:Name="txtbox1" HorizontalAlignment="Left" Height="72" Margin="33,139,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="335" AcceptsReturn="True" Text="{Binding Value,ElementName=slider1}" ></TextBox>             <Slider x:Name="slider1" HorizontalAlignment="Left" VerticalAlignment="Top" Width="446" Margin="0,39,0,0" ValueChanged="slider1_ValueChanged"/>         </Grid> Code Ge

How to bind Text property of Text block to the text property of a text box in windows phone

Its a very simple method to bind Text Block from the Text Box in the windows phone. You can use Property="{Binding <source property>, ElementName=<Source Name>}" this method. Lets take an simple example 1. Add one Text Block and One Text Box control on windows phone phone. Xaml code  <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">             <TextBlock Text="{Binding text,ElementName=txtbox1}" x:Name="txtblock" HorizontalAlignment="Left" Margin="63,74,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="210"/>             <TextBox x:Name="txtbox1" HorizontalAlignment="Left" Height="72" Margin="33,139,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="335" AcceptsReturn="True"/>         </Grid> Code generate the following output

How to send sms in Windows Phone

Through SmsComposeTask class, we can send sms from one number to other numbers. In this application, first we get the number from contact list, after get the number we will send the sms on this. In previous versions of windows mobile where in an application could send text messages without the users permission, or even knowledge, The SmsComposeTask launches the messaging application with either(or both) the phone number or the message body specified. This class exist in Microsoft.Phone.Tasks namespace. Lets take a simple example for sending message to the sender. Xaml code <Grid x:Name="ContentPanel" Margin="24,151,0,10" Grid.RowSpan="2">             <TextBox HorizontalAlignment="Left" Height="72" Margin="10,24,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="260" RenderTransformOrigin="0.173,0.208" Name="T1"/>             <Butt

How to get phone number from their list of contacts in the windows phone

The PhoneNumberChooserTask class provide the way to retrieve the contact detail from windows phone. This class allow users to select a phone number from their list of contacts on the phone, you just need to create an instance of the PhoneNumberChooserTask and invoke its Show method. This class is exist in Microsoft.Phone.Tasks namespace. XAML source code  <Grid x:Name="ContentPanel" Margin="14,151,10,10" Grid.RowSpan="2">             <TextBox HorizontalAlignment="Left" Height="72" Margin="10,24,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="260" RenderTransformOrigin="0.173,0.208" Name="T1"/>             <Button Content="get Number" HorizontalAlignment="Left" Margin="270,26,0,0" VerticalAlignment="Top" Width="176" Click="Button_Click"/>         </Grid>

Bind ListBox with Image in windows Phone

Its a Great application in which we can develop products catalog application. Lets take a simple example to show product image with product name time. If you want to show image with  text, first to create class products.cs with two properties in the project. Now your code look like using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace WorldClock {     class products     {         public string  name { get; set; }         public string imagepath { get; set; }     } } Create a list collection with product type. Add some items into it. Now, after adding items, you can bind list with the list collection. First to add ListBox in the page . Bind this with itemSource property, now add two control (Textblock and image) in DataTemplate. <ListBox ItemsSource="{Binding}" ScrollViewer.VerticalScrollBarVisibility="Visible" Margin="0,152,19,243" x:Name="list1">