Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
99 views

First of all I will start by apologizing for a messy question. So I have been fiddling around with custom tag helpers and I need your thoughts. So far I've only extended simple tags like buttons and ...
David's user avatar
  • 181
0 votes
2 answers
228 views

I have a view component I'm invoking like so: @{ await Component.InvokeAsync("Edit", new { config = new List<EditConfiguration>() }); } It looks like this: // Need to make ...
Caleb Johnson's user avatar
-1 votes
1 answer
165 views

I working on the View Component in ASP Net Core MVC. Here my view components public CartViewComponent(GiaydepContext context) { _context = context; } public IViewComponentResult Ivoke() { ...
Nghĩa Nghĩa's user avatar
0 votes
0 answers
81 views

I am working on an ASP.NET 7 project where I have a Razor page, and I have used Ajax to call the GET method from the C# file. I am calling the GET method from the CSHTML using Ajax to CSHTML.CS. There,...
POKA's user avatar
  • 39
0 votes
1 answer
150 views

I have an issue using a .Net 6 Class Library to create ViewComponent to use it many Web app. I have create a Class library : The code : public class HelpComponent : ViewComponent { public ...
Clément GRANDGIRARD's user avatar
0 votes
2 answers
531 views

I have a razor view that is divided into two columns. The column on the left contains a list of bootstrap list-group-items ( job cards). On the right is a larger column to display the full details of ...
emile keen's user avatar
0 votes
0 answers
79 views

I am using an ASP.NET Core MVC ViewComponent to show similar content but with different data. My index page looks like below (I am calling around 15 ViewComponents and passing some arguments to each ...
Sebastian's user avatar
  • 4,861
2 votes
1 answer
457 views

I want to do something like this... <vc:sidebar-submenu id=@configurationId> <vc:sidebar-submenu-item action-name="Index" controller-name="MapDefinitions" text="...
nbofni's user avatar
  • 47
0 votes
1 answer
97 views

I currently working for the UI part, I would like to create a template html to use it globally for every pages. I would like to know how to pass a static text string to view components: ViewComponent/...
Kelvin's user avatar
  • 199
0 votes
2 answers
861 views

I have a following method inside a viewcomponent public async Task<IViewComponentResult> InvokeAsync (ToolModel model) { if (!ModelState.IsValid) { ...
Prageeth Liyanage's user avatar
0 votes
0 answers
355 views

I am using the below code to execute view component in .cshtml @await Component.InvokeAsync("FileUpload",Model) Inside that view component, there is a file uploader. After select a file ...
Prageeth Liyanage's user avatar
0 votes
0 answers
129 views

I am trying to invoke a ViewComponent by calling a controller action in JavaScript, but it gives this error: NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load ''. and Failed ...
Donald N. Mafa's user avatar
0 votes
1 answer
439 views

I have a view component which do file upload. public async Task<IViewComponentResult> InvokeAsync (ToolModel model) { if (!ModelState.IsValid) { return View(); ...
Prageeth Liyanage's user avatar
4 votes
1 answer
3k views

I am beginner for asp.net core. I am building file conversion website. PNG to JPG, PDF to Word etc.. In there I amusing fileuplaod control to upload content for the conversation. Instead using same ...
Prageeth Liyanage's user avatar
13 votes
1 answer
2k views

On a Net Core 7 project I am rendering a View Component on a Razor page: <vc:footer></vc:footer> The component C# code is: public class FooterViewComponent : ViewComponent { public ...
Miguel Moura's user avatar
0 votes
1 answer
562 views

I started a Razor Pages project and I need to use AJAX so that I can refresh my comments section without refreshing my entire page. unfortunately AJAX does not seem to work at all, it's as if the code ...
DED's user avatar
  • 415
0 votes
1 answer
475 views

Hi I created my classlib and added my viewcomponents to that library and I added DLL file of my class library to asp.net mvc application I can able to use class and models but I don't know how to ...
Yasith 63's user avatar
0 votes
0 answers
149 views

I think I have an interesting model conflict between controller and viewcomponent. I couldn't solve the problem. I leave my Controller and Component codes. Raw exception details right below ...
Pangomi IT's user avatar
0 votes
0 answers
451 views

Having recently migrated from years of web forms, I’ve built numerous dot net core razor page apps - So I’m not a complete beginner but I am struggling to understand the best way to approach one ...
Chris's user avatar
  • 23
0 votes
1 answer
281 views

Using Net.Core 7 I have a few View Components which are located in: /Pages/Components/Component1/Default.cshtml /Pages/Components/Component2/Default.cshtml ... I want to place all views in Components ...
Miguel Moura's user avatar
0 votes
1 answer
1k views

Inside a normal View, we are populating a table via the model with this: @foreach (var item in Model) { if (item.PartnerSubscriptionID > 0) { <tr id='[email protected]....
Rodney Ellis's user avatar
0 votes
1 answer
792 views

I am writing an application using ASP.NET Core 6 MVC. I have a controller that instantiates an IMemoryCache and stores some values into the cache. public HomeController(ILogger<HomeController> ...
Diego's user avatar
  • 2,390
0 votes
0 answers
348 views

I'm admittedly relatively new to razor pages and I'm trying to understand how best to approach this particular use case. The application will ultimately be one that has many (potentially +100) ...
kman's user avatar
  • 2,275
0 votes
1 answer
1k views

I am now designing a website using .NET6 and unlike older versions of ASP.NET Core, this version doesn't have methods like @{Html.RenderPartial("_ViewNamePartial")} so I'm using ...
wh0me's user avatar
  • 1
0 votes
1 answer
859 views

I have the following view component: using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; namespace InfinityVS22N6.Views....
Giovanni Mosquera's user avatar
0 votes
1 answer
253 views

My web application runs perfectly fine in Windows. I even have it running in production on a Linux server for years without issue. Now that I try to open the solution on a Linux desktop with JetBrains ...
Etienne Charland's user avatar
4 votes
2 answers
1k views

I have a New and Edit view that basically contain duplicate cshtml. What's the most efficient way to refactor so I can stay DRY? I already looked through Stack Overflow, and all the answers I could ...
RobertDev22's user avatar
1 vote
2 answers
747 views

In general if we use View("Index"). It will search for views in Views/ControllerName or Views/Shared folder. Likewise if we use Component.InvokeAsync("SomeData") then what are the ...
Jay's user avatar
  • 59
1 vote
0 answers
259 views

I'm using ASP.Net Core 5.0 for a web application in which I'm using ViewComponents. The ViewComponent classes are defined in another project. The main project has too many views so I added: <...
Bamdad's user avatar
  • 914
2 votes
1 answer
597 views

In my dotnet 5 MVC web application, I'm using THIS ToastNotification library for showing notifications. It's working good since long. As documentation says, it requires following line in _Layout file @...
Zeeshan's user avatar
  • 3,024
0 votes
1 answer
699 views

i used a view Component that has some javaScript codes for animations. when page loaded javaScript works well but when click a button to load data with ajax, data loaded correctly but javaScript codes ...
PEGASUS Studio's user avatar
1 vote
0 answers
1k views

I am currently working on an ASP.NET Core 6.0 MVC application (with Entity Framework), and I am trying to be able to perform CRUD operations without refreshing the page. As far as my research has ...
Little Boy Blue's user avatar
0 votes
1 answer
629 views

Hi I have a viewcomponet that read text from a txt file and i want to show that text in viewcomponent this is my ViewComponents ".cs" public class MainFooterViewComponent:ViewComponent { ...
sunny's user avatar
  • 2,765
0 votes
1 answer
349 views

I have a view component in my view and it works properly when its loaded one time. This view is part of a Slideshow so there are buttons on it. When the user clicks the next button it creates a ...
Bigbear's user avatar
  • 529
0 votes
1 answer
1k views

I want to create an asp.net core ViewComponent that dynamically return a yaml file based on some criteria: For example namespace MyNameSpace { [ViewComponent(Name = nameof(MyViewComponent))] public ...
rickky's user avatar
  • 13
0 votes
1 answer
354 views

I have added a ViewComponent <vc:my-profile-menu /> in the _Layout file. On the development computer, it displays correctly, but when I deploy it to the server, it does not render. In the ...
Bjørn Hellesylt's user avatar
0 votes
1 answer
966 views

Is it possible to access more than one IViewComponentResult method in a single ViewComponent Class? I seem to be able to create more then one method with each referencing their own View, but I have ...
earlxtr's user avatar
  • 370
2 votes
2 answers
3k views

I am having issues with loading a ViewComponent from a controller, my main view is Contact.cshtml and my ViewComponent is AddContact.cshtml. AddContact is a simple form with a submit button, I am ...
Henry Thomas's user avatar
1 vote
1 answer
2k views

On my razor page project, I am using a View Component as a template for listings, like so in my html: @foreach (var listingItem in Model.ListingItems) { @await Component.InvokeAsync("...
chandler's user avatar
  • 155
1 vote
2 answers
2k views

I have many view components and used in a Page Maker software. But now I need make a dynamic setting page for each view component. Something like this: @Component.InvokeAsync("Image"); @...
Nima Talebi's user avatar
2 votes
1 answer
158 views

As per the documentation the following rules determine whether a class is a ViewComponent: Deriving from ViewComponent Decorating a class with the [ViewComponent] attribute, or deriving from a class ...
gfyans's user avatar
  • 1,256
1 vote
1 answer
966 views

Is something like this possible? I have a ViewComponent and I'd like to use JS to call it and apply it to a DIV. <script> // Get the side menu var sideMenu = document....
JAmes's user avatar
  • 281
0 votes
1 answer
313 views

I'm working on some ViewComponent but when I try to Access the Model in the cshtml file it's always null. Here is a very simple example that has this problem This is the .cs code [ViewComponent(Name = ...
Edika's user avatar
  • 324
2 votes
2 answers
1k views

I have this ViewComponent in my shared layout: @if (User.Identity.IsAuthenticated) { <vc:room></vc:room> } Is there a way to only have it render if the user is on a certain page, or ...
JAmes's user avatar
  • 281
0 votes
1 answer
3k views

I'm using view components to render a list of strings in HTML. The component has a button that when clicked, should toggle which list of strings is shown. When the button is clicked, only the view ...
Cameron Cheung's user avatar
1 vote
1 answer
1k views

I'm migrating from ASP.NET MVC to ASP.NET Core MVC. I had a BasePodsWidgetController that looked like this: public abstract class BasePodsWidgetController<TProperties, TConfiguration, TItem> : ...
Craig's user avatar
  • 25
0 votes
1 answer
1k views

I'm working on the Razor View components and I used below code to define view component. View : @using MyLibrary.Models @model InputComponentModel <label [email protected] class="control-...
Prasad's user avatar
  • 135
5 votes
1 answer
3k views

I am new to ASP.NET Core. I get this error when I use view component. Thank you for your help InvalidOperationException: Method 'Invoke' of view component 'UI.ViewComponents.NavbarViewComponent' ...
jack's user avatar
  • 109
0 votes
0 answers
793 views

When using view components in my views I am getting this error which doesn't make sense. When I open up a view that uses a view component (calling the tag helper for said view component), I am seeing ...
Zach Painter's user avatar
0 votes
1 answer
1k views

i have the problem with Modal Window open with JQuery. I don't call the function. The same Code with normal Page is open normaly but the call function inside viewcomponent don't call. the razor Page ...
2yCalc Software Factory's user avatar

1
2 3 4 5