locked
Sending variable from Silverlight to ASPX page RRS feed

  • Question

  •  Hello !

     I have created a small game in Silverlight and I created an SQL database to record the High Scores.

    In the ASPX page that contains the Silverlight application, I have a button "Insert High Score".

    When that button is pressed, I am redirected to a page that contains the database and has a text box in which your name can be inserted for the high score to be registered.

    And here's what I want: when the button "Insert High Score" is pressed, I want the "public int score" variable that is in my Silverlight application (which is inside this ASPX page) to be transferred to the next page where the name can be put in, so that after you input the name in order to add it to the database, the database is automatically updated with your name and your score.

    I know how to handle databases, I just want to know how to transfer a variable from a Silverlight application to the page that the Silverlight application is in (it is an int) and after that, the variable to be carried from that page to the next page, where the databases are.

     Thank you for your time.

     gh0sst

    Friday, May 15, 2009 5:09 PM

Answers

  • You can send your "int" to the new page using a query string parameter but when an user will understant this (very soon) you will found your hish scores injected with completely false scores. I guess that every method you can think may be hacked easily while rely on client side scripting.

    Why not to get the name from inside the Silverlight application and then post it to the webserver using a webservice?

    hth

    Friday, May 15, 2009 6:25 PM

All replies

  • You can send your "int" to the new page using a query string parameter but when an user will understant this (very soon) you will found your hish scores injected with completely false scores. I guess that every method you can think may be hacked easily while rely on client side scripting.

    Why not to get the name from inside the Silverlight application and then post it to the webserver using a webservice?

    hth

    Friday, May 15, 2009 6:25 PM
  • Can you please give me some examples / source code on how to do any of those two things ?

    Friday, May 15, 2009 7:58 PM
  • Here are articles about using webservice in silverlight, hope it helps

    http://msdn.microsoft.com/en-us/library/cc197964(VS.95).aspx

    Thursday, May 21, 2009 11:32 PM