Events in ASP.Net Page request

Discussion in 'ASP .Net' started by anoop, Sep 24, 2009.

  1. anoop

    anoop Guest

    Hello,
    I am generating the random number and adding the value of random
    number to a user defined cookie, whose path is defined in web application
    root. I am adding the cookie using Response.Add at the page load event and
    the page_loadcomplete event. Now I want to know that in every request of the
    page, these events will be fired on not with the "autoeventwireup=true" ,
    also what other events should be used so that in every request , cookie has a
    random value.

    Thank you
     
    anoop, Sep 24, 2009
    #1
    1. Advertising

  2. anoop

    Patrice Guest

    Unclear but you could have all your page inheriting of a parent page (for
    now it seems you want to have this code in each and every page ?).

    If this is already coded properly in base page it will always run (not
    handling the event at some level doesn't mean the event doesn't occur so the
    base page will always process the event regardless of what the derived page
    does (though the derived page could override this behavior but you would
    have to do this intentionaly)).

    --
    Patrice

    "anoop" <> a écrit dans le message de groupe
    de discussion : ...
    > Hello,
    > I am generating the random number and adding the value of random
    > number to a user defined cookie, whose path is defined in web application
    > root. I am adding the cookie using Response.Add at the page load event
    > and
    > the page_loadcomplete event. Now I want to know that in every request of
    > the
    > page, these events will be fired on not with the "autoeventwireup=true" ,
    > also what other events should be used so that in every request , cookie
    > has a
    > random value.
    >
    > Thank you
     
    Patrice, Sep 24, 2009
    #2
    1. Advertising

  3. anoop

    anoop Guest

    Hello,
    I mean, I have implemented the following code already

    1. autoeventwireup="true" in Page directive
    2. calling random number functions in Page_Load
    3. calling random number functions in Page_Loadcomplete

    now what other events should I use so that number set in the cookie will be
    random in each page request.

    Thank you

    "Mark Rae [MVP]" wrote:

    > "anoop" <> wrote in message
    > news:...
    >
    > > Now I want to know that in every request of the page, these events will be
    > > fired
    > > on not with the "autoeventwireup=true"

    >
    > In order for the page events (e.g. Page_Init, Page_Load) to fire, they need
    > to be wired up.
    >
    > You can either do this manually, e.g.
    > <form id="form1" runat="server" onload="Page_Load">
    >
    > or set autoeventwireup="true" to get ASP.NET to do it for you automatically/
    >
    > Other than that, there is no difference.
    >
    > Please clarify what you mean...
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net
    >
    >
     
    anoop, Sep 26, 2009
    #3
  4. anoop

    anoop Guest

    Hello,
    I am creating only one random number and setting it in only one
    cookie and attaching the cookie to alreading existing ASP.net cookies using
    the single function. Now I want that cookie to have different value at each
    request of ASP.Net page. What other events should I use

    Thank you

    "Mark Rae [MVP]" wrote:

    > "anoop" <> wrote in message
    > news:...
    >
    > [please don't top-post]
    > http://www.caliburn.nl/topposting.html
    >
    >
    > >> Please clarify what you mean...

    > >
    > > I mean, I have implemented the following code already
    > >
    > > 1. autoeventwireup="true" in Page directive
    > > 2. calling random number functions in Page_Load
    > > 3. calling random number functions in Page_Loadcomplete
    > >
    > > Now what other events should I use so that number set in the cookie will
    > > be
    > > random in each page request.

    >
    > Let's be clear about this - you are calling random number functions (i.e.
    > more than one function) in the Page_Load and Page_LoadComplete events...?
    >
    > How many random functions are you generate...?
    >
    > How many cookies are you creating...?
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net
    >
    >
     
    anoop, Sep 26, 2009
    #4
  5. anoop

    anoop Guest

    Hello,
    I want random number cookie to be attached to the existing session,
    so that the Vulnerabilities like Session Fixation should be removed. I am
    attaching uder defined cookie as I cannot regenerate ASP.Net Session ID on
    each request. Also during each page request value of the ASP.net page, the
    cookie is not changing even if I am calling the random number function on
    page_load. I have wriiten the function in another .CS file and that file is
    located in App_Code folder.

    Thank you

    "Mark Rae [MVP]" wrote:

    > "anoop" <> wrote in message
    > news:...
    >
    > ****** [please don't top-post] *******
    > * http://www.caliburn.nl/topposting.html *
    > *******************************
    >
    > >> Let's be clear about this - you are calling random number functions (i.e.
    > >> more than one function) in the Page_Load and Page_LoadComplete events...?
    > >>
    > >> How many random functions are you generate...?
    > >>
    > >> How many cookies are you creating...?

    > >
    > > I am creating only one random number and setting it in only one
    > > cookie and attaching the cookie to alreading existing ASP.net cookies
    > > using
    > > the single function. Now I want that cookie to have different value at
    > > each
    > > request of ASP.Net page.

    >
    > A random number is precisely that - random. Every time you call a random
    > number generator, provided you reseed it correctly as necessary, it will
    > give you a different number:
    > http://www.google.co.uk/search?aq=f&sourceid=chrome&ie=UTF-8&q="C#" random number
    >
    >
    > > What other events should I use?

    >
    > ??? You say that you need to generate the random number only once per page
    > request - so pick one of the page events e.g. Page_Load and generate it
    > there.
    >
    > I'm curious as to why you think you need to do this more than once...
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net
    >
    >
     
    anoop, Sep 26, 2009
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Birtle
    Replies:
    2
    Views:
    2,060
    John Saunders
    Oct 16, 2003
  2. shiv
    Replies:
    0
    Views:
    482
  3. Alvin Bruney
    Replies:
    1
    Views:
    727
  4. =?Utf-8?B?ZXN3YW5zb24=?=

    asp.net form to send a request to a put request

    =?Utf-8?B?ZXN3YW5zb24=?=, Oct 29, 2004, in forum: ASP .Net
    Replies:
    9
    Views:
    606
    =?Utf-8?B?ZWpz?=
    Nov 9, 2004
  5. Chris

    Events Events Events Please Help

    Chris, Aug 30, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    375
    Chris
    Aug 30, 2005
Loading...

Share This Page