(This is a continuation from the previous post: Lab2 “Glue API Intro”)
The good news is that you should be able to reuse most of Glue web services REST calls that you wrote in the previous labs. In the sample project accompany this labs exercises, we put the common Glue REST calls under Glue folder. You can simply copy the folder to your web application if you are using our sample app.
Instead of Win Form, we use Web Form when we choose a project in Microsoft Visual Studio (MSVS). For this exercise, a simple single web page will be enough. MSVS ASP.NET development environment provides you a set of tools that is analogous to win forms tools. If you have been programming a windows application using Visual Studio, it will look familiar to you.
Difference is, of course, the UI is a web page. A web page in ASP.NET has an extension “aspx”. ASP.NET tools starts with “asp:” in a web form. We can use <iframe/> to embed a display component in the aspx page, which looks like this:
A code behind an aspx page has an extension “aspx.cs”. In the corresponding code, we set src with the url that we constructed in Glue.View(). e.g.,
Note: “iframeGlue” is the value of id in the iframe, which you can reference from your code.
Notice also that we are using HttpContent.Current.Session to keep temporary, session specific data. Image below shows an example of how an application might look.
You can download the full code project for the Glue API Intro Labs from here.