76 liens privés
What is Feature Management in asp.net core, its benefits and we'll also see how to consume IFeatureManager directly in razor pages
@await Html.PartialAsync("_DisplayMultiline", Model.Description)
_DisplayMultiline
@model String
@Html.Raw("<span style='white-space:pre-line'>" + Html.Encode(Model) + "</span>")
Achetez le chocolat Venchi sans gluten et fabriqué avec les meilleurs ingrédients.
Crushing It!: How Great Entrepreneurs Build Their Business and ...
Livre de Gary Vaynerchuk
In this post, we'll look at some pitfalls and ideas EF Core users like yourself may want to consider when developing an application.
Entity Framework Core (EF Core) is a ground-up rewrite of Microsoft
Get insights into how your content shows up on LinkedIn with Post Inspector.
@{
string CustomRenderingOfActions(Models.FirstConnectionImport item)
{
return $"<a href='{Model.Subsite}{@Url.Page("ImportIndex", "DownloadFile", new { id = item.Id })}' title='Download'>Download</a>";
}
}
<a href="@Url.Page("CreateDescriptionCp", "DownloadFile", new { attachmentid = attachment.Id})">@attachment.Name</a>
public async Task<FileContentResult> OnGetDownloadFile(int attachmentid)
{
try
{
GetByIdQuery getByIdQuery = new GetByIdQuery { Id = attachmentid };
Attachment attachment = await _mediator.Send(getByIdQuery);
return File(attachment.Content, attachment.ContentType, attachment.Name);
}
catch (Exception)
{
throw;
}
}
public async Task<IActionResult> OnPostDownload2()
{
try
{
var res = await _databaseContext.Forms.Where(f => f.CreatedAt >= Filters.Start && f.CreatedAt <= Filters.End).ToListAsync();
using var ms = new MemoryStream();
using (var sw = new StreamWriter(stream: ms, encoding: new UTF8Encoding(true)))
{
CsvConfiguration csvConfiguration = new(CultureInfo.InvariantCulture)
{
ShouldQuote = args => true
};
using (var cw = new CsvWriter(sw, csvConfiguration))
{
cw.WriteRecords(res);
}// The stream gets flushed here.
return File(ms.ToArray(), "text/csv", $"eBankingSms_Forms_{DateTime.UtcNow.Ticks}.csv");
}
}
catch (Exception e)
{
_logger.LogError(e, $"OnPostDownload2");
throw;
}
}Grid controls for ASP.NET MVC projects.
@{
string CustomRenderingOfColumn2(Common.ViewModels.ConfigGenericDto item)
{
return $@"<a href='{Model.Subsite}/Configurations/Edit?id={item.Id}' title='Edit'>
<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' class='bi bi-eye' viewBox='0 0 16 16'>
<path d='M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z' />
<path d='M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z' />
</svg></a>";
}
}
@(Html
.Grid(Model.Items)
.Build(columns =>
{
columns.Add(model => model.Type).Titled("Type");
columns.Add(model => model.Name).Titled("Name");
columns.Add(model => model.Enabled).Titled("Enabled");
columns.Add(model => model.CreatedAt).Titled("Creation").Formatted("{0:d}");
columns.Add(model => model.ModifiedAt).Titled("Modification").Formatted("{0:d}");
columns.Add(model => model.Id).Titled("Actions").Encoded(false).RenderedAs(o => CustomRenderingOfColumn2(o)).Filterable(false).Sortable(false);
})
.Using(GridFilterMode.Header)
.Empty("Aucune donnée")
.Filterable()
.Sortable()
.Pageable(pager => {
pager.RowsPerPage = 2;
pager.PageSizes = new Dictionary<Int32, String> { { 10, "10" },{ 20, "20" } };
pager.ShowPageSizes = true;
})
)
@section Scripts {
<script>
document.querySelectorAll(".mvc-grid").forEach(element => new MvcGrid(element));
</script>
}
What We Owe The Future de William MacAskill
Learn how to implement background tasks with hosted services in ASP.NET Core.
Here Mudassar Ahmed Khan has explained with an example, how to download files from Folder (Directory) on Server's Disk in View in ASP.Net Core Razor Pages.
TAGs: ASP.Net, Excel, Word, PDF, Core, Razor Pages
In this article we will learn how to create the QR Code in ASP.NET Core