-1

I am using IntroJs currently and using the JSON to call the introjs. Is it possible to store data/text/info in database and using JSON to retrieve it from the database?

 <h2 id="welcomeMsg">Welcome back,<asp:Label ID="lbl_WelcomeName" runat="server" Text="Label"></asp:Label> !</h2>

<script type="text/javascript">
function startIntro() {
    var intro = introJs();
    intro.setOptions({
        steps: [
          {
              element: '#welcomeMsg',
              intro: "Welcome Message. <br /> <a onclick='this.firstChild.play()'><audio src='Audio/WelcomeBack.wav'></audio><font style='font-size:24px'>▸</font> Play Audio</a>"

          }

Here is how's my code like, I want to make it such that intro: "(Retrieve from database here)";

Raynoro
  • 175
  • 1
  • 4
  • 15

1 Answers1

0

There are many ways to do it. I will roughly describe two of them.

  • Build a web service which retrieves data from an SQL database. Then serialize the results in a JSON format and return them to your client application. Since you use C#, I would suggest to build it in WCF. You could follow this tutorial.

  • You could use a database storing data in json format directly. These databases are NoSQL databases and MongoDB is one good example.

Hope I helped!

Pantelis Natsiavas
  • 5,293
  • 5
  • 21
  • 36