none
Jscript.net development of an asp.net project, how to import another js file RRS feed

  • 问题

  • I am using jscript.net to write an asp.net website, using import can not import another js file class, and the two files are with.js as the extension, not with.aspx as the extension! Now I want to introduce b.js methods in a.js but I can't import b.js classes using import!

    a.js:             

            import System;

                      import abc;
                      class test extends System.Web.UI.Page{
                   public function test(){
                    var abs=new abc.ab();
                    Page.Response.Write(abs);
                                 }
                                 }

    b.js:

    package abc{
    public class abc{
    public function abc(){}

    public function ab():String{
    return "hello world";
    }
    }
    }


    Could there be a better way? Or can asp.net only introduce classes written by vb or cshap instead of js?

    2019年2月22日 6:14

全部回复


  • Hi  helloworldcccccc,

    >>I am using jscript.net to write an asp.net website, using import can not import another js file class, and the two files are with.js as the extension, not with.aspx as the extension! Now I want to introduce b.js methods in a.js but I can't import b.js classes using import!

    Form your description, your issue is more related to the  jscript.net. You need to go to the JScript for the .NET Framework forum for getting suitable.

    Note: As I see, the JScript for the .NET Framework forum has retired

    >> Could there be a better way? Or can asp.net only introduce classes written by vb or cshap instead of js?

    You can use the Visual Studio to create Asp.Net Application.


     
    Best Regards,

    Yong Lu

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    2019年2月27日 7:24
    版主