Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jan 2012
    Posts
    17
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Cool Passing variables, then using them to select code in a IF statement...

    Hi all, i need some help with something i have done in Coldfusion before but i have no clue how to do it in ASP.NET, i would like to do the following:

    1. i would like to sent a "variable" from a "link" i.e.
    **********************************************
    <div id="pro_top_nav">
    <ul>
    <li><a id="P1" href="presentations/" runat="server">Presentations</a></li>
    <li><a id="P2" href="proposals/default.aspx?" runat="server">Proposals</a></li>
    <li><a id="P3" href="postings/" runat="server">Postings</a></li>
    <li><a href="myaccount/" class="current">My Account</a></li>
    </ul>
    </div>
    ***********************************************

    2. then, i would like to use that "variable" (P1, P2 or P3) with an IF, ELSE or ELSE IF statement to cycle throught FOUR (4) possible out comes to be displayed in the BODY of an ASP.NET page.

    i.e.:
    *************************************
    if (something == P1)

    {
    show this only
    }
    else if (something else == P2)
    {
    show this only
    }
    else if (something else == P3)
    {
    show this only
    }
    else ()
    {
    just show this
    }
    ************************************

    3. something like that.... in short, i woould like to pass a variable from a selected link THEN, use that variable to display some code in a IF statement. everything will be on the page in the BODY of the page.

    Thanks.

  • #2
    Senior Coder alykins's Avatar
    Join Date
    Apr 2011
    Posts
    1,722
    Thanks
    41
    Thanked 191 Times in 190 Posts
    this should help you with sending arguments ref

    this should help you with panels ref

    the answer to this question should help you with the .visible property in your code behind- post back any more Q's or if you don't understand

    I code C hash-tag .Net
    Reference: W3C W3CWiki .Net Lib
    Validate: html CSS
    Debug: Chrome FireFox IE

  • #3
    New Coder
    Join Date
    Jan 2012
    Posts
    17
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by alykins View Post
    this should help you with sending arguments ref

    this should help you with panels ref

    the answer to this question should help you with the .visible property in your code behind- post back any more Q's or if you don't understand
    Thanks! Alykins, i will check it out asap.


  •  

    Posting Permissions

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