If you want to design login control then must to set the special character in password box. Today, we will learn, how to design password box in WPF. In WPF, we have a PasswordBox tag in XAML , through this we can add Password box in WPF. I have a simple login control through you can see password control.
In this WPF article, I will show you, single checkbox enable all other remaining checkboxes; if it is unchecked then remaining them also unchecked. To do this task, first of add single checkbox for all other checkboxes in the stack panel. Now, add other child checkboxes in nested stack panel. look at, simple xaml code view.
Here, we have checked and unchecked events. Both are calling same function in "Allselect" checkbox. In the child checkboxes also we have checked and unchecked event , they are calling same method. So in this program we have two method that is "AllSelect_Checked" and "singlecheckjava_Checked".
In this article, I will show you how to play mp4 and WMV file in asp.net. To do this task first to install Silverlight into your computer by the following link. After installed Silverlight, add System.Web.Silverlight.dll file reference in the bin folder. Add media player component in ToolBox by using right click on toolBox.
Right click on toolbox--> choose Items...--->.Net Framework Components--> Click on Browse Button also select System.Web.Sliverlight from uncompressed folder.
Drag Media player control from ToolBox to Web Form. Set Required property that is mentioned below.
Media Source = ~/movie/first.mp4
Here, we have movie folder.
Introduction
In this article, I will show you how to add multiple TextBox by using button click. When we press the button then add TextBox in the panel. Similarly again when we press the button then again TextBox add just after previous one. I will give you an example of add multiple TextBox dynamically in ASP.NET.
Source code
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
Code Behind page
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class DynamicallyAdd : System.Web.UI.Page
{
Panel panelforTextBox;
protected void Page_Load(object sender, EventArgs e)
{
Literal literal;
Label labelTextBox;
In this article, I will show you how to check MVC version of application. There are two methods, through which we can get the version of MVC. In the first method we use property of System.Web.MVC namespace. But, How to check, check the mentioned snap shots.
1. Expand References folder
2. Right click on System.Web.MVC namespace also select property , check the mentioned snap.
In this article, I will show you, How to create Shadow of controls. Through this, we can show 3d view of control. First of all, I will apply this style on manually created designs like Ellipse, Rectangle etc. After that I will apply same things on controls. So, add a new window in the project. Add this code in between the <grid> ...</grid> section of xaml file.
BitmapEffect creates the shadow effect behind the object. In the above-mentioned code we have Direction attribute. With the help of Direction attribute we can show shadow of control at user defined position.
In my previous article i have already learned about hyperlink and their uses, we have already use hyperlink in different application like asp.net. Previous article coves all such things like hyperlink properties and methods. Today i am talking about hyperlink in MVC, and how to use it.
The given snap shows that how MVC work. According to the sanp view show the all tags of html. In MVC application, we use ActionLink extension of HtmlHelper. I have show the syntax and example of Hyperlink.
OK Done this is complete. Now, Today we have also learn how to bind hyperlink from database table in MVC. First to prepare the class for employee entity in model folder also map this with database table(mentioned in previous article), Now your code look like
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;
namespace WebApplication10.Models
{
[Table("Employee")]
public class Employee
{
public int ID { get; set; }
public string Name { get; set; }
public int age { get; set; }
}
}
Prepare the Context class for connecting database in the same model folder.
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Web;
namespace WebApplication10.Models
{
public class EmployeeContext: DbContext
{
public EmployeeContext()
: base("EmployeeConnection")
{
}
public DbSet<Employee> pl { get; set; }
}
}
Here EmployeeContext() constructor call the base class constructor for making connection. "EmployeeConnection" connectionString available in web.confog file. Prepare the controller class for responding the request, which is generated by the client.
public ActionResult linkEmp()
{
EmployeeContext context = new EmployeeContext();
List<Employee> employeelist = context.pl.ToList();
return View(employeelist);
}
Through the EmployeeContext class, first we retrieve all the data from the table and then store into the employee instance. Now, prepare the view for list of employee.
@model IEnumerable<WebApplication10.Models.Employee>
@using WebApplication10.Models;
@{
ViewBag.Title = "Show the particular employee";
}
<h2>Click to show the details of employee</h2>
<ol>
@foreach (Employee emp in @Model)
{
<li>@Html.ActionLink(emp.Name, "Index", new { id = emp.ID })</li>
}
</ol>
Here, we are using IEnumerable interface for collection and in the ActionLink Method, first argument of that method shows the name of the employee and second parameter show that method, which is call by hyperlink(Mentioned in Controller class) also method contain single parameter like id.
public ActionResult Index(int id)
{
EmployeeContext context = new EmployeeContext();
Employee emp = context.pl.Single(p2=>p2.ID==id);
return View(emp);
}
Code Generate the following output
After click on Tarun(Hyperlink), You will get the specific Employee Information.