Click here to Skip to main content
15,891,841 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have Solution
cotains
2 project.(project 1 and project 2) (wrote ASP CORE 3.0)

https://i.stack.imgur.com/hWuLw.png[^]

I wanna form project 2 can call funtion in project 1 ?
Thanks all.

What I have tried:

Set js file in project 1 into resource but in project 2 i can not acsess resource project 1.
Posted
Updated 20-Dec-19 1:25am

1 solution

You need to import the js file into whatever web page you want it accessible to. JS runs on the client and has to be loaded by the page that is in the browser.
 
Share this answer
 
Comments
tieudoan208 20-Dec-19 23:24pm    
Yes. But i wanna inlude file into project 1 as Library. when other project add that dll, and then i can use those funtional c# and js.
thanks
ZurdoDev 21-Dec-19 19:26pm    
C# can be added through a reference if it is in a dll. JavaScript does not work that way. You may be able to use a shared project.
tieudoan208 24-Dec-19 21:07pm    
Yes, but with aspx in event int page, i readed js in resource (dll file) and add into link as.

protected override void OnInit(EventArgs e)
{
base.OnInit(e);
RegisterResouce.Include_JS(this.Page.ClientScript);
RegisterResouce.Include_CSS(this.Page, this.Header);


}

and then when I create page aspx in inheritan page in dll.

public partial class ds_baucu : fpage


But in MVC or NetCore it has not page or Scripmanager to add it into page
tieudoan208 8-Feb-22 21:01pm    
I has a solution that. Project containt Lib js, in Middware a create a request and then i wrote contens js into this, in page cshtml i add url.

Eg.
MyLib.axd?v=23345

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900