One additional question for you please?
On my hosted/deployed application I am now getting "400-Bad Request" on the .Woff files. I had made some changes to the bundleconfig.cs files, as I added some new plugins from Metronic docs. I have rolled back those changes to bundleconfig.cs file. Yet I still get the below errors, which I do not understand how they are coming up. Can you provide some guidance on what I should check? [attachment=0:3i4daf68]Screenshot (95).png[/attachment:3i4daf68]
I am developing a "profile" page for an entity in my application. I took a "profile" page from the Metronic documentation as my design for this page. This page is not a modal, but a normal CSHTML page like the index views.
Here is the HTML I am using: [attachment=0:39vhtmus]Screenshot (94).png[/attachment:39vhtmus]
When the page opens, it renders fine but throws the error shown below.
Uncaught ReferenceError: $ is not defined
The error references line 1255 of my code, shown below.
$(document).ready(function () {
Is there something different that needs to be done, in order to build a non-modal based page?
Thanks for pointing that setting out! I completely missed that! :o
I am using the below code for my AJAX JS calls
abp.ajax({
url: '/Address/GetStates',
data: JSON.stringify({ CID: countryId })
}).done(function (data) {
$.each(data, function (i, state) {
$("#EditState").append('<option value="' + state.value + '">' + state.text + '</option>');
if (selectedVal != null && $.trim(selectedVal) == $.trim(state.value)) {
$("#EditState").val($.trim(state.value));
}
});
}).fail(function () {
abp.notify.error('Get States failed!')
});
In the above code the .fail is NOT getting hit. It keeps displaying the default alert message as per the ABP AJAX docs (<a class="postlink" href="https://www.aspnetboilerplate.com/Pages/Documents/Javascript-API/AJAX">https://www.aspnetboilerplate.com/Pages ... t-API/AJAX</a>). I want the notify message to be displayed rather than the default ABP alert message.
var comps = _companyRepository.GetAll().Where(c => c.IsActive).ToList();
Thanks,,that helps! I had already tried that, but I did not use the .ToList() directly after the .Where.
<cite>hikalkan: </cite> Hi,
Just fixing @ismcagdas's response. As I understand, you are still using ASP.NET MVC 5.x + jQuery (not ASP.NET Core). In that case, you will still use EF 6.x, it's not changed.
In general, when you want to merge AspNet Zero's latest changes to your solution, you should not merge migrations. Instead, after dbcontext & entity changes, just add a new migration.
Ok, I think I get what you are saying, but just want to confirm. After I complete the merge method for all code to V4.0, I should just perform an add-migration to cover ALL migrations for prior release and make that my "initial" migration for my V4.0 based solution, correct?
I am using the standard code provided in the template for rendering dropdowns. I would like to apply a filter to the GetAll() method shown below, so that only "Active" entities from the selected entity are returned.
In all of my entities I use the column "Active".
I would like every combobox method to only return the "Active" records.
public List<ComboboxItemDto> GetCompaniesComboboxItems(int selectedCompany = 0)
{
var comps = _companyRepository.GetAll();
var companyItems = new ListResultDto<ComboboxItemDto>(comps.Select(e => new ComboboxItemDto(e.Id.ToString(), e.CompanyName)).ToList()).Items.ToList();
var defaultItem = new ComboboxItemDto("", L("NotAssigned"));
companyItems.Insert(0, defaultItem);
if (selectedCompany != 0)
{
var selectedlistvalues = companyItems.FirstOrDefault(e => e.Value == selectedCompany.ToString());
if (selectedlistvalues != null)
{
selectedlistvalues.IsSelected = true;
}
}
else
{
defaultItem.IsSelected = true;
}
return companyItems;
}
I am using the MVC/JQuery template for V4.0. Has that template also been changed to use EF Core?
In my db i do not see the new migration table you are referring to, I only see the old one.
I can create a new DB on my local desktop, that is NOT an issue.
However, my concern about this upgrade process relates to how I would manage this for my "production" environment. I would not be in an position to delete my prod DB and create a new one. Therefore I need to get this upgrade to work on local on my existing DB first.
I resolved the migrator tool error, by updating the entire project code with that taken from v4.0.
However, now when I run it, one of the migrations, for ABP, is failing.
namespace EXLNT.NursingOps17.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class Added_Tenant_UI_Customization_Properties : DbMigration
{
public override void Up()
{
AddColumn("dbo.AbpTenants", "CustomCssId", c => c.Guid());
AddColumn("dbo.AbpTenants", "LogoId", c => c.Guid());
AddColumn("dbo.AbpTenants", "LogoFileType", c => c.String(maxLength: 64));
}
public override void Down()
{
DropColumn("dbo.AbpTenants", "LogoFileType");
DropColumn("dbo.AbpTenants", "LogoId");
DropColumn("dbo.AbpTenants", "CustomCssId");
}
}
}
When I look at the migration history in my DB, this migration has already been applied, see below. [attachment=0:1gv2jm94]Screenshot (79).png[/attachment:1gv2jm94]
Yet when I try to perform "Add-Migration" cmd, it creates a migration with exact same changes as shown in the above migration. Yet when I issue the update-database cmd it fails with the error message shown below.
System.Data.SqlClient.SqlException (0x80131904): Column names in each table must be unique. Column name 'CustomCssId' in table 'dbo.AbpTenants' is specified more than once.