Click here to Skip to main content
16,008,942 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: How to Convert Byte Array to BitmapSource in C# for Silverlight Pin
Vimalsoft(Pty) Ltd26-May-11 19:04
professionalVimalsoft(Pty) Ltd26-May-11 19:04 
GeneralRe: How to Convert Byte Array to BitmapSource in C# for Silverlight Pin
Mark Salsbery26-May-11 19:09
Mark Salsbery26-May-11 19:09 
QuestionHow to retrieve hyperlink url from selection text in wpf? Pin
John-ph25-May-11 23:06
John-ph25-May-11 23:06 
QuestionInstaller for WPF Control Pin
Prasoon Chaudhary25-May-11 21:22
Prasoon Chaudhary25-May-11 21:22 
AnswerRe: Installer for WPF Control Pin
Wayne Gaylard25-May-11 21:32
professionalWayne Gaylard25-May-11 21:32 
QuestionRe: Installer for WPF Control Pin
Prasoon Chaudhary25-May-11 22:09
Prasoon Chaudhary25-May-11 22:09 
AnswerRe: Installer for WPF Control Pin
Abhinav S26-May-11 7:55
Abhinav S26-May-11 7:55 
QuestionHow to Access a Cookie Created in Silverlight from an Asp.net page Pin
Vimalsoft(Pty) Ltd25-May-11 5:29
professionalVimalsoft(Pty) Ltd25-May-11 5: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 6:25
mvePete O'Hanlon25-May-11 6:25 
GeneralRe: How to Access a Cookie Created in Silverlight from an Asp.net page Pin
Vimalsoft(Pty) Ltd25-May-11 7:18
professionalVimalsoft(Pty) Ltd25-May-11 7:18 
GeneralRe: How to Access a Cookie Created in Silverlight from an Asp.net page Pin
Pete O'Hanlon25-May-11 9:06
mvePete O'Hanlon25-May-11 9:06 
GeneralRe: How to Access a Cookie Created in Silverlight from an Asp.net page Pin
Mycroft Holmes25-May-11 12:03
professionalMycroft Holmes25-May-11 12:03 
GeneralRe: How to Access a Cookie Created in Silverlight from an Asp.net page Pin
Vimalsoft(Pty) Ltd6-Jun-11 4:55
professionalVimalsoft(Pty) Ltd6-Jun-11 4:55 
QuestionSilverlight and subdomains Pin
Mycroft Holmes24-May-11 22:44
professionalMycroft Holmes24-May-11 22:44 
AnswerRe: Silverlight and subdomains Pin
Mark Salsbery24-May-11 23:15
Mark Salsbery24-May-11 23:15 
GeneralRe: Silverlight and subdomains Pin
Mycroft Holmes24-May-11 23:25
professionalMycroft Holmes24-May-11 23:25 
GeneralRe: Silverlight and subdomains Pin
Mark Salsbery24-May-11 23:30
Mark Salsbery24-May-11 23:30 
GeneralRe: Silverlight and subdomains Pin
Mycroft Holmes25-May-11 1:05
professionalMycroft Holmes25-May-11 1:05 
GeneralRe: Silverlight and subdomains Pin
Mycroft Holmes25-May-11 1:34
professionalMycroft Holmes25-May-11 1:34 
GeneralRe: Silverlight and subdomains [modified] Pin
Mark Salsbery25-May-11 6:53
Mark Salsbery25-May-11 6:53 
GeneralRe: Silverlight and subdomains Pin
Mycroft Holmes27-May-11 13:41
professionalMycroft Holmes27-May-11 13:41 
GeneralRe: Silverlight and subdomains Pin
Mark Salsbery27-May-11 13:45
Mark Salsbery27-May-11 13:45 
AnswerRe: Silverlight and subdomains Pin
Abhinav S26-May-11 7:52
Abhinav S26-May-11 7:52 
Question[SOLVED] UserControls as Templates Pin
CodingLover24-May-11 20:00
CodingLover24-May-11 20:00 
AnswerRe: UserControls as Templates [modified] Pin
Mark Salsbery24-May-11 22:17
Mark Salsbery24-May-11 22: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.