Hide/Show Controls during a callback

Discussion in 'ASP .Net' started by =?Utf-8?B?U3JpZGhhcg==?=, Apr 11, 2007.

  1. Hi,

    Is it possible to Hide/Show controls during a callback? I have a radio
    button list that does the callback. When it does the callback I need to
    refresh the grid to reflect the selected value in the radio button. Also I
    need to hide some check boxes based on the selected value. The checkboxes and
    radiobuttons are both server controls. Please let me know.

    Thanks,
    =?Utf-8?B?U3JpZGhhcg==?=, Apr 11, 2007
    #1
    1. Advertising

  2. =?Utf-8?B?U3JpZGhhcg==?=

    Aidy Guest

    Change their Visible property to True or False.

    "Sridhar" <> wrote in message
    news:...
    > Hi,
    >
    > Is it possible to Hide/Show controls during a callback? I have a radio
    > button list that does the callback. When it does the callback I need to
    > refresh the grid to reflect the selected value in the radio button. Also I
    > need to hide some check boxes based on the selected value. The checkboxes
    > and
    > radiobuttons are both server controls. Please let me know.
    >
    > Thanks,
    Aidy, Apr 11, 2007
    #2
    1. Advertising

  3. That won't work because there is no postback occuring where the server can
    pick this up.
    You need to use client script to set the display attribute of the control
    (you can also use the visibility attribute; each has a different effect.)
    Peter

    --
    Site: http://www.eggheadcafe.com
    UnBlog: http://petesbloggerama.blogspot.com
    Short urls & more: http://ittyurl.net




    "Aidy" wrote:

    > Change their Visible property to True or False.
    >
    > "Sridhar" <> wrote in message
    > news:...
    > > Hi,
    > >
    > > Is it possible to Hide/Show controls during a callback? I have a radio
    > > button list that does the callback. When it does the callback I need to
    > > refresh the grid to reflect the selected value in the radio button. Also I
    > > need to hide some check boxes based on the selected value. The checkboxes
    > > and
    > > radiobuttons are both server controls. Please let me know.
    > >
    > > Thanks,

    >
    >
    >
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Apr 11, 2007
    #3
  4. Hi,

    Thank you for the reply. I have already thought about that. Now I am having
    a different problem. I am using ScriptManager and UpdatePanel controls to do
    the callbacks. I have a radio button list that does the callback. The
    radiobuttonlist has three options. The first option is selected by default.
    So when the user gets the page for the first time it uses that option to
    display the data. when I switch to another option it is doing the callback
    and everything is working fine. However if I select the first option(which is
    default) it is not doing the callback. I am assuming that since it didn't
    update the viewstate during the callback the asp.net framework is thinking
    that the selectedindex didn't change for the radiobutton list. That is why
    it is not doing callback. When I searched online they sugested to call
    WebForm_InitCallback() manually. But I am not knowing where to include that
    code since the ScriptManager automatically inserts the necessary javascript
    code for the callbacks. Please let me know.

    Thanks,


    "Peter Bromberg [C# MVP]" wrote:

    > That won't work because there is no postback occuring where the server can
    > pick this up.
    > You need to use client script to set the display attribute of the control
    > (you can also use the visibility attribute; each has a different effect.)
    > Peter
    >
    > --
    > Site: http://www.eggheadcafe.com
    > UnBlog: http://petesbloggerama.blogspot.com
    > Short urls & more: http://ittyurl.net
    >
    >
    >
    >
    > "Aidy" wrote:
    >
    > > Change their Visible property to True or False.
    > >
    > > "Sridhar" <> wrote in message
    > > news:...
    > > > Hi,
    > > >
    > > > Is it possible to Hide/Show controls during a callback? I have a radio
    > > > button list that does the callback. When it does the callback I need to
    > > > refresh the grid to reflect the selected value in the radio button. Also I
    > > > need to hide some check boxes based on the selected value. The checkboxes
    > > > and
    > > > radiobuttons are both server controls. Please let me know.
    > > >
    > > > Thanks,

    > >
    > >
    > >
    =?Utf-8?B?U3JpZGhhcg==?=, Apr 11, 2007
    #4
  5. Are there solution about it ??
    --
    http://www.alhambra-eidos.es/web2005/index.html
    www.kiquenet.net



    "Sridhar" wrote:

    > Hi,
    >
    > Thank you for the reply. I have already thought about that. Now I am having
    > a different problem. I am using ScriptManager and UpdatePanel controls to do
    > the callbacks. I have a radio button list that does the callback. The
    > radiobuttonlist has three options. The first option is selected by default.
    > So when the user gets the page for the first time it uses that option to
    > display the data. when I switch to another option it is doing the callback
    > and everything is working fine. However if I select the first option(which is
    > default) it is not doing the callback. I am assuming that since it didn't
    > update the viewstate during the callback the asp.net framework is thinking
    > that the selectedindex didn't change for the radiobutton list. That is why
    > it is not doing callback. When I searched online they sugested to call
    > WebForm_InitCallback() manually. But I am not knowing where to include that
    > code since the ScriptManager automatically inserts the necessary javascript
    > code for the callbacks. Please let me know.
    >
    > Thanks,
    >
    >
    > "Peter Bromberg [C# MVP]" wrote:
    >
    > > That won't work because there is no postback occuring where the server can
    > > pick this up.
    > > You need to use client script to set the display attribute of the control
    > > (you can also use the visibility attribute; each has a different effect.)
    > > Peter
    > >
    > > --
    > > Site: http://www.eggheadcafe.com
    > > UnBlog: http://petesbloggerama.blogspot.com
    > > Short urls & more: http://ittyurl.net
    > >
    > >
    > >
    > >
    > > "Aidy" wrote:
    > >
    > > > Change their Visible property to True or False.
    > > >
    > > > "Sridhar" <> wrote in message
    > > > news:...
    > > > > Hi,
    > > > >
    > > > > Is it possible to Hide/Show controls during a callback? I have a radio
    > > > > button list that does the callback. When it does the callback I need to
    > > > > refresh the grid to reflect the selected value in the radio button. Also I
    > > > > need to hide some check boxes based on the selected value. The checkboxes
    > > > > and
    > > > > radiobuttons are both server controls. Please let me know.
    > > > >
    > > > > Thanks,
    > > >
    > > >
    > > >
    =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?=, Apr 24, 2007
    #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. Jeremy S

    Show/Hide controls at runtime

    Jeremy S, Mar 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    532
    Curt_C [MVP]
    Mar 4, 2004
  2. sorCrer

    Nested repeater controls show/hide?

    sorCrer, Feb 24, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    6,841
    Karl Seguin
    Feb 28, 2005
  3. vcuankitdotnet

    Show/Hide Multiple User Controls on Page

    vcuankitdotnet, May 16, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    559
    =?Utf-8?B?U2VyZ2V5IFBvYmVyZXpvdnNraXk=?=
    May 17, 2007
  4. dan
    Replies:
    0
    Views:
    686
  5. ll
    Replies:
    2
    Views:
    632
    Thomas 'PointedEars' Lahn
    May 1, 2008
Loading...

Share This Page