Who can give me a explanation?

Discussion in 'MCAD' started by Robert, Sep 6, 2004.

  1. Robert

    Robert Guest

    Here is a question from dumps, I don't agree to that
    answer. who can help me?

    Q: You are a Web developer for a Gsoft bookstore. You
    create a Web user control named
    CkBookTopics that is defined in a file named
    CkBookTopics.ascx. CkBookTopics displays a list
    of book topics based on an author's profile identification
    number. The profile identification
    number is stored in a public property of CkBookTopics
    named AuthorProfile.
    You create an ASP.NET page named AuthorPage.aspx that
    contains an instance of the
    CkBookTopics Web user control. AuthorPage.aspx is opened
    by an HTTP-GET request that
    has two parameters. The parameters are named publisherID
    and authorProfileID. The value
    of authorProfileID is a profile identification number.
    You want to enable output caching for the CkBookTopics Web
    user control. You need to
    ensure that the cached control is varied only by an
    author's profile identification number.
    What should you do?

    A. Add the following element to the OutputCache directive
    for AuthorPage.aspx:
    VaryByParam="CkBookTopics.AuthorProfile"
    B. Add the following element to the OutputCache directive
    for AuthorPage.aspx:
    VaryByControl="CkBookTopics.AuthorProfile"
    C. Add the following element to the OutputCache directive
    for CkBookTopics.ascx:
    VaryByParam="none"
    D. Add the following element to the OutputCache directive
    for CkBookTopics.ascx:
    VaryByControl="authorProfileID"
    Answer: D


    according to MSDN, "You can vary user-control output to
    the cache in two ways: by specifying the user control name
    along with either a query string or a form POST parameter,
    or by specifying the ID property of an ASP.NET server
    control contained in the user control." the former is
    VaryByParam, the later is varybycontrol. however, in this
    case, if we choose D, we should put a control ID here,
    not "authorProfileID" parameter.

    who can give me a hint? thanks
     
    Robert, Sep 6, 2004
    #1
    1. Advertising

  2. Robert

    Frank Mamone Guest

    Good question.

    From what I studied, the bottom line is when you want to cache a user
    control by one of it's properties then you use VaryByControl and when you
    want to cache it based on a query string or posted variable then you use
    VaryByParam.

    Since we're talking about a property here then D is the only possible answer
    here. That being said, I think your real question is why MSDN says to use
    the ID of the Control. Well, that doesn't make sense to me because then we
    wouldn't know what parameter in the control to cache by. It should be a
    property.

    In my mind the answer should be:

    VaryByControl="AuthorProfile" as that is the name of the property.

    Maybe some experts can chime into this conversation and clear this up.

    I have found many mistakes in practice exams, so that would not surprise me.

    - Frank M.



    "Robert" <> wrote in message
    news:6c4c01c49419$5c98af60$...
    > Here is a question from dumps, I don't agree to that
    > answer. who can help me?
    >
    > Q: You are a Web developer for a Gsoft bookstore. You
    > create a Web user control named
    > CkBookTopics that is defined in a file named
    > CkBookTopics.ascx. CkBookTopics displays a list
    > of book topics based on an author's profile identification
    > number. The profile identification
    > number is stored in a public property of CkBookTopics
    > named AuthorProfile.
    > You create an ASP.NET page named AuthorPage.aspx that
    > contains an instance of the
    > CkBookTopics Web user control. AuthorPage.aspx is opened
    > by an HTTP-GET request that
    > has two parameters. The parameters are named publisherID
    > and authorProfileID. The value
    > of authorProfileID is a profile identification number.
    > You want to enable output caching for the CkBookTopics Web
    > user control. You need to
    > ensure that the cached control is varied only by an
    > author's profile identification number.
    > What should you do?
    >
    > A. Add the following element to the OutputCache directive
    > for AuthorPage.aspx:
    > VaryByParam="CkBookTopics.AuthorProfile"
    > B. Add the following element to the OutputCache directive
    > for AuthorPage.aspx:
    > VaryByControl="CkBookTopics.AuthorProfile"
    > C. Add the following element to the OutputCache directive
    > for CkBookTopics.ascx:
    > VaryByParam="none"
    > D. Add the following element to the OutputCache directive
    > for CkBookTopics.ascx:
    > VaryByControl="authorProfileID"
    > Answer: D
    >
    >
    > according to MSDN, "You can vary user-control output to
    > the cache in two ways: by specifying the user control name
    > along with either a query string or a form POST parameter,
    > or by specifying the ID property of an ASP.NET server
    > control contained in the user control." the former is
    > VaryByParam, the later is varybycontrol. however, in this
    > case, if we choose D, we should put a control ID here,
    > not "authorProfileID" parameter.
    >
    > who can give me a hint? thanks
    >
    >
    >
     
    Frank Mamone, Sep 6, 2004
    #2
    1. Advertising

  3. Robert

    Frank Mamone Guest

    I stand corrected on the property name theory. Here is MSDN's explanation:

    To cache multiple versions of a user control declaratively by using the
    VaryByControl attribute

    1.. Create a user control that posts back.
    2.. Include an @ OutputCache directive in the .ascx file with Duration and
    VaryByControl attributes.
    Note If you include use the VaryByControl attribute in the directive,
    you do not need to include the VaryByParam attribute.
    3.. Set the VaryByControl attribute to the name of the query string or
    form POST parameter that you want to vary the user control output by in the
    output cache.
    For example, the following @ OutputCache directive sets expirations for
    the user control to 60 seconds and varies the control's output by a state
    parameter.

    <%@ OutputCache Duration="60" VaryByControl="State" %>

    "Frank Mamone" <> wrote in message
    news:...
    > Good question.
    >
    > From what I studied, the bottom line is when you want to cache a user
    > control by one of it's properties then you use VaryByControl and when you
    > want to cache it based on a query string or posted variable then you use
    > VaryByParam.
    >
    > Since we're talking about a property here then D is the only possible

    answer
    > here. That being said, I think your real question is why MSDN says to use
    > the ID of the Control. Well, that doesn't make sense to me because then we
    > wouldn't know what parameter in the control to cache by. It should be a
    > property.
    >
    > In my mind the answer should be:
    >
    > VaryByControl="AuthorProfile" as that is the name of the property.
    >
    > Maybe some experts can chime into this conversation and clear this up.
    >
    > I have found many mistakes in practice exams, so that would not surprise

    me.
    >
    > - Frank M.
    >
    >
    >
    > "Robert" <> wrote in message
    > news:6c4c01c49419$5c98af60$...
    > > Here is a question from dumps, I don't agree to that
    > > answer. who can help me?
    > >
    > > Q: You are a Web developer for a Gsoft bookstore. You
    > > create a Web user control named
    > > CkBookTopics that is defined in a file named
    > > CkBookTopics.ascx. CkBookTopics displays a list
    > > of book topics based on an author's profile identification
    > > number. The profile identification
    > > number is stored in a public property of CkBookTopics
    > > named AuthorProfile.
    > > You create an ASP.NET page named AuthorPage.aspx that
    > > contains an instance of the
    > > CkBookTopics Web user control. AuthorPage.aspx is opened
    > > by an HTTP-GET request that
    > > has two parameters. The parameters are named publisherID
    > > and authorProfileID. The value
    > > of authorProfileID is a profile identification number.
    > > You want to enable output caching for the CkBookTopics Web
    > > user control. You need to
    > > ensure that the cached control is varied only by an
    > > author's profile identification number.
    > > What should you do?
    > >
    > > A. Add the following element to the OutputCache directive
    > > for AuthorPage.aspx:
    > > VaryByParam="CkBookTopics.AuthorProfile"
    > > B. Add the following element to the OutputCache directive
    > > for AuthorPage.aspx:
    > > VaryByControl="CkBookTopics.AuthorProfile"
    > > C. Add the following element to the OutputCache directive
    > > for CkBookTopics.ascx:
    > > VaryByParam="none"
    > > D. Add the following element to the OutputCache directive
    > > for CkBookTopics.ascx:
    > > VaryByControl="authorProfileID"
    > > Answer: D
    > >
    > >
    > > according to MSDN, "You can vary user-control output to
    > > the cache in two ways: by specifying the user control name
    > > along with either a query string or a form POST parameter,
    > > or by specifying the ID property of an ASP.NET server
    > > control contained in the user control." the former is
    > > VaryByParam, the later is varybycontrol. however, in this
    > > case, if we choose D, we should put a control ID here,
    > > not "authorProfileID" parameter.
    > >
    > > who can give me a hint? thanks
    > >
    > >
    > >

    >
    >
     
    Frank Mamone, Sep 6, 2004
    #3
  4. Robert,
    I think the first question you should be asking is "Why am I looking at
    braindumps?"

    --
    Lateralus [MCAD]


    "Robert" <> wrote in message
    news:6c4c01c49419$5c98af60$...
    > Here is a question from dumps, I don't agree to that
    > answer. who can help me?
    >
    > Q: You are a Web developer for a Gsoft bookstore. You
    > create a Web user control named
    > CkBookTopics that is defined in a file named
    > CkBookTopics.ascx. CkBookTopics displays a list
    > of book topics based on an author's profile identification
    > number. The profile identification
    > number is stored in a public property of CkBookTopics
    > named AuthorProfile.
    > You create an ASP.NET page named AuthorPage.aspx that
    > contains an instance of the
    > CkBookTopics Web user control. AuthorPage.aspx is opened
    > by an HTTP-GET request that
    > has two parameters. The parameters are named publisherID
    > and authorProfileID. The value
    > of authorProfileID is a profile identification number.
    > You want to enable output caching for the CkBookTopics Web
    > user control. You need to
    > ensure that the cached control is varied only by an
    > author's profile identification number.
    > What should you do?
    >
    > A. Add the following element to the OutputCache directive
    > for AuthorPage.aspx:
    > VaryByParam="CkBookTopics.AuthorProfile"
    > B. Add the following element to the OutputCache directive
    > for AuthorPage.aspx:
    > VaryByControl="CkBookTopics.AuthorProfile"
    > C. Add the following element to the OutputCache directive
    > for CkBookTopics.ascx:
    > VaryByParam="none"
    > D. Add the following element to the OutputCache directive
    > for CkBookTopics.ascx:
    > VaryByControl="authorProfileID"
    > Answer: D
    >
    >
    > according to MSDN, "You can vary user-control output to
    > the cache in two ways: by specifying the user control name
    > along with either a query string or a form POST parameter,
    > or by specifying the ID property of an ASP.NET server
    > control contained in the user control." the former is
    > VaryByParam, the later is varybycontrol. however, in this
    > case, if we choose D, we should put a control ID here,
    > not "authorProfileID" parameter.
    >
    > who can give me a hint? thanks
    >
    >
    >
     
    Lateralus [MCAD], Sep 6, 2004
    #4
  5. Robert

    Robert Guest

    Thanks very much
    >-----Original Message-----
    >Good question.
    >
    >From what I studied, the bottom line is when you want to

    cache a user
    >control by one of it's properties then you use

    VaryByControl and when you
    >want to cache it based on a query string or posted

    variable then you use
    >VaryByParam.
    >
    >Since we're talking about a property here then D is the

    only possible answer
    >here. That being said, I think your real question is why

    MSDN says to use
    >the ID of the Control. Well, that doesn't make sense to

    me because then we
    >wouldn't know what parameter in the control to cache by.

    It should be a
    >property.
    >
    >In my mind the answer should be:
    >
    >VaryByControl="AuthorProfile" as that is the name of the

    property.
    >
    >Maybe some experts can chime into this conversation and

    clear this up.
    >
    >I have found many mistakes in practice exams, so that

    would not surprise me.
    >
    >- Frank M.
    >
    >
    >
    >"Robert" <> wrote in

    message
    >news:6c4c01c49419$5c98af60$...
    >> Here is a question from dumps, I don't agree to that
    >> answer. who can help me?
    >>
    >> Q: You are a Web developer for a Gsoft bookstore. You
    >> create a Web user control named
    >> CkBookTopics that is defined in a file named
    >> CkBookTopics.ascx. CkBookTopics displays a list
    >> of book topics based on an author's profile

    identification
    >> number. The profile identification
    >> number is stored in a public property of CkBookTopics
    >> named AuthorProfile.
    >> You create an ASP.NET page named AuthorPage.aspx that
    >> contains an instance of the
    >> CkBookTopics Web user control. AuthorPage.aspx is opened
    >> by an HTTP-GET request that
    >> has two parameters. The parameters are named publisherID
    >> and authorProfileID. The value
    >> of authorProfileID is a profile identification number.
    >> You want to enable output caching for the CkBookTopics

    Web
    >> user control. You need to
    >> ensure that the cached control is varied only by an
    >> author's profile identification number.
    >> What should you do?
    >>
    >> A. Add the following element to the OutputCache

    directive
    >> for AuthorPage.aspx:
    >> VaryByParam="CkBookTopics.AuthorProfile"
    >> B. Add the following element to the OutputCache

    directive
    >> for AuthorPage.aspx:
    >> VaryByControl="CkBookTopics.AuthorProfile"
    >> C. Add the following element to the OutputCache

    directive
    >> for CkBookTopics.ascx:
    >> VaryByParam="none"
    >> D. Add the following element to the OutputCache

    directive
    >> for CkBookTopics.ascx:
    >> VaryByControl="authorProfileID"
    >> Answer: D
    >>
    >>
    >> according to MSDN, "You can vary user-control output to
    >> the cache in two ways: by specifying the user control

    name
    >> along with either a query string or a form POST

    parameter,
    >> or by specifying the ID property of an ASP.NET server
    >> control contained in the user control." the former is
    >> VaryByParam, the later is varybycontrol. however, in

    this
    >> case, if we choose D, we should put a control ID here,
    >> not "authorProfileID" parameter.
    >>
    >> who can give me a hint? thanks
    >>
    >>
    >>

    >
    >
    >.
    >
     
    Robert, Sep 7, 2004
    #5
  6. Robert

    S.S.Raja Guest

    Are You Using braindumps?! Thats not fair...
     
    S.S.Raja, Sep 9, 2004
    #6
  7. Robert

    Frank Mamone Guest

    I'm not sure how a BrainDump is defined but here is what I am doing.

    I'm using two books to actually learn the material:

    1. Amit Kalanis 70-315
    2. MS Press Self-Training Kit

    I typed in and ran every Step by Step in the Kalani book and use the MS
    Press book as a secondary reference as I really don't like the format.

    I also use Practice tests to get used to the format and questions I may get
    exposed to at the actual exam. It also serves as a great review and points
    out the areas I need to work on. Since the exams have links to MSDN, I also
    go to those links and learn as much as possible from there.

    I really can't see how someone can actually go out there and work by only
    using the practice exams. I think it's possible in the scenario where the
    person already has a job in the technology and wants to be certified.

    I hope that answers your question.

    - Frank M.

    "S.S.Raja" <> wrote in message
    news:...
    > Are You Using braindumps?! Thats not fair...
    >
    >
    >
     
    Frank Mamone, Sep 9, 2004
    #7
    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. lib
    Replies:
    0
    Views:
    503
  2. lib
    Replies:
    1
    Views:
    589
  3. l#

    GIVE ME FILM OR GIVE ME DEATH

    l#, Jul 14, 2005, in forum: DVD Video
    Replies:
    4
    Views:
    567
    Lookingglass
    Jul 14, 2005
  4. Anuj
    Replies:
    0
    Views:
    469
  5. Replies:
    0
    Views:
    403
Loading...

Share This Page