Quantcast
Channel: ASP.NET Core
Viewing all 9386 articles
Browse latest View live

How to Shift Left a row of Thumbnails

$
0
0

My code is currently:

<div class="img-wrap">

    <img class="item-thumb" src="file1.jpg" id="thumbimg" onclick="ShowLarge(this);" />

    <img class="item-thumb" src="file2.jpg" id="thumbimg" onclick="ShowLarge(this);" />

     (and then replicated for 8 more thumbnails)

</div>

Suppose product1 has 6 thumbnails, and product2 has 8 thumbnails. How can I shift-left the images?

I am learning html and Razor, so I'm open to any suggestions!


Most standard approach for returning results in an api

$
0
0

Ok so normally I write my apis like this

  public IEnumerable<WeatherForecast> Get()
        {

but of recent I saw a couple of my .net friends use the ActionResult. Some thing like this below

  public ActionResult<IEnumerable<WeatherForecast>> Get()
        {

Ok so is it a better coding practice to use ActionResult.  Please enlighten me. I dont use this till now and my api works fine. But I am very curious on best coding practice.

Cos I know on the international level this is what makes a developer stand out  from the baby programmers.

Rest API request limit - Dot net core 3.1

$
0
0

I have developed a REST API using dot net core 3.1.  I developed the same using dot net core 2.2.  While doing load test, I found that the REST API requests of all types and to all endpoints are limited in the following ways:

IP address - 8,300 requests per minute

Can someone help me to understand why the request is limited to 8300 requests per minute and where can I change it so that I can increase it.   It seems that there is a rate limit for the number of request? Please note that I developed the app with the default code provided and I have not added any other code that would change anything in the settings.

Thank in advance!

issues with Dbcontext.dbset.AddAsync in EF core 3.1

$
0
0

Hi,

I am trying to add a record using DBContext.DBset.AddAsync. This is how my code is:

await _dbContext.myDbSet.AddAsync(myentity);

int result = _dbContext.SaveChanges();

Please note that the datatypes in DBSet, database table and entity passed are in sync.

But the control is getting lost at _dbContext.SaveChanges() and the data is not getting saved in database. Am I doing something wrong?

I am using EF core 3.1.2.

Any help would be appreciated.

Best Regards,

Simpy Sinha

Upload a file to Google drive does not work!

$
0
0

Hi

I'm trying to upload a file to google drive using google drive Api in my core 2.1 project, So I followed these instructions:

https://developers.google.com/drive/api/v3/quickstart/dotnet

But it doesn't work.

The Google Drive Api settings in Google Cloud Platform:

Api is enabled:

Credentials:

Authorized redirect URI:

Of course I've copied the credentials.json json file to my project directory as mentioned in the instructions.

Orders model property (which I want to attach the file to):

public string WorkURL { get; set; }

Upload method:

        public void Upload(string path)
        {
            UserCredential credential;

            using (var stream =
                new FileStream("credentials.json", FileMode.Open, FileAccess.Read))
            {
                // The file token.json stores the user's access and refresh tokens, and is created
                // automatically when the authorization flow completes for the first time.
                string credPath = "token.json";
                credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
                    GoogleClientSecrets.Load(stream).Secrets,
                    Scopes,"user",
                    CancellationToken.None,
                    new FileDataStore(credPath, true)).Result;
                //Console.WriteLine("Credential file saved to: " + credPath);
            }

            // Create Drive API service.
            var service = new DriveService(new BaseClientService.Initializer()
            {
                HttpClientInitializer = credential,
                ApplicationName = ApplicationName,
            });

            // Define parameters of request.
            FilesResource.ListRequest listRequest = service.Files.List();
            listRequest.PageSize = 10;
            listRequest.Fields = "nextPageToken, files(id, name)";

            // List files.
            IList<Google.Apis.Drive.v3.Data.File> files = listRequest.Execute()
                .Files;


        }

OrdersController:

    public class OrdersController : Controller
    {
        private readonly ApplicationDbContext _context;
        private string[] Scopes = { DriveService.Scope.Drive };
        static string ApplicationName = "CoreWebApp";


        public OrdersController(ApplicationDbContext context)
        {
            _context = context;
        }

        [HttpPost]
        public async Task<IActionResult> Edit(int id, [Bind("Id,WorkURL")] Orders orders)
        {
            if (id != orders.Id)
            {
                return NotFound();
            }

            if (ModelState.IsValid)
            {
                try
                {
                    Upload(orders.WorkURL);
                    _context.Update(orders);
                    await _context.SaveChangesAsync();
                    ViewBag.mess = "Saved";
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OrdersExists(orders.Id))
                    {
                        return NotFound();
                    }
                    else
                    {
                        throw;
                    }
                }
            }
            return View(orders);
        }

Getting the file in Edit view:

<div class="form-group"><label asp-for="WorkURL" class="control-label"></label><input asp-for="WorkURL" type="file" class="form-control" /><span asp-validation-for="WorkURL" class="text-danger"></span></div>

But when choosing some file and save the data no file is uploaded to google drive and no action happened but saving.

Why? and how to solve?

Help Needed in xml File reference

$
0
0

Hi,

I am working in asp.net core 2.2. i using swagger for documentation and am able to configure and make it work. i am having one issue. i have included the xml comments  for the propertied in of my class and its located in different class library project. i have referenced this class library assembly of my asp.net core api project.  but how do i refer the xml file which is getting generated in my class library project? when i run the api, i can't see the swagger document. 

To test it,  i copied the xml file manually to the AppContext.BaseDirectory location, its showing. But i want this to happen automatically. please help me on referencing the class library project generated xml file in api project automatically. 

How to switch to "View"?

$
0
0

Question.
1. What HTML page elements to use to follow links to other View?
Example.
1.1 - <a> </a>
1.2 - <input type = "submit" name = "name" value = "submit_1" />
1.3 - <button> </button>
others?
 
2. What principles are used to switch to View?
What are the most effective principles?
What are the most preferred principles?
 
Example.
2.1 Follow direct links (href = "~ / Views / View1 /");
2.2 Transition using the controller method;
I understand correctly?
 
3. Ways to click on the links?
What are the most effective ways?
What are the most preferred methods?
Example.
3.1 - href;
3.2 - tag-helpers;
others?
 
4. Is it possible to place several `View` in the folder of one controller?
Example \ Home \ View0.cshtml;
 
Description.
I understand that the question is probably wide, so at least I will be grateful for a short answer to the question.
Please apply the answer to my project structure.
Browse Pages:
 - \ Home \ View0.cshtml;
 - \ View1 \ Index.cshtml.
 
Code (my attempts).

HomeController.cs

using Microsoft.AspNetCore.Mvc;

namespace WebAppCore.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}

