Click here to Skip to main content
15,794,850 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: How to Convert Byte Array to BitmapSource in C# for Silverlight Pin
Vimalsoft(Pty) Ltd26-May-11 20:04
professionalVimalsoft(Pty) Ltd26-May-11 20:04 
GeneralRe: How to Convert Byte Array to BitmapSource in C# for Silverlight Pin
Mark Salsbery26-May-11 20:09
Mark Salsbery26-May-11 20:09 
QuestionHow to retrieve hyperlink url from selection text in wpf? Pin
John-ph26-May-11 0:06
John-ph26-May-11 0:06 
QuestionInstaller for WPF Control Pin
Prasoon Chaudhary25-May-11 22:22
Prasoon Chaudhary25-May-11 22:22 
AnswerRe: Installer for WPF Control Pin
Wayne Gaylard25-May-11 22:32
professionalWayne Gaylard25-May-11 22:32 
QuestionRe: Installer for WPF Control Pin
Prasoon Chaudhary25-May-11 23:09
Prasoon Chaudhary25-May-11 23:09 
AnswerRe: Installer for WPF Control Pin
Abhinav S26-May-11 8:55
Abhinav S26-May-11 8:55 
QuestionHow to Access a Cookie Created in Silverlight from an Asp.net page Pin
Vimalsoft(Pty) Ltd25-May-11 6:29
professionalVimalsoft(Pty) Ltd25-May-11 6:29 
Good Day All

I have another question. I have a Silverlight application and in one of the Silverlight pages i am hosting an Asp.net Page using a RadhtmlContainer(Telerik). I created a Cookie in Silverlight like this
public static void SetCookie(string key, string value)
{

   // string oldCookie = HtmlPage.Document.GetProperty("cookie") as String;
    DateTime expiration = DateTime.UtcNow + TimeSpan.FromDays(2000);
    string cookie = String.Format("{0}={1};expires={2}", key, value, expiration.ToString("R"));
    HtmlPage.Document.SetProperty("cookie", cookie);
}


and i have the same generic function to access it like this

public static string GetCookie(string key)
     {
         string[] cookies = HtmlPage.Document.Cookies.Split(';');
         key += '=';
         foreach (string cookie in cookies)
         {
             string cookieStr = cookie.Trim();
             if (cookieStr.StartsWith(key, StringComparison.OrdinalIgnoreCase))
             {
                 string[] vals = cookieStr.Split('=');

                 if (vals.Length >= 2)
                 {
                     return vals[1];
                 }

                 return string.Empty;
             }
         }

         return null;
     }


so i am trying to access this cookie in an asp.net page that is hosted on the the html Container , but i dont find the cookie.

Basically what i want to Achieve is

i want to access a value that is being created in Silverlight e.g "userid" "Username" normally i store it in the Cookie , so now i want to do a database insert , i need to do that insert from that asp.net page, but i cant get hold of that cookie value.

Thanks
Vuyiswa Maseko,

Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.

C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/

AnswerRe: How to Access a Cookie Created in Silverlight from an Asp.net page Pin
Pete O'Hanlon25-May-11 7:25
subeditorPete O'Hanlon25-May-11 7:25 
GeneralRe: How to Access a Cookie Created in Silverlight from an Asp.net page Pin
Vimalsoft(Pty) Ltd25-May-11 8:18
professionalVimalsoft(Pty) Ltd25-May-11 8:18 
GeneralRe: How to Access a Cookie Created in Silverlight from an Asp.net page Pin
Pete O'Hanlon25-May-11 10:06
subeditorPete O'Hanlon25-May-11 10:06 
GeneralRe: How to Access a Cookie Created in Silverlight from an Asp.net page Pin
Mycroft Holmes25-May-11 13:03
professionalMycroft Holmes25-May-11 13:03 
GeneralRe: How to Access a Cookie Created in Silverlight from an Asp.net page Pin
Vimalsoft(Pty) Ltd6-Jun-11 5:55
professionalVimalsoft(Pty) Ltd6-Jun-11 5:55 
QuestionSilverlight and subdomains Pin
Mycroft Holmes24-May-11 23:44
professionalMycroft Holmes24-May-11 23:44 
AnswerRe: Silverlight and subdomains Pin
Mark Salsbery25-May-11 0:15
Mark Salsbery25-May-11 0:15 
GeneralRe: Silverlight and subdomains Pin
Mycroft Holmes25-May-11 0:25
professionalMycroft Holmes25-May-11 0:25 
GeneralRe: Silverlight and subdomains Pin
Mark Salsbery25-May-11 0:30
Mark Salsbery25-May-11 0:30 
GeneralRe: Silverlight and subdomains Pin
Mycroft Holmes25-May-11 2:05
professionalMycroft Holmes25-May-11 2:05 
GeneralRe: Silverlight and subdomains Pin
Mycroft Holmes25-May-11 2:34
professionalMycroft Holmes25-May-11 2:34 
GeneralRe: Silverlight and subdomains [modified] Pin
Mark Salsbery25-May-11 7:53
Mark Salsbery25-May-11 7:53 
GeneralRe: Silverlight and subdomains Pin
Mycroft Holmes27-May-11 14:41
professionalMycroft Holmes27-May-11 14:41 
GeneralRe: Silverlight and subdomains Pin
Mark Salsbery27-May-11 14:45
Mark Salsbery27-May-11 14:45 
AnswerRe: Silverlight and subdomains Pin
Abhinav S26-May-11 8:52
Abhinav S26-May-11 8:52 
Question[SOLVED] UserControls as Templates Pin
CodingLover24-May-11 21:00
CodingLover24-May-11 21:00 
AnswerRe: UserControls as Templates [modified] Pin
Mark Salsbery24-May-11 23:17
Mark Salsbery24-May-11 23:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.