What is your product version? 11.4.0 RC1 What is your product type (Angular or MVC)? Angular What is product framework type (.net framework or .net core)? .NET 6
Hi, we are using an Angular-Module that requires raw Html-Links to our WebApi. When we try to use the raw link to the WebApi-methode the request will be redirected to the login page, since the user isn't authenticated because of the missing token. Since the servers WebApi is hosted under a different domain (http://localhost:44301) then the client-application (http://localhost:4200) there isn't even an authentication cookie for this domain. We are aware of using the AbpAllowAnonymous decorator attribute to allow anonymous access to the WebApi. But in our methode we have to use the tenantId which isn't set since we are not authorized.
What is the correct way to request the WebApi directly with authorization information.
Thanks
What is your product version? 11.1.0 What is your product type (Angular or MVC)? Angular What is product framework type (.net framework or .net core)? .NET 6 What theme are you using? metronic default
Hi support, we wanted to use the function KTSwapper (seen in metronic HTML) to display the PageTitle in the header (kt_header_nav) instead of the menu and to automatically switch the title to the body on small displays.
Under metronic/app/kt/components many KT components are already available. Unfortunately, there is no SwapperComponent.
Is this component currently being implemented or is there a better way to solve our problem? In VueJS and React, this componente seems to already exist.
Many thanks in advance, Frank
Hi, we have the same problem. Upgraded to Aspnet Zero V11 and would like to download the Metronic V8. Thanks.
Hi ismcagdas, ok thank you very much. I will do this the next time I upgrade AspNet Zero. Best regards Frank
Hi ismcagdas, thank you very much, it worked.
One last question. I now have the "new project" structure. At the end of the section in the documentation it says that the aspnetzero branch should now always be overwritten only with the current AspNet Zero version. In the last post you recommend to delete the files in the aspnetzero branch before updating. What is the best way? Many greetings Frank
Hi ismcagdas, how and where is the content deleted from the migrate branch? Delete the entire content of the project directory in the file system while Visual Studio is open and the migrate branch is active?
I think my mistake was that the existing project was already connected to git and I copied the .git folder and everything else into the migrate branch.
Now I did the following:
Is this way correct? At the moment everything looks fine, but I'm wondering if this might cause a lot of unused files from old versions to be in the project over time.
I know it's a lot of repetition from the documentation, but it's a big and important step to do the upgrade to new and future versions correctly.
Thanks and best regards Frank
Hi, I tried to update an exiting project to an new release of AspNet Zero as described in your docu under Common->Other->Version Upgrade. I stuck on the point "copy your exisitng project's source code to migrate branche".
How should I copy my code to the migrate branch? In the explorer from the backupfolder of my existing code to the folder where the newly created AspNet Zero project is created, somehow in VS or from explorer to VS-Window?
What should I copy? The complet project folder under repros or for example only css, cshtm, cs... files without for example github-files?
After copying my existing project from base folder over the new created AspNet Zero folder switched to migrate branch before, I get an error from Github like "sh an das Remoterepository: rejected Updates were rejected because the tip of your current branch is behind its remote counterpart. Integrate the remote changes before pushing again.."
Can you explain the part "Copy your existing project's source code to migrate branch" in more detail?
What I have done so far:
Kind regards, Frank
Hello ismcagdas , can you please explain the first option a little more precisely? I have already worked with a custom repository (as described here https://aspnetboilerplate.com/Pages/Documents/Articles/Using-Stored-Procedures,-User-Defined-Functions-and-Views/index.html), but the problem exists here as well. The custom repository is always bound to a specific entity. In the example to User. Can I create a custom repository that is not bound to a specific entity?
I want to modify this function so that the corresponding database table is queried using the input.tablename.
public async Task<PagedResultDto<TitleDto>> GetTitlesForDatatable(GetTitlesInput input)
{
var tableName = input.TableName;
//Decide based on TableName - do sql-statement
var query = _titleRepository.GetAll();
var itemCount = await query.CountAsync();
var titles = query
.OrderBy(input.Sorting)
.PageBy(input)
.ToList();
var titleListDto = ObjectMapper.Map<List<TitleDto>>(titles);
return new PagedResultDto<TitleDto>(
itemCount,
titleListDto
);
}
Hi ismcagdas, thank you for giving me the right lead. With the log it was no problem to fix the error. The name of the directory was not the same as the name of the view component. Therefore the default.cshtml was not found. Many greetings geoteam
Hello, I'm having trouble embedding a view component into a Modal Insert/Edit form. Is it possible that this does not work? I have tried to analyze the error, but the only thing that is displayed: POST http://localhost:62114/App/Addresses/CreateOrEditAddressModal 500 (Internal Server Error) in app-layout-libs.min.js:10320
_CreateOrEditAddressModal.cshtml:
@using Zero.Addresses
@using Zero.Web.Areas.App.Models.Common.Modals
@using Zero.Web.Areas.App.Views.Shared.Components.AppModalRegTable
@model Zero.Web.Areas.App.Models.Addresses.CreateOrEditAddressModalViewModel
@await Html.PartialAsync("\~/Areas/App/Views/Common/Modals/\_ModalHeader.cshtml", new ModalHeaderViewModel(Model.IsEditMode ? (L("EditAddress") + ": " + Model.AddressPersonCompany.PersonCompanyNameCompany) : L("CreateNewAddress")))
<div class="modal-body">
<form role="form" novalidate class="form-validation kt-form">
.
.
.
</form>
@await Html.PartialAsync("~/Areas/App/Views/Common/Modals/_ModalFooterWithSaveAndCancel.cshtml")
</div>
<div class="modalForm__RegisterTablePartial">
@await Component.InvokeAsync(typeof(AppModalRegisterTableViewComponent), new { registerTable = "Title" })
</div>
Default.cshtml (for testing) of Viewcomponent
@model TreasureMap.Web.Areas.App.Models.RegisterTable.RegisterTableViewModel
<div></div>
AppModalRegisterTableViewComponent:
public class AppModalRegisterTableViewComponent : ZeroMapViewComponent
{
public AppModalRegisterTableViewComponent()
{
}
public IViewComponentResult Invoke(string registerTable)
{
var regTableModel = new RegisterTableViewModel
{
DisplayName = string.Empty,
TableName = string.Empty
};
return View(regTableModel);
}
}
Comment out the line @await Component.Invoke... then modal window is shown. At another place (in the menu bar) I also have a ViewComponent. There it works.