Click here to Skip to main content
15,915,094 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Login Control doesnt work Pin
Not Active25-May-11 9:28
mentorNot Active25-May-11 9:28 
GeneralRe: Login Control doesnt work Pin
Dmitry Makovetskiy25-May-11 9:35
Dmitry Makovetskiy25-May-11 9:35 
GeneralRe: Login Control doesnt work Pin
Not Active25-May-11 10:08
mentorNot Active25-May-11 10:08 
QuestionI need replace a selected word in the text of textBox not all text I can´t use SelectedText or SelectionLength like windows Form in asp.net Pin
Ricardo Vela25-May-11 7:54
Ricardo Vela25-May-11 7:54 
AnswerRe: I need replace a selected word in the text of textBox not all text I can´t use SelectedText or SelectionLength like windows Form in asp.net Pin
Not Active25-May-11 8:09
mentorNot Active25-May-11 8:09 
AnswerRe: I need replace a selected word in the text of textBox not all text I can´t use SelectedText or SelectionLength like windows Form in asp.net Pin
Prasanta_Prince25-May-11 18:25
Prasanta_Prince25-May-11 18:25 
GeneralRe: I need replace a selected word in the text of textBox not all text I can´t use SelectedText or SelectionLength like windows Form in asp.net Pin
Ricardo Vela25-May-11 21:23
Ricardo Vela25-May-11 21:23 
QuestionCreating a Cookie and Setting it Pin
Vimalsoft(Pty) Ltd25-May-11 7:02
professionalVimalsoft(Pty) Ltd25-May-11 7:02 
Good Evening All

i have another Question. i have created a Function that creates a Cookie with a Domain like this

private static void SetCookieExtedend(String key, String value, String path)
        {

            DateTime expires = DateTime.UtcNow + TimeSpan.FromDays(2000);

            bool secure = false;

            String domain = "Ecash";

            StringBuilder cookie = new StringBuilder();

            cookie.Append(String.Concat(key, "=", value));

            if (expires != null)
            {

                cookie.Append(String.Concat(";expires=", expires.ToString("R")));
            }

            if (!String.IsNullOrEmpty(path))
            {
                cookie.Append(String.Concat(";path=", path));
            }

            if (!String.IsNullOrEmpty(domain))
            {
                cookie.Append(String.Concat(";domain=", domain));
            }

            if (secure)
            {
                cookie.Append(";secure");
            }

            HtmlPage.Document.SetProperty("cookie", cookie.ToString());
        }

and its working well , i have set the Cookie and it was stored as this

UserID=142;expires=Mon, 14 Nov 2016 16:58:19 GMT;domain=Ecash

now i want to retrieve the Value of the Cookie and i have a function that does 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;
       }


the Following Line comes back with an empty String

string[] cookies = HtmlPage.Document.Cookies.Split(';');


Why ?

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: Creating a Cookie and Setting it Pin
Not Active25-May-11 8:04
mentorNot Active25-May-11 8:04 
QuestionExport Excel file with multiple worksheets Pin
Samarjeet Singh@india25-May-11 2:34
Samarjeet Singh@india25-May-11 2:34 
AnswerRe: Export Excel file with multiple worksheets Pin
thatraja25-May-11 5:01
professionalthatraja25-May-11 5:01 
GeneralRe: Export Excel file with multiple worksheets Pin
Samarjeet Singh@india26-May-11 0:24
Samarjeet Singh@india26-May-11 0:24 
Questioncoping dataset to table(DB) Pin
Ramkumar_S24-May-11 22:53
Ramkumar_S24-May-11 22:53 
AnswerRe: coping dataset to table(DB) Pin
Eddy Vluggen25-May-11 0:10
professionalEddy Vluggen25-May-11 0:10 
AnswerRe: coping dataset to table(DB) Pin
Prasanta_Prince25-May-11 0:14
Prasanta_Prince25-May-11 0:14 
QuestionMeaning of %~dp0 value Pin
indian14324-May-11 13:37
indian14324-May-11 13:37 
AnswerRe: Meaning of %~dp0 value Pin
Eddy Vluggen25-May-11 0:07
professionalEddy Vluggen25-May-11 0:07 
QuestionEnum string value Pin
Ali Al Omairi(Abu AlHassan)23-May-11 21:20
professionalAli Al Omairi(Abu AlHassan)23-May-11 21:20 
QuestionI want to Hide url. Pin
buffering8322-May-11 23:47
buffering8322-May-11 23:47 
RantRe: I want to Hide url. Pin
Groulien23-May-11 0:08
Groulien23-May-11 0:08 
GeneralMy Vote of 1 Pin
Keith Barrow23-May-11 0:37
professionalKeith Barrow23-May-11 0:37 
AnswerRe: I want to Hide url. Pin
Tarun Mangukiya23-May-11 0:15
Tarun Mangukiya23-May-11 0:15 
AnswerRe: I want to Hide url. Pin
Keith Barrow23-May-11 0:36
professionalKeith Barrow23-May-11 0:36 
GeneralRe: I want to Hide url. Pin
Tridip Bhattacharjee23-May-11 3:38
professionalTridip Bhattacharjee23-May-11 3:38 
AnswerRe: I want to Hide url. Pin
AspDotNetDev23-May-11 6:47
protectorAspDotNetDev23-May-11 6:47 

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.