Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8875241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:55:38+00:00 2026-06-14T18:55:38+00:00

The initial question My question can be easily misunderstood, so I will use an

  • 0

The initial question

My question can be easily misunderstood, so I will use an example, or better, I will make a comparison.

Consider ASP.NET web applications. There it is possible to define ascx components. Those components are quite nice because they define pieces of reusable code with some more intelligent features that make them not just pieces of plain code… but parametrized parts for a web application.

My question is, of course considering that Node.js is not ASP.NET: what is the most similar solution in Node.js to define reusable components (parametrized)?

Thankyou

For those not familiar with ASP.NET

I am aware that not everyone might be familiar with ASP.NET. So I am going to detail a little bit more what I need here. Passing parameters to an html or jade segmente of code is something I can do in Node.js, but what I would like to do is writing my jade/html code into a file (it contains some divs and something else), and then reference it inside another jade/html document or one parameter passed inside it.

The new revised question

When I was told to use mixins in order to solve this issue, I started looking for them and also tried some, it was ok, I managed getting the simplest mixins done, but when I had to make things a little more complex, mixins started behaving strangely. So now I am wondering about whether they are the solution I have been looking for. So now I am going to explain in details what I want to achieve (as I was too generic).

I have a web page written using Jade and I need to create a component that I can reuse throughout my page. This component is just a structured div that will contain an article. If I were to write this component in pseudo-code, this is what it would probably look like in Jadeish syntax:

component article(@title, @subtitle, @articlebody, @writtenon)
.article
  .head {@title}
  .head {@subtitle}
  div(style='float:left;clear:both')
    .body
      {@articlecontent}
    .foot
      {@writtenon}

So, as you can see, I want this bunch of code to be parametrized so I can reuse it like this in my page:

doctype 5
html
  head
    title = title
  body
    .article('my first art', 'dummy subtitle', 'bla bla bla... lorem ipsum', '12/12/2012')
    .article('my second art', 'dummy subtitle', 'bla bla bla... lorem ipsum', '12/12/2012')

and so on…

Consider also that parameters might be long values. In my example, one of the parameters is the body of an article. I need to insert there the html code of the body

I searched the web in order to understand how to do this, but could not find any tutorial or valid example.

Can you help me please? Thankyou

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:55:40+00:00Added an answer on June 14, 2026 at 6:55 pm

    I am unfamiliar with ascx files so I don’t know if this is what you are thinking of, but there are different template engines that have been written for node.js that allow for reuse of frontend templates (html-like files). For example, in the Jade engine has mixins that allow you to pass parameters to a template.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Initial Question Yesterday i read about ECMAScript 5 Object.create() And I wanted to start
My initial question was here and was related to the postgres backend. Postgres subquery,
Ok, It looks like I made a mistake with my initial question. So, here
How do I suppress all of Logback's initial output? This question has been asked
FYI, There is some overlap in the initial description of this question with a
Code: NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature]; BOOL initial = YES; [invocation setArgument:&initial atIndex:2]; Question:
Initial tests indicate that GDI+ (writing in VB.NET) is not fast enough for my
My initial task was to find a segmenter for Windows that will split a
INITIAL QUESTION: I have an app that uses ExecutorService to run 4 fixedThreadPool. When
I think my question can most simply be put: Can the contents of a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.