Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7508865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:45:27+00:00 2026-05-29T22:45:27+00:00

I have a basic .ASP page like this, which when hit redirects the user

  • 0

I have a basic .ASP page like this, which when hit redirects the user to my SL app after adding a value to the session variables

<!-- Default.htm -->
<html>
<%Session("valuekey")=somevalue%>
<Head>
<META http-equiv="Refresh" content="0; URL=/appdirectory/myapp.aspx?lsv=true"></HEAD>
<Body></Body>
</HTML>

When I get to my SL app hosted on myapp.aspx, the first think it does it check for the lsv QueryString. If it equals true, it calls a WCF service with code like

object x = HttpContext.Current.Session["valuekey"];
if(x == null)
{
ServiceError.Message = "No session variable found";
}
else
{
return x.ToString();
}

Does anyone know why the session variable that I just added on the ASP page before the redirect no longer exists when my SL app tried to fetch it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T22:45:29+00:00Added an answer on May 29, 2026 at 10:45 pm

    This answer assumes there is a good reason why ASP classic enters into the equation in the first place. Perhaps its because Silverlight is being introduced into an existing ASP site. The problem is that most Silverlight Client-Server examples involve .NET WCF on the server.

    The answer to your problem is don’t use a WCF service to fetch your session data. Use a simple ASP page instead. It should be fairly straight-forward to use a simple XML structure to carry the session data you want to the Silverlight app. Use a DTO class that can be used to deserialise the XML into a simple class. Something like this:

    (Caveat: air code)

     <%
         Dim dom:  Set dom = CreateObject("MSXML2.DOMDocument.3.0")
         dom.loadXML "<SessionData />" 
    
         AddElem dom.documentElement, "ValueKey", Session("valuekey")
         AddElem dom.documentElement, "SomeOtherValue", Session("othervalue")
         ''# include other session values needed by client here.
    
         Response.ContentType = "text/xml"
         Response.CharSet = "utf-8"
         dom.save Response
    
         Sub AddElem(parent, name, value)
             Dim elem: Set elem = parent.ownerDocument.createElement(name)
             parent.appendChild elem
             elem.text = value;
         End Sub
     %>
    

    In Silverlight:

     [DataContract]
     public class SessionData
     {
         [DataMember(Order=1)]
         public string ValueKey {get; set; }
    
         [DataMember(Order=2)]
         public string SomeOtherValue {get; set; }
    
         public static void Fetch(Action<string> returnResult, Action<exception> fail)
         {
             WebClient client = new WebClient();
             OpenReadCompletedEventHandler eh = null;
             eh = (s, args) =>
             {
                 try
                 {
                     var sr = new DataControlSerializer(typeof(SessionData));
                     returnResult((SessionData)sr.ReadObject(args.Result)); 
                 }
                 catch (Exception e)
                 {
                     fail(e);
                 }
                 finally
                 {
                    client.OpenReadAsyncCompleted -= eh;
                 }
              };
              client.OpenReadAsyncCompleted += eh;
              client.OpenReadAsync(new Uri("../serviceFolder/sessionState.asp", UriKind.Relative));
         }
    
     }
    

    Now in some UI or ViewModel you do

         void SessionData_Available(SessionData sessionData)
         {
              _sessionData = sessionData;
              // Other actions needed once session data has arrived.
         }
    
         void ReportProblem(Exception e)
         {
              // Some UI change to inform user of failed fetch
         }
    

    …

         SessionData.Fetch(SessionData_Available, ReportProblem);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET MVC web app which has a really basic subscription system
I have a very basic ASP.NET web site. It has a single page (TestPage.aspx)
I have a basic ASP.Net MVC 3 application which has a number of controllers
I have an ASP.NET MVC 3 (Razor) Web Application, with a particular page which
This is not an MVC topic. I have an ASP.NET Application which performs URL
I have a page, Default.aspx, with its own code-behind file like this: using System;
So I have visual basic code in a classic asp page where I want
I have a basic page which is used in an iFrame on an intranet
Say I have a basic page like so: <custom:TableOfContents /> <h1>Some Heading</h1> <h2>Foo</h2> <p>Lorem
I have some HTML markup in my ASP.NET master page representing a basic navigation

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.