1

I'm migrating MVC application to ASP.NET CORE. In that I'm using web user control.

UserControl ctrl= oLogSite as UserControl; Here oLogSite is object type.

Please let me know how to use in .Core

2
  • Anyone please let me know how to use Web User Control in migration of asp.net core. I did some basic r&d but it showing viewcomponent and partial views. Commented May 27, 2021 at 8:43
  • Hi, please take a look to this question stackoverflow.com/questions/12714071/…. There is no possibility in Asp .Net Core create UserControl you should create PartialView. Read more in official documentation Commented May 27, 2021 at 9:11

1 Answer 1

0

From this article, we can see that the UserControl used in the traditional Asp.net Web Form application and it applies for .NET Framework, instead of .Net Core. So, .Net Core doesn't support UserControl.

To achieve the similar behavior in .Net Core application, as you said, You could ViewComponent or Partial View. Besides, you could also consider creating custom tag helper to render multiple html elements.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.