Results 1 to 4 of 4

Thread: keeping a variable value

  1. #1

    Thread Starter
    Addicted Member KingSatan's Avatar
    Join Date
    Feb 2006
    Posts
    185

    keeping a variable value

    ok i have a datagrid which only displays top updates.

    when i click a linkbutton i want to expand this dg (or at least make the user think its expanding.

    i have a boolen so if link is clicked it goes to fals and a different sql statement is used, but... after the data is bound its always false. ive debugged and there is nothing setting it to false, and even when i set the boolean to true, if i try to bind the data ts false.

    my goal is for this boolean to keep its value through the post back

    i dont know if i was very clear.

    any questions?

  2. #2
    Addicted Member
    Join Date
    Jun 2003
    Location
    Birmingham, AL
    Posts
    188

    Re: keeping a variable value

    I assume this is a web app so maybe store the value in a session

  3. #3

    Thread Starter
    Addicted Member KingSatan's Avatar
    Join Date
    Feb 2006
    Posts
    185

    Re: keeping a variable value

    yes sorry i didnt specify


    can you give an example?

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: keeping a variable value

    In the page load, add a new viewstate variable. In the link's postback event, I assume there is one from your description, set ViewState["ishidden"] = false (for example).

    Whenever you need to read it, read from ViewState["ishidden"]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width