public ActionResult View1()
{
return View();
}

public ActionResult View2()
{
return View();
}


}
}

\Home\Index.cshtml

@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers<h1> *** Test View Main ***</h1><h2> *** From the box ***</h2><a href="~/Views/View1/">A_View1</a><input type="submit" name="name" value="submit_1" /><button>button_1</button><h2> *** Tag hepler ***</h2><a asp-action="View1">A_action</a><a action="View1">A_action</a><button asp-action="View1">button_1_1</button>

Installing KnockoutJS on asp.net Core using VS2019, help needed

$
0
0

Hi ,

Am trying to install knockoutjs on asp.net core web application, it got installed successully,using VS2019 .But when I search for the specific js in the project folder, couldn't find any. Being a beginner with core ,need your help.Thanks


How to execute a script at the click of a button?

$
0
0

Project structure - see picture.
How to make the text "test" move to the right after each button click?
How to do this using elements:
- <a>
- <button> Start js </button>
- <input type = "submit" value = "Start js" />
 
 
ScriptTest1.js (preliminary example)

var divxPos = 0;
function runCode ()
{     element = document.getElementById ("testElement");     element.style.left = divxPos ++ + 'px';     setTimeout (() => runCode (element), 50);
}

Index.cshtml

<body>     <p id = "testElement" style = "position: absolute"> test </p></body>





Update 1
  How to run a script with the click of a button if the script is located in a separate file?
Condition:
- the script is located in a separate file;


Update 2
View1.cshtml- not working
Chrome -> F12 -> Sources - I do not see the file "ScriptTest2.js"
Code

@section Scripts
{     <script src = "~ / js / ScriptTest2.js"> </script>
}<body>     <button type = "button" id = "btnMove" onclick = "runCode ();"> Move it </button>     <div id = "testElement" style = "padding-left: 1px;"> test </div></body>

When I enter the path with my hands, the file "ScriptTest2.js" is displayed in the prompts.

View2.cshtml - works
Chrome -> F12 -> Sources - I see the file "ScriptTest2.js"

Code

<script src = "~ / js / ScriptTest2.js"> </script><body><button type = "button" id = "btnMove" onclick = "runCode ();"> Move it </button><div id = "testElement" style = "padding-left: 1px;"> test </div></body>

Question.
Why when I use "@section Scripts" the script does not appear in "Chrome -> F12 -> Sources"?

defaulted dates overridden every time I save changes

$
0
0

I have used:


modelBuilder.Entity<PersonSurveyed>()
.Property(p => p.Created)
.HasDefaultValueSql("getdate()")
.ValueGeneratedOnAdd();

modelBuilder.Entity<PersonSurveyed>()
.Property(p => p.LastUpdated)
.HasDefaultValueSql("getdate()")
.ValueGeneratedOnAdd();

in OnModelCreating to generate defaults for properties when they are created. This works fine on create but when I save the records values created with these defaults get set to null. This is not happneing database side because when I go and do these transaction manually the values are left alone. 


public class EntityBase
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
[Display(Name = "Created")]
[DisplayFormat(DataFormatString = "{0:dd MMM yyyy h:m:s tt}")]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public DateTime Created { get; }
[Display(Name = "Last Updated")]
[DisplayFormat(DataFormatString = "{0:dd MMM yyyy h:m:s tt}")]
[DatabaseGenerated(DatabaseGeneratedOption.Computed)]
public DateTime LastUpdated { get; }
}

As you can see there is no set so the properties shouldn't be being written to when I save changes.

Any help would be very welcome.

Thanks

w3p3 IIS process blocking file deletion

$
0
0

Hi,

I am successfully uploading pictures from a webpage to my server, creating some OpenXML and downloading that file. Now, after that, I would like to delete the pictures that were uploaded. But everytime I get a "xx.jpg is used by another process - can't be deleted". I managed to find out it is the w3p3 process still using it, although all my actions are completed. Even after closing the browser and stopping any client requests etc. it is still being used. I than have to restart the server or kill the process to get rid of the pictures.

Here is my Code for Uploading and using the pics in OpenXML… I don't see the trouble... The Upload function gets called from Dropzone once for each picture.

Thank you for your help!

    [HttpPost]

        public async Task<ActionResult> UploadFiles()
        {
            // Methode wird für jedes pic aufgerufen

            var files = HttpContext.Request.Form.Files;

            System.Security.Claims.ClaimsPrincipal currentUser = this.User;
            string uname = currentUser.Identity.Name;

            string folderpath = @"D:\Uploaded_Files\" + uname;

            Random rand = new Random();
            int r = rand.Next(0, 10000);

            while (Directory.Exists(folderpath + @"\" + r + ".jpg"))
                r = rand.Next(0, 10000);

            string filePath = folderpath + @"\" + r + ".jpg";

            if (files[0].Length > 0)
            {     using (var fileStream = new FileStream(filePath, FileMode.Create))
                {
                    await files[0].CopyToAsync(fileStream).ConfigureAwait(false);
                    fileStream.Close();
                }
            }

            return Json("file uploaded successfully");
        }
public static void AddImage(string file, string image, long width, long height)
        {
            using (var presentation = PresentationDocument.Open(file, true))
            {
                var slidePart = presentation
                    .PresentationPart
                    .SlideParts
                    .ElementAt(u);
                //.First();

                var part = slidePart
                    .AddImagePart(ImagePartType.Png);

                using (var stream = File.OpenRead(image))
                {
                    // try catch weil es sonst einen "process is using pic" error gibt - UNSOLVED
                    try
                    {
                        part.FeedData(stream);
                        //stream.Flush();
                        //stream.Dispose();
                        stream.Close();
                    }
                    catch
                    {
                        stream.Close();
                    }
                }
                var tree = slidePart
                    .Slide
                    .Descendants<DocumentFormat.OpenXml.Presentation.ShapeTree>()
                    .First();

                var picture = new DocumentFormat.OpenXml.Presentation.Picture();

                picture.NonVisualPictureProperties = new DocumentFormat.OpenXml.Presentation.NonVisualPictureProperties();
                picture.NonVisualPictureProperties.Append(new DocumentFormat.OpenXml.Presentation.NonVisualDrawingProperties
                {
                    Name = "My Shape",
                    Id = (UInt32)tree.ChildElements.Count - 1
                });

                var nonVisualPictureDrawingProperties = new DocumentFormat.OpenXml.Presentation.NonVisualPictureDrawingProperties();
                nonVisualPictureDrawingProperties.Append(new DocumentFormat.OpenXml.Drawing.PictureLocks()
                {
                    NoChangeAspect = true
                });
                picture.NonVisualPictureProperties.Append(nonVisualPictureDrawingProperties);
                picture.NonVisualPictureProperties.Append(new DocumentFormat.OpenXml.Presentation.ApplicationNonVisualDrawingProperties());

                var blipFill = new DocumentFormat.OpenXml.Presentation.BlipFill();
                var blip1 = new DocumentFormat.OpenXml.Drawing.Blip()
                {
                    Embed = slidePart.GetIdOfPart(part)
                };
                var blipExtensionList1 = new DocumentFormat.OpenXml.Drawing.BlipExtensionList();
                var blipExtension1 = new DocumentFormat.OpenXml.Drawing.BlipExtension()
                {
                    Uri = "{28A0092B-C50C-407E-A947-70E740481C1C}"
                };
                var useLocalDpi1 = new DocumentFormat.OpenXml.Office2010.Drawing.UseLocalDpi()
                {
                    Val = false
                };
                useLocalDpi1.AddNamespaceDeclaration("a14", "http://schemas.microsoft.com/office/drawing/2010/main");
                blipExtension1.Append(useLocalDpi1);
                blipExtensionList1.Append(blipExtension1);
                blip1.Append(blipExtensionList1);
                var stretch = new DocumentFormat.OpenXml.Drawing.Stretch();
                stretch.Append(new DocumentFormat.OpenXml.Drawing.FillRectangle());
                blipFill.Append(blip1);
                blipFill.Append(stretch);
                picture.Append(blipFill);

                picture.ShapeProperties = new DocumentFormat.OpenXml.Presentation.ShapeProperties();
                picture.ShapeProperties.Transform2D = new DocumentFormat.OpenXml.Drawing.Transform2D();
                picture.ShapeProperties.Transform2D.Append(new DocumentFormat.OpenXml.Drawing.Offset
                {
                    X = 9144000/2 - width/2,
                    Y = 6800000/2 - height/2,
                });
                picture.ShapeProperties.Transform2D.Append(new DocumentFormat.OpenXml.Drawing.Extents
                {
                    Cx = (int) width,
                    Cy = (int) height,
                });
                picture.ShapeProperties.Append(new DocumentFormat.OpenXml.Drawing.PresetGeometry
                {
                    Preset = DocumentFormat.OpenXml.Drawing.ShapeTypeValues.Rectangle
                });

                tree.Append(picture);
            }
}

Encrypt DLL files under a IIS web application

$
0
0

I know that there are some tools that can decrypt dll files and turn them back to c# code.

Is there any free tool to help encrypt the files in advance, so that the customer won't be able to do that?

I must mention I am working with Visual Studio 2019

and i have a web application (IIS)

Thanks

Session data getting lost after data being posted on page.

$
0
0

I have an ecommerce app in dotnet core 2.2 For the customer's to make their payments they have to be redirected to a bank's secure page where they will enter their card number ccv etc. After that they are being redirected to one of me sites pages depending on the result of the payment. If they payment is complete or failed I am getting some data according to the payment posted to my page  via a post method. When the payment is cancelled i am not getting any data at all. If the user cancels the payment he returns to the PaymentCancel page and everything is just fine. But when the payment is somehow complete (either successful or not) my session data(where i have stored some crucial about the order data such as items or billing address) is lost. Why am i getting this behavior? What am i missing?

Javascript and Asp.Net Core 3.1 input check boxes broken

$
0
0

Hello,

     So I had this working in Asp.net Core 2.2 with Twitter-Bootstrap 3.3.7.  I then upgraded to Asp.net Core 3.1 and Twitter-Bootstrap 4.4.  Now I am unable to get some of my javascript functions to work.  Setting breakpoints in the javascript in Chrome and Edge, they do not get hit at all.  Though I ran the output from the web through JS Fiddle and it works perfectly fine there.  So I am at a loss for what I did to break this.

What I have is a gating function within javascript that will uncheck any check boxes that are in sequence after a check box if it is unchecked, if it is checked it will enable the next available check box, leaving the others disabled.  When I run it in IIS Express this no longer happens.

Here is the Javascript I have for one page:

//Loops through the checkboxes and disables the next ones if the previous is not checked
function changeFields(fields) {
    fields.change(function () {
        Array.prototype.reduce.call(fields, function (prev, curr) {
            curr.disabled = !prev.checked || prev.disabled;


            //If you want to uncheck remaining use this instead of above line:
            curr.checked = prev.checked ? curr.checked : false;
            curr.disabled = !prev.checked;

            return curr;
        });
    });
}

//Call the for the CharacterCraft
changeFields($(".cALScb"));
changeFields($(".cALMcb"));
changeFields($(".cBLScb"));
changeFields($(".cBLMcb"));
changeFields($(".cCLScb"));
changeFields($(".cCLMcb"));



Here is the what I have in view calling this:

<form asp-controller="CharacterCrafts" asp-action="Edit" method="post"><div class="form-horizontal"><hr />
        @Html.ValidationSummary( true, "", new { @class = "text-danger" } )<div class="col-lg-12 text-center"><b style="text-align: center; font-family: 'Times New Roman', Times, serif; font-size: x-large">@Html.DisplayFor( a => a.CharNames.CharFullName )</b><br /><b style="text-align: center; font-family: 'Times New Roman', Times, serif; font-size: large">@Html.DisplayFor( a => a.CharNames.ProfName )</b></div><br /><br /><div class="form-group"><div class="form-group row"><div class="col-lg-2">
                    @Html.Label( "Crafting Class" )</div><div class="col-lg-1">
                    @Html.Label( "Tier Achieved" )</div><div class="col-lg-1">
                    @Html.Label( "Tier Name" )</div><div class="col-lg-1">
                    @Html.Label( "Mastery" )</div><div class="col-lg-1">
                    @Html.Label( "Tier Achieved" )</div><div class="col-lg-1">
                    @Html.Label( "Tier Name" )</div><div class="col-lg-1">
                    @Html.Label( "Mastery" )</div><div class="col-lg-1">
                    @Html.Label( "Tier Achieved" )</div><div class="col-lg-1">
                    @Html.Label( "Tier Name" )</div><div class="col-lg-1">
                    @Html.Label( "Mastery" )</div></div><div class="form-group row">
                @for ( var h = 0; h<1; h++ )
                {<div class="col-lg-2"><br /><br /><br /><b>@Html.DisplayFor( a => a.CraftListA[ h ].CraftClassName )</b><br /><br /></div><div class="form-group row col-lg-10">
                        @{ int j = 0;}
                        @for ( var i = 0; i<Model.CraftListA.Count; i++ )
                        {<input type="hidden" asp-for="@Model.CraftListA[i].CharCraftCharID" /><input type="hidden" asp-for="@Model.CraftListA[i].CharCraftClassID" /><input type="hidden" asp-for="@Model.CraftListA[i].CharCraftLevelID" /><input type="hidden" asp-for="@Model.CraftListA[i].CraftLevelTier" /><div class="col-lg-1"><input type="checkbox" asp-for="@Model.CraftListA[i].CraftLevelSet" class="cALScb" /></div><div class="col-lg-2"><b>@Html.DisplayFor( a => a.CraftListA[ i ].CraftLevelName )</b></div><div class="col-lg-1"><input type="checkbox" asp-for="@Model.CraftListA[i].CraftLevelMastery" class="cALMcb" /></div>
                            j++;
                            if ( j==3 )
                            {<br />
                                j=0;
                            }
                            else
                            {
                                continue;
                            }
                        }</div>
                }</div><div class="form-group row">
                @for ( var h = 0; h<1; h++ )
                {<div class="col-lg-2"><br /><br /><br /><b>@Html.DisplayFor( a => a.CraftListB[ h ].CraftClassName )</b><br /><br /></div><div class="form-group row col-lg-10">
                        @{ int j = 0;}
                        @for ( var i = 0; i<Model.CraftListB.Count; i++ )
                        {<input type="hidden" asp-for="@Model.CraftListB[i].CharCraftCharID" /><input type="hidden" asp-for="@Model.CraftListB[i].CharCraftClassID" /><input type="hidden" asp-for="@Model.CraftListB[i].CharCraftLevelID" /><input type="hidden" asp-for="@Model.CraftListB[i].CraftLevelTier" /><div class="col-lg-1"><input type="checkbox" asp-for="@Model.CraftListB[i].CraftLevelSet" class="cBLScb" /></div><div class="col-lg-2"><b>@Html.DisplayFor( a => a.CraftListB[ i ].CraftLevelName )</b></div><div class="col-lg-1"><input type="checkbox" asp-for="@Model.CraftListB[i].CraftLevelMastery" class="cBLMcb" /></div>
                            j++;
                            if ( j==3 )
                            {<br />
                                j=0;
                            }
                            else
                            {
                                continue;
                            }
                        }</div>
                }</div><div class="form-group row">
                @for ( var h = 0; h<1; h++ )
                {<div class="col-lg-2"><br /><br /><br /><b>@Html.DisplayFor( a => a.CraftListC[ h ].CraftClassName )</b><br /><br /></div><div class="form-group row col-lg-10">
                        @{ int j = 0;}
                        @for ( var i = 0; i<Model.CraftListC.Count; i++ )
                        {<input type="hidden" asp-for="@Model.CraftListC[i].CharCraftCharID" /><input type="hidden" asp-for="@Model.CraftListC[i].CharCraftClassID" /><input type="hidden" asp-for="@Model.CraftListC[i].CharCraftLevelID" /><input type="hidden" asp-for="@Model.CraftListC[i].CraftLevelTier" /><div class="col-lg-1"><input type="checkbox" asp-for="@Model.CraftListC[i].CraftLevelSet" class="cCLScb" /></div><div class="col-lg-2"><b>@Html.DisplayFor( a => a.CraftListC[ i ].CraftLevelName )</b></div><div class="col-lg-1"><input type="checkbox" asp-for="@Model.CraftListC[i].CraftLevelMastery" class="cCLMcb" /></div>
                            j++;
                            if ( j==3 )
                            {<br />
                                j=0;
                            }
                            else
                            {
                                continue;
                            }
                        }</div>
                }</div></div><div class="form-group row"><div class="col-lg-12 row"><div class="col-lg-3"><b>Select a Guild:</b></div>
                @for ( var i = 0; i<Model.Guild.Count; i++ )
                {<input type="hidden" asp-for="@Model.Guild[i].FactionID" /><div class="col-lg-1"><input type="checkbox" asp-for="@Model.Guild[i].isChecked" /></div><div class="col-lg-3"><b>@Html.DisplayFor( a => a.Guild[ i ].FactionName )</b></div>
                }</div></div><div class="form-group row"><div class="col-lg-12 row"><div class="col-lg-offset-2 col-lg-2"><input type="submit" value="Save" class="btn btn-secondary" /></div><div class="col-lg-5"></div><div class="col-lg-2"><a asp-controller="Menu" , asp-action="EdChar" , null, class="btn btn-danger">Cancel</a></div></div></div></div></form>

Everything displays correctly on the page, but after an unchecked check box everything is still enabled.  This can been seen in the output from Edge:

<div class="form-group"><div class="form-group row"><div class="col-lg-2"><label for="Crafting_Class">Crafting Class</label></div><div class="col-lg-1"><label for="Tier_Achieved">Tier Achieved</label></div><div class="col-lg-1"><label for="Tier_Name">Tier Name</label></div><div class="col-lg-1"><label for="Mastery">Mastery</label></div><div class="col-lg-1"><label for="Tier_Achieved">Tier Achieved</label></div><div class="col-lg-1"><label for="Tier_Name">Tier Name</label></div><div class="col-lg-1"><label for="Mastery">Mastery</label></div><div class="col-lg-1"><label for="Tier_Achieved">Tier Achieved</label></div><div class="col-lg-1"><label for="Tier_Name">Tier Name</label></div><div class="col-lg-1"><label for="Mastery">Mastery</label></div></div><div class="form-group row"><div class="col-lg-2"><br><br><br><b>Farmer</b><br><br></div><div class="form-group row col-lg-10"><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListA_0__CharCraftCharID" name="CraftListA[0].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListA_0__CharCraftClassID" name="CraftListA[0].CharCraftClassID" value="2"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListA_0__CharCraftLevelID" name="CraftListA[0].CharCraftLevelID" value="1"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListA_0__CraftLevelTier" name="CraftListA[0].CraftLevelTier" value="1"><div class="col-lg-1"><input type="checkbox" class="cALScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListA_0__CraftLevelSet" name="CraftListA[0].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Apprentice</b></div><div class="col-lg-1"><input type="checkbox" class="cALMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListA_0__CraftLevelMastery" name="CraftListA[0].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListA_1__CharCraftCharID" name="CraftListA[1].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListA_1__CharCraftClassID" name="CraftListA[1].CharCraftClassID" value="2"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListA_1__CharCraftLevelID" name="CraftListA[1].CharCraftLevelID" value="5"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListA_1__CraftLevelTier" name="CraftListA[1].CraftLevelTier" value="2"><div class="col-lg-1"><input type="checkbox" class="cALScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListA_1__CraftLevelSet" name="CraftListA[1].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Journeyman</b></div><div class="col-lg-1"><input type="checkbox" class="cALMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListA_1__CraftLevelMastery" name="CraftListA[1].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListA_2__CharCraftCharID" name="CraftListA[2].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListA_2__CharCraftClassID" name="CraftListA[2].CharCraftClassID" value="2"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListA_2__CharCraftLevelID" name="CraftListA[2].CharCraftLevelID" value="4"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListA_2__CraftLevelTier" name="CraftListA[2].CraftLevelTier" value="3"><div class="col-lg-1"><input type="checkbox" class="cALScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListA_2__CraftLevelSet" name="CraftListA[2].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Expert</b></div><div class="col-lg-1"><input type="checkbox" class="cALMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListA_2__CraftLevelMastery" name="CraftListA[2].CraftLevelMastery" value="true"></div><br><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListA_3__CharCraftCharID" name="CraftListA[3].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListA_3__CharCraftClassID" name="CraftListA[3].CharCraftClassID" value="2"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListA_3__CharCraftLevelID" name="CraftListA[3].CharCraftLevelID" value="2"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListA_3__CraftLevelTier" name="CraftListA[3].CraftLevelTier" value="4"><div class="col-lg-1"><input type="checkbox" class="cALScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListA_3__CraftLevelSet" name="CraftListA[3].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Artisan</b></div><div class="col-lg-1"><input type="checkbox" class="cALMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListA_3__CraftLevelMastery" name="CraftListA[3].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListA_4__CharCraftCharID" name="CraftListA[4].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListA_4__CharCraftClassID" name="CraftListA[4].CharCraftClassID" value="2"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListA_4__CharCraftLevelID" name="CraftListA[4].CharCraftLevelID" value="6"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListA_4__CraftLevelTier" name="CraftListA[4].CraftLevelTier" value="5"><div class="col-lg-1"><input type="checkbox" class="cALScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListA_4__CraftLevelSet" name="CraftListA[4].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Master</b></div><div class="col-lg-1"><input type="checkbox" class="cALMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListA_4__CraftLevelMastery" name="CraftListA[4].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListA_5__CharCraftCharID" name="CraftListA[5].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListA_5__CharCraftClassID" name="CraftListA[5].CharCraftClassID" value="2"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListA_5__CharCraftLevelID" name="CraftListA[5].CharCraftLevelID" value="7"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListA_5__CraftLevelTier" name="CraftListA[5].CraftLevelTier" value="6"><div class="col-lg-1"><input type="checkbox" class="cALScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListA_5__CraftLevelSet" name="CraftListA[5].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Supreme</b></div><div class="col-lg-1"><input type="checkbox" class="cALMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListA_5__CraftLevelMastery" name="CraftListA[5].CraftLevelMastery" value="true"></div><br><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListA_6__CharCraftCharID" name="CraftListA[6].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListA_6__CharCraftClassID" name="CraftListA[6].CharCraftClassID" value="2"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListA_6__CharCraftLevelID" name="CraftListA[6].CharCraftLevelID" value="9"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListA_6__CraftLevelTier" name="CraftListA[6].CraftLevelTier" value="7"><div class="col-lg-1"><input type="checkbox" class="cALScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListA_6__CraftLevelSet" name="CraftListA[6].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Westfold</b></div><div class="col-lg-1"><input type="checkbox" class="cALMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListA_6__CraftLevelMastery" name="CraftListA[6].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListA_7__CharCraftCharID" name="CraftListA[7].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListA_7__CharCraftClassID" name="CraftListA[7].CharCraftClassID" value="2"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListA_7__CharCraftLevelID" name="CraftListA[7].CharCraftLevelID" value="3"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListA_7__CraftLevelTier" name="CraftListA[7].CraftLevelTier" value="8"><div class="col-lg-1"><input type="checkbox" class="cALScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListA_7__CraftLevelSet" name="CraftListA[7].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Eastenmnet</b></div><div class="col-lg-1"><input type="checkbox" class="cALMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListA_7__CraftLevelMastery" name="CraftListA[7].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListA_8__CharCraftCharID" name="CraftListA[8].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListA_8__CharCraftClassID" name="CraftListA[8].CharCraftClassID" value="2"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListA_8__CharCraftLevelID" name="CraftListA[8].CharCraftLevelID" value="8"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListA_8__CraftLevelTier" name="CraftListA[8].CraftLevelTier" value="9"><div class="col-lg-1"><input type="checkbox" class="cALScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListA_8__CraftLevelSet" name="CraftListA[8].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Westemnet</b></div><div class="col-lg-1"><input type="checkbox" class="cALMcb" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListA_8__CraftLevelMastery" name="CraftListA[8].CraftLevelMastery" value="true"></div><br></div></div><div class="form-group row"><div class="col-lg-2"><br><br><br><b>Scholar</b><br><br></div><div class="form-group row col-lg-10"><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListB_0__CharCraftCharID" name="CraftListB[0].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListB_0__CharCraftClassID" name="CraftListB[0].CharCraftClassID" value="7"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListB_0__CharCraftLevelID" name="CraftListB[0].CharCraftLevelID" value="1"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListB_0__CraftLevelTier" name="CraftListB[0].CraftLevelTier" value="1"><div class="col-lg-1"><input type="checkbox" class="cBLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListB_0__CraftLevelSet" name="CraftListB[0].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Apprentice</b></div><div class="col-lg-1"><input type="checkbox" class="cBLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListB_0__CraftLevelMastery" name="CraftListB[0].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListB_1__CharCraftCharID" name="CraftListB[1].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListB_1__CharCraftClassID" name="CraftListB[1].CharCraftClassID" value="7"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListB_1__CharCraftLevelID" name="CraftListB[1].CharCraftLevelID" value="5"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListB_1__CraftLevelTier" name="CraftListB[1].CraftLevelTier" value="2"><div class="col-lg-1"><input type="checkbox" class="cBLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListB_1__CraftLevelSet" name="CraftListB[1].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Journeyman</b></div><div class="col-lg-1"><input type="checkbox" class="cBLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListB_1__CraftLevelMastery" name="CraftListB[1].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListB_2__CharCraftCharID" name="CraftListB[2].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListB_2__CharCraftClassID" name="CraftListB[2].CharCraftClassID" value="7"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListB_2__CharCraftLevelID" name="CraftListB[2].CharCraftLevelID" value="4"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListB_2__CraftLevelTier" name="CraftListB[2].CraftLevelTier" value="3"><div class="col-lg-1"><input type="checkbox" class="cBLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListB_2__CraftLevelSet" name="CraftListB[2].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Expert</b></div><div class="col-lg-1"><input type="checkbox" class="cBLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListB_2__CraftLevelMastery" name="CraftListB[2].CraftLevelMastery" value="true"></div><br><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListB_3__CharCraftCharID" name="CraftListB[3].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListB_3__CharCraftClassID" name="CraftListB[3].CharCraftClassID" value="7"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListB_3__CharCraftLevelID" name="CraftListB[3].CharCraftLevelID" value="2"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListB_3__CraftLevelTier" name="CraftListB[3].CraftLevelTier" value="4"><div class="col-lg-1"><input type="checkbox" class="cBLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListB_3__CraftLevelSet" name="CraftListB[3].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Artisan</b></div><div class="col-lg-1"><input type="checkbox" class="cBLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListB_3__CraftLevelMastery" name="CraftListB[3].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListB_4__CharCraftCharID" name="CraftListB[4].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListB_4__CharCraftClassID" name="CraftListB[4].CharCraftClassID" value="7"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListB_4__CharCraftLevelID" name="CraftListB[4].CharCraftLevelID" value="6"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListB_4__CraftLevelTier" name="CraftListB[4].CraftLevelTier" value="5"><div class="col-lg-1"><input type="checkbox" class="cBLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListB_4__CraftLevelSet" name="CraftListB[4].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Master</b></div><div class="col-lg-1"><input type="checkbox" class="cBLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListB_4__CraftLevelMastery" name="CraftListB[4].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListB_5__CharCraftCharID" name="CraftListB[5].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListB_5__CharCraftClassID" name="CraftListB[5].CharCraftClassID" value="7"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListB_5__CharCraftLevelID" name="CraftListB[5].CharCraftLevelID" value="7"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListB_5__CraftLevelTier" name="CraftListB[5].CraftLevelTier" value="6"><div class="col-lg-1"><input type="checkbox" class="cBLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListB_5__CraftLevelSet" name="CraftListB[5].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Supreme</b></div><div class="col-lg-1"><input type="checkbox" class="cBLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListB_5__CraftLevelMastery" name="CraftListB[5].CraftLevelMastery" value="true"></div><br><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListB_6__CharCraftCharID" name="CraftListB[6].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListB_6__CharCraftClassID" name="CraftListB[6].CharCraftClassID" value="7"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListB_6__CharCraftLevelID" name="CraftListB[6].CharCraftLevelID" value="9"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListB_6__CraftLevelTier" name="CraftListB[6].CraftLevelTier" value="7"><div class="col-lg-1"><input type="checkbox" class="cBLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListB_6__CraftLevelSet" name="CraftListB[6].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Westfold</b></div><div class="col-lg-1"><input type="checkbox" class="cBLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListB_6__CraftLevelMastery" name="CraftListB[6].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListB_7__CharCraftCharID" name="CraftListB[7].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListB_7__CharCraftClassID" name="CraftListB[7].CharCraftClassID" value="7"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListB_7__CharCraftLevelID" name="CraftListB[7].CharCraftLevelID" value="3"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListB_7__CraftLevelTier" name="CraftListB[7].CraftLevelTier" value="8"><div class="col-lg-1"><input type="checkbox" class="cBLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListB_7__CraftLevelSet" name="CraftListB[7].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Eastenmnet</b></div><div class="col-lg-1"><input type="checkbox" class="cBLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListB_7__CraftLevelMastery" name="CraftListB[7].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListB_8__CharCraftCharID" name="CraftListB[8].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListB_8__CharCraftClassID" name="CraftListB[8].CharCraftClassID" value="7"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListB_8__CharCraftLevelID" name="CraftListB[8].CharCraftLevelID" value="8"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListB_8__CraftLevelTier" name="CraftListB[8].CraftLevelTier" value="9"><div class="col-lg-1"><input type="checkbox" class="cBLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListB_8__CraftLevelSet" name="CraftListB[8].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Westemnet</b></div><div class="col-lg-1"><input type="checkbox" class="cBLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListB_8__CraftLevelMastery" name="CraftListB[8].CraftLevelMastery" value="true"></div><br></div></div><div class="form-group row"><div class="col-lg-2"><br><br><br><b>Weaponsmith</b><br><br></div><div class="form-group row col-lg-10"><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListC_0__CharCraftCharID" name="CraftListC[0].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListC_0__CharCraftClassID" name="CraftListC[0].CharCraftClassID" value="9"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListC_0__CharCraftLevelID" name="CraftListC[0].CharCraftLevelID" value="1"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListC_0__CraftLevelTier" name="CraftListC[0].CraftLevelTier" value="1"><div class="col-lg-1"><input type="checkbox" class="cCLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListC_0__CraftLevelSet" name="CraftListC[0].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Apprentice</b></div><div class="col-lg-1"><input type="checkbox" class="cCLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListC_0__CraftLevelMastery" name="CraftListC[0].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListC_1__CharCraftCharID" name="CraftListC[1].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListC_1__CharCraftClassID" name="CraftListC[1].CharCraftClassID" value="9"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListC_1__CharCraftLevelID" name="CraftListC[1].CharCraftLevelID" value="5"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListC_1__CraftLevelTier" name="CraftListC[1].CraftLevelTier" value="2"><div class="col-lg-1"><input type="checkbox" class="cCLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListC_1__CraftLevelSet" name="CraftListC[1].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Journeyman</b></div><div class="col-lg-1"><input type="checkbox" class="cCLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListC_1__CraftLevelMastery" name="CraftListC[1].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListC_2__CharCraftCharID" name="CraftListC[2].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListC_2__CharCraftClassID" name="CraftListC[2].CharCraftClassID" value="9"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListC_2__CharCraftLevelID" name="CraftListC[2].CharCraftLevelID" value="4"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListC_2__CraftLevelTier" name="CraftListC[2].CraftLevelTier" value="3"><div class="col-lg-1"><input type="checkbox" class="cCLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListC_2__CraftLevelSet" name="CraftListC[2].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Expert</b></div><div class="col-lg-1"><input type="checkbox" class="cCLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListC_2__CraftLevelMastery" name="CraftListC[2].CraftLevelMastery" value="true"></div><br><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListC_3__CharCraftCharID" name="CraftListC[3].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListC_3__CharCraftClassID" name="CraftListC[3].CharCraftClassID" value="9"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListC_3__CharCraftLevelID" name="CraftListC[3].CharCraftLevelID" value="2"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListC_3__CraftLevelTier" name="CraftListC[3].CraftLevelTier" value="4"><div class="col-lg-1"><input type="checkbox" class="cCLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListC_3__CraftLevelSet" name="CraftListC[3].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Artisan</b></div><div class="col-lg-1"><input type="checkbox" class="cCLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListC_3__CraftLevelMastery" name="CraftListC[3].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListC_4__CharCraftCharID" name="CraftListC[4].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListC_4__CharCraftClassID" name="CraftListC[4].CharCraftClassID" value="9"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListC_4__CharCraftLevelID" name="CraftListC[4].CharCraftLevelID" value="6"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListC_4__CraftLevelTier" name="CraftListC[4].CraftLevelTier" value="5"><div class="col-lg-1"><input type="checkbox" class="cCLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListC_4__CraftLevelSet" name="CraftListC[4].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Master</b></div><div class="col-lg-1"><input type="checkbox" class="cCLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListC_4__CraftLevelMastery" name="CraftListC[4].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListC_5__CharCraftCharID" name="CraftListC[5].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListC_5__CharCraftClassID" name="CraftListC[5].CharCraftClassID" value="9"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListC_5__CharCraftLevelID" name="CraftListC[5].CharCraftLevelID" value="7"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListC_5__CraftLevelTier" name="CraftListC[5].CraftLevelTier" value="6"><div class="col-lg-1"><input type="checkbox" class="cCLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListC_5__CraftLevelSet" name="CraftListC[5].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Supreme</b></div><div class="col-lg-1"><input type="checkbox" class="cCLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListC_5__CraftLevelMastery" name="CraftListC[5].CraftLevelMastery" value="true"></div><br><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListC_6__CharCraftCharID" name="CraftListC[6].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListC_6__CharCraftClassID" name="CraftListC[6].CharCraftClassID" value="9"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListC_6__CharCraftLevelID" name="CraftListC[6].CharCraftLevelID" value="9"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListC_6__CraftLevelTier" name="CraftListC[6].CraftLevelTier" value="7"><div class="col-lg-1"><input type="checkbox" class="cCLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListC_6__CraftLevelSet" name="CraftListC[6].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Westfold</b></div><div class="col-lg-1"><input type="checkbox" class="cCLMcb" checked="checked" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListC_6__CraftLevelMastery" name="CraftListC[6].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListC_7__CharCraftCharID" name="CraftListC[7].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListC_7__CharCraftClassID" name="CraftListC[7].CharCraftClassID" value="9"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListC_7__CharCraftLevelID" name="CraftListC[7].CharCraftLevelID" value="3"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListC_7__CraftLevelTier" name="CraftListC[7].CraftLevelTier" value="8"><div class="col-lg-1"><input type="checkbox" class="cCLScb" checked="checked" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListC_7__CraftLevelSet" name="CraftListC[7].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Eastenmnet</b></div><div class="col-lg-1"><input type="checkbox" class="cCLMcb" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListC_7__CraftLevelMastery" name="CraftListC[7].CraftLevelMastery" value="true"></div><input type="hidden" data-val="true" data-val-required="The CharCraftCharID field is required." id="CraftListC_8__CharCraftCharID" name="CraftListC[8].CharCraftCharID" value="1"><input type="hidden" data-val="true" data-val-required="The CharCraftClassID field is required." id="CraftListC_8__CharCraftClassID" name="CraftListC[8].CharCraftClassID" value="9"><input type="hidden" data-val="true" data-val-required="The CharCraftLevelID field is required." id="CraftListC_8__CharCraftLevelID" name="CraftListC[8].CharCraftLevelID" value="8"><input type="hidden" data-val="true" data-val-required="The CraftLevelTier field is required." id="CraftListC_8__CraftLevelTier" name="CraftListC[8].CraftLevelTier" value="9"><div class="col-lg-1"><input type="checkbox" class="cCLScb" data-val="true" data-val-required="The CraftLevelSet field is required." id="CraftListC_8__CraftLevelSet" name="CraftListC[8].CraftLevelSet" value="true"></div><div class="col-lg-2"><b>Westemnet</b></div><div class="col-lg-1"><input type="checkbox" class="cCLMcb" data-val="true" data-val-required="The CraftLevelMastery field is required." id="CraftListC_8__CraftLevelMastery" name="CraftListC[8].CraftLevelMastery" value="true"></div><br></div></div></div>

Ideally from the output the very last check box should be disabled, but it is not.  Though if I go to JS Fiddle, this works as such: https://jsfiddle.net/MikeRM2/bzfcme06/

So this leads to wondering what went wrong, as it works in JS Fiddle but not on the actual site.  I am not getting any errors in the console or debug.  Any thoughts on why this is not working anymore would be appreciated.

ui controls for .net core

$
0
0

Can we know the free ui controls for .net core available. Why cant the microsoft provide the basic ui controls for .net core


What does it mean for an ASP.NET Core app to run locally?

$
0
0

I am reading this tutorial: Host ASP.NET Core on Linux with Nginx https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx

And I am struggling to understand this sentence:

"Publish and copy over the app

Configure the app for a framework-dependent deployment.

If the app is run locally and isn't configured to make secure connections (HTTPS), adopt either of the following approaches:"

How else is an ASP.NET core app run but locally on a machine? That doesn't make sense to me. 


It looks like someone may have had the same question as me but the issue was closed as no issue: 
https://github.com/dotnet/AspNetCore.Docs/issues/12097

jqgrid with crud operation in .net core

$
0
0

I have observed jqgrid with crud operation in mvc. But would like to use in .net core project.

How to update/remove certain items in a cache object?

$
0
0

Hello,

How to update/remove certain items in a cache object using IMemoryCache?

When getting cache object, I do below...

[HttpGet]
public IEnumerable<string> Get()
{
string key = "ALLCar-Key";

IList<CarModel> carModelCached = _cache.GetOrCreate(key, entry =>
{
var sampleRecordFromDB = new List<CarModel>
{
new CarModel() { Id = 10, Name = "Hyundai", Year = 1998 },
new CarModel() { Id = 20, Name = "GMC", Year = 2013 },
new CarModel() { Id = 30, Name = "Subaru", Year = 2019 },
};

return sampleRecordFromDB.ToList();
});


return carModelCached;
}


but, if after I do an update/insert, I have to refetch from DB and insert back the updated data to cache.

[HttpPost]
public void Post(List<CarModel> car)
{
string key = "ALLCar-Key";

//fetch from db (removed for brevity...)

var sampleRecordFromDB = new List<CarModel>
{
new CarModel() { Id = 10, Name = "Hyundai", Year = 1998 },
new CarModel() { Id = 20, Name = "GMC", Year = 2020 }, //<<<<------UPDATED VALUE HERE
new CarModel() { Id = 30, Name = "Subaru", Year = 2019 },
};

MemoryCacheEntryOptions options = new MemoryCacheEntryOptions
{
AbsoluteExpiration = DateTime.Now.AddDays(1)
};

_cache.Set(key, sampleRecordFromDB.ToList(), options);
}


My data runs around 150K item, and doing just a simple update to one item then do the cache update is too expensive (performance wise - slow).

Is there a way that I could read from cache and do a single item update/insert from within the cache object?


Thanks,

ASP.NET Core 3.1 :JsonPropertyName Error

$
0
0

I am having Asp.Net Core 3.1 Application, And After changing DataMember to JsonPropertyName Getting error as below

<div>Error CA2227 Change 'FilterStatus' to be read-only by removing the property setter.</div>
[JsonPropertyName("filterFlags")]
public List<FilterType> FilterStatus { get; set; }

How to resize image before upload to varbinary column?

$
0
0

Hi

I'm uploading an image to a varbinary column in the database successfully. But I want to resize it before uploading.

So this is what I tried:

Guests model:

public byte[] Image { get; set; }

public string ContentType { get; set; }

ImageExtentions Class to resize the image:

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.IO;
using System.Linq;
using System.Threading.Tasks;

namespace System.Drawing
{
    public static class ImageExtentions
    {
        public static Image Resize(this Image current, int maxWidth, int maxHeight)
        {
            int width, height;

            if (current.Width > current.Height)
            {
                width = maxWidth;
                height = Convert.ToInt32(current.Height * maxHeight / (double)current.Width);
            }
            else
            {
                width = Convert.ToInt32(current.Width * maxWidth / (double)current.Height);
                height = maxHeight;
            }

            var canvas = new Bitmap(width, height);

            using (var graphics = Graphics.FromImage(canvas))
            {
                graphics.CompositingQuality = CompositingQuality.HighSpeed;
                graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
                graphics.CompositingMode = CompositingMode.SourceCopy;
                graphics.DrawImage(current, 0, 0, width, height);
            }

            return canvas;
        }

        public static byte[] ToByteArray(this Image current)
        {
            using (var stream = new MemoryStream())
            {
                current.Save(stream, current.RawFormat);
                return stream.ToArray();
            }
        }
    }
}

GuestsController:

//using a lot
using System.Drawing;
namespace Proj.Controllers
{
public class GuestsController : Controller
{
private readonly ApplicationDbContext _context; public GuestsController(ApplicationDbContext context) { _context = context; } //Some code [HttpPost] [ValidateAntiForgeryToken] public async Task<IActionResult> Create([Bind("Id,Name,DoB")] Guests guest, List<IFormFile> Image) { IFormFile uploadedImage = Image.FirstOrDefault(); if (ModelState.IsValid) { foreach (var item in Image) { if (item.Length > 0) { using (var stream = new MemoryStream()) { using (Image img = Image.FromStream(uploadedImage.OpenReadStream())) { Stream ms = new MemoryStream(img.Resize(900, 1000).ToByteArray()); FileStreamResult fsr = new FileStreamResult(ms, "image/jpg"); uploadedImage.OpenReadStream().CopyTo(stream); guest.Image = stream.ToArray(); guest.ContentType = uploadedImage.ContentType; } } } } } _context.Add(guest); await _context.SaveChangesAsync();
}

But this scenario gives me this error:

List<IFormFile> does not contain a definition for 'FromStream' and no accessible extension method  'FromStream' accepting a first argument of type List<IFormFile> could be found.

How to perform this task please?

Viewing all 9386 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>