Click here to Skip to main content
15,913,773 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: linking the domain name Pin
DaveAuld20-Jun-10 7:39
professionalDaveAuld20-Jun-10 7:39 
GeneralRe: linking the domain name Pin
dahras21-Jun-10 12:23
dahras21-Jun-10 12:23 
GeneralRe: linking the domain name Pin
dahras20-Jun-10 7:45
dahras20-Jun-10 7:45 
GeneralRe: linking the domain name Pin
dahras20-Jun-10 6:42
dahras20-Jun-10 6:42 
GeneralRe: linking the domain name Pin
DaveAuld20-Jun-10 6:55
professionalDaveAuld20-Jun-10 6:55 
GeneralRe: linking the domain name Pin
Smithers-Jones22-Jun-10 4:37
Smithers-Jones22-Jun-10 4:37 
AnswerRe: linking the domain name Pin
Dalek Dave20-Jun-10 5:14
professionalDalek Dave20-Jun-10 5:14 
QuestionHttpContext.Current.Session & HttpContext.Current.Cache questions Pin
swjam19-Jun-10 19:10
swjam19-Jun-10 19:10 
I have a simple test web application with a single Default.aspx page with 2 buttons having the following handlers:

What surprises me is I expected to get the same session ID between successive clicks of either buttons but I get different session ID's each time. I expected this to be different clicking from 2 different iexplorer instances and more so between an iexplorer and chrome / firefox.
Also, from this experiment, it is obvious that HttpContext.Current.Cache is shared among clients as I get the values inserted from prior requests from different browsers.

protected void _btnAdd_Click(object sender, EventArgs e)
{
    int cacheCount = HttpContext.Current.Cache.Count;
    Random rnd = new Random();

    HttpContext.Current.Cache[cacheCount.ToString()] = TextBox1.Text;

    int intLessThanCacheCount = rnd.Next(cacheCount);

    _lblCacheIndex.Text = intLessThanCacheCount.ToString();
    _lblCacheValue.Text = (string) HttpContext.Current.Cache[intLessThanCacheCount.ToString()];

    lblSessionId.Text = HttpContext.Current.Session.SessionID;

    ViewState["Value"] = TextBox1.Text;

}

protected void _btnGet_Click(object sender, EventArgs e)
{
    int cacheItems = HttpContext.Current.Cache.Count;
    Random rnd = new Random();
    int intLessThanCacheCount = rnd.Next(cacheItems);

    _lblCacheIndex.Text = intLessThanCacheCount.ToString();
    _lblCacheValue.Text = (string)HttpContext.Current.Cache[intLessThanCacheCount.ToString()];

    lblSessionId.Text = HttpContext.Current.Session.SessionID;

    lblSessionValue.Text = ViewState["Value"].ToString();


}

----------------------------------------------------------
Lorem ipsum dolor sit amet.

AnswerRe: HttpContext.Current.Session & HttpContext.Current.Cache questions Pin
Dimitri Witkowski20-Jun-10 3:53
Dimitri Witkowski20-Jun-10 3:53 
GeneralRe: HttpContext.Current.Session & HttpContext.Current.Cache questions [modified] Pin
swjam20-Jun-10 17:21
swjam20-Jun-10 17:21 
AnswerRe: HttpContext.Current.Session & HttpContext.Current.Cache questions Pin
Martin Jarvis12-Jul-10 8:36
Martin Jarvis12-Jul-10 8:36 
QuestionJavascript synchronous Yes-No-Cancel dialog [modified] Pin
Dimitri Witkowski18-Jun-10 9:37
Dimitri Witkowski18-Jun-10 9:37 
AnswerRe: Javascript synchronous Yes-No-Cancel dialog Pin
T M Gray18-Jun-10 11:49
T M Gray18-Jun-10 11:49 
GeneralRe: Javascript synchronous Yes-No-Cancel dialog Pin
Dimitri Witkowski18-Jun-10 19:13
Dimitri Witkowski18-Jun-10 19:13 
AnswerRe: Javascript synchronous Yes-No-Cancel dialog Pin
Jayapal Chandran21-Jun-10 7:20
Jayapal Chandran21-Jun-10 7:20 
GeneralRe: Javascript synchronous Yes-No-Cancel dialog Pin
Dimitri Witkowski21-Jun-10 7:27
Dimitri Witkowski21-Jun-10 7:27 
GeneralRe: Javascript synchronous Yes-No-Cancel dialog Pin
Coding124-Jun-10 6:41
Coding124-Jun-10 6:41 
QuestionCompatibility issue of "usedrange"property with Google Map APIs Pin
Farah Siraj18-Jun-10 8:19
Farah Siraj18-Jun-10 8:19 
AnswerRe: Compatibility issue of "usedrange"property with Google Map APIs Pin
Richard MacCutchan18-Jun-10 22:03
mveRichard MacCutchan18-Jun-10 22:03 
Questionmvc pattern + oracle Pin
Member 238096518-Jun-10 5:33
Member 238096518-Jun-10 5:33 
Answer[Cross-Post] mvc pattern + oracle Pin
Sandeep Mewara18-Jun-10 7:53
mveSandeep Mewara18-Jun-10 7:53 
QuestionHow to create xmpp client using C#? Pin
manjeeet17-Jun-10 23:12
manjeeet17-Jun-10 23:12 
Answercross-post Pin
Luc Pattyn18-Jun-10 2:28
sitebuilderLuc Pattyn18-Jun-10 2:28 
QuestionBad Gateway Error Pin
Elena200617-Jun-10 4:05
Elena200617-Jun-10 4:05 
AnswerRe: Bad Gateway Error Pin
R. Giskard Reventlov17-Jun-10 4:12
R. Giskard Reventlov17-Jun-10 4:12 

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.