This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@page "{id:int}" | |
@model EditPageModel | |
@{ | |
} | |
<h2>Edit</h2> | |
<form method="post"> | |
<table class="table table-bordered" style="width:500px"> | |
<tbody> | |
<tr> | |
<td> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@page | |
@*Adding the reference of model class*@ | |
@using NetCoreRazorPageApp.Model | |
@using Microsoft.EntityFrameworkCore; | |
@{ | |
ViewData["Title"] = "Home page"; | |
} | |
@inject NetCoreRazorPageApp.Model.EmployeeDbContext dbcontext | |
@functions { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddDbContext<EmployeeDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("EmployeeDbContext"))); | |
services.AddMvc(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Logging": { | |
"IncludeScopes": false, | |
"LogLevel": { | |
"Default": "Warning" | |
} | |
}, | |
"ConnectionStrings": { | |
"EmployeeDbContext": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=C:\\LEARNING\\BLOG\\NETCORERAZORPAGEAPP\\NETCORERAZORPAGEAPP\\APPDATA\\EMPLOYEEDB.MDF;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=False" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EmployeeDbContext : DbContext | |
{ | |
public EmployeeDbContext(DbContextOptions<EmployeeDbContext> options) : base(options) | |
{ | |
} | |
public DbSet<Employee> Employee { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Employee | |
{ | |
[Key] | |
public int EmployeeID { get; set; } | |
[Required] | |
public string EmployeeName { get; set; } | |
[Required] | |
public string EmployeeAddress { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function SampleCode(){alert(3)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function SampleCode() | |
{ | |
var i = 1; | |
var j = 2; | |
alert(i + j); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[System.Web.Script.Services.ScriptMethod()] | |
[System.Web.Services.WebMethod] | |
public static List<string> SearchCustomer(string prefixText, int count) | |
{ | |
string conString = ConfigurationManager.ConnectionStrings["AdventureWorksConnectionString"].ConnectionString; | |
using (SqlConnection conn = new SqlConnection(conString)) | |
{ | |
using (SqlCommand cmd = new SqlCommand()) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> | |
<script> | |
function hideOptionList() { | |
$find('ACE').hidePopup(); | |
} | |
var finalresult; | |
//Customize the SetText function to create comma separated string from selected values | |
Sys.Extended.UI.AutoCompleteBehavior.prototype._setText = function (item) { | |
var text = (item && item.firstChild) ? item.firstChild.nodeValue : null; | |
this._timer.set_enabled(false); |