Skip to main content

Microsoft Silverlight

Answered Question Pimping an old ASP.NET site with SilverlightRSS Feed

(0)

Chamster
Chamster

Member

Member

3 points

11 Posts

Pimping an old ASP.NET site with Silverlight

I have an old project, working well but looking ugly. It's a web application displaying some values from a DB for the logged users (depending on the role, a user has different view of the data).

I intend to upgrade the old application with Silverlight appearance and i have played for a while with some animations and simple, yet nice effects. All i want to do, is already done and stored in different XAML files.

So, what's the problem? Well, i'm unsure on what i need to place in the old application. I can't move the old functionality into the new solution (various reasons, can't be budged). Do i really need the two different projects - PimpMyApp and PimpMyApp.Web? What files do i have to move? The partial XAML-files take up all the space of the browser. How do i combine two or three of them in the old application?

Grateful for all hints and advices.

sladapter
sladapter

All-Star

All-Star

17441 points

3,172 Posts

Answered Question

Re: Pimping an old ASP.NET site with Silverlight

I don't quite understand your question. How much you want to upgrade your old web application to use the Silverlight? There are more than one way to upgrade a Old Web application to a Silverlight enabled application depending on each case:

Option 1: Re-Write the UI to make it a pure Silverlight application. This way the whole page will be a Silverlight control. You only need one html/aspx page to host your a Silverlight control. Most Silverlight demos are built this way.

Option 2: Mix Silverlight controls with other HTML elements. Keep your current page, only replace some HTML controls with one or more Silverlight controls. 

But either way, you will have at least two projects. One is the Web project which contains your HTML or ASPX page as well as the code that running on the Server side such as Web Service code. The other is the Silverlight project. Because Silverlight code will be running on the client side, the Silverlight project will be compiled into a Xap file that will be downloaded to the client machine. So there is no way you can combine the two projects into one. The code on those two project will not running at the same place.

But you can still keep your old application project as the Web project. You do not need another PimpMyApp.Web.  You can add a Silverlight link to that web project. On the project property page, click Silverlight Application tag, and add a Silverlight link to point to your Silverlight project.  Now your solution will have two project: your old web project and your Silverlight project.

If you choose option 1. You may do not need your old aspx page anymore. But the code that access DB and return data etc can still be reused. A good practice is always to separate business logic from the UI.  Even if you did not separate them in your old code, you can convert the code that contains business/data access logic into a WCF service code. So your Silverlight code can call them to retrieve the data.

 

 

 

 

sladapter
Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

Chamster
Chamster

Member

Member

3 points

11 Posts

Re: Re: Pimping an old ASP.NET site with Silverlight

Great info! That's exactly what i was wondering. Fortunately, my productions always (hrmp... almost) have separate DAL and BLL so there's no problems there.

What i feel unclear about is this, though. In traditional way, i set up a LogIn.aspx and in web.config i kick all the incoming traffic to it, unless a cookie has been created using web forms. After a successful login, i trasfer the user to a certain page. How is it done in Silverlight?

An other scenario - most of the communication is done by sending user to an other (or the same) page and keeping the info either in ViewState or QueryString. How is this done in Silverlight?

Let me know if i provided insufficient information. I'm a proffessional web developer but a total noob at Silverlight, still. Sorry and thanks.

sladapter
sladapter

All-Star

All-Star

17441 points

3,172 Posts

Re: Re: Pimping an old ASP.NET site with Silverlight

I don't know if you still want to use your old LogIn.aspx or not.  If you still want to use your old LogIn.aspx you still can. After user passed login and set the cookie you can direct them to another aspx page which contains your Silverlight application.

Or if you want everything in Silverlight, you only need one aspx (or even html) page for your whole application.  You need to write a Login control in Silverlight. You can read this thread to get some idea:

http://forums.silverlight.net/forums/p/19820/267331.aspx#267331

 

sladapter
Software Engineer
Aprimo, Inc

Please remember to mark the replies as answers if they answered your question

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities