Using Passed in ASP.NET Controls or Javascript Functions RRS feed

  • Question

  • User569238728 posted

    Allright, I have two web site blocks of Asp.NET / C# code that I'm trying make into functions.  The problem is I need the button controls to be accessed in there.  I found the code to pass in a standard button, but not an ASP button.

    On the other hand, from my research it seems feasible to use JavaScript too where I can use the button, and application, and session level variables freely. 

    Which would be better, are both options even doable?

    Thank you,


    Sunday, September 15, 2019 5:23 PM

All replies

  • User569238728 posted

    The JavaScript option would be nice for my bag of tricks.  However, I am now considering if my list of objects variables could be used in the JavaScript.  Any notion?

    Sunday, September 15, 2019 5:26 PM
  • User475983607 posted

    Your question does not make sense given how web site fundamentally function.  Can you share code that illustrates what you are trying to do?

    Sunday, September 15, 2019 10:15 PM
  • User-719153870 posted

    Hi Josh,

    I am now considering if my list of objects variables could be used in the JavaScript.

    Yes, you can use objects list in JS, you can refer to creating list of objects in Javascript.

    In that link, you can see how to create a list in JS:

    var list = [
        { date: '12/1/2011', reading: 3, id: 20055 },
        { date: '13/1/2011', reading: 5, id: 20053 },
        { date: '14/1/2011', reading: 6, id: 45652 }

    As for the other thing you mentioned in your posts, the description is very confusing. We can't tell what you are trying to achieve so that the community could not help.

    If there's any other problem, please open new threads and provide more detailed description and related code if needed.

    Best Regard,

    Yang Shen

    Monday, September 16, 2019 3:02 AM