질문하기질문하기
 

질문C#2010 Calculation question

  • 2009년 11월 30일 월요일 오후 7:57Coystah 사용자 메달사용자 메달사용자 메달사용자 메달사용자 메달
     
    Hi all :) fairly new to C# (Previously used Java before.. but learning as I go along lol)

    So using VS2010 and working within ASP.NET as a web page format... but that's not really related.

    My question is... if I have a dropdownlist of possible selections.. how would I make a calculation from a given answer?

    For example, if someone was to select a given service from 4 possible options and I wanted to calculate the price, how would this be done?

     

    <p class="style3">

    Service

    <asp:DropDownList ID="customerService" runat="server" Height="22px" Width="200px">

     

    <asp:ListItem>Option 1</asp:ListItem>

     

    <asp:ListItem>Option 2</asp:ListItem>

     

    </asp:DropDownList>


    If I then wanted to calculate a price from what they select via a button, what would my best option be?

    I.e If Service = 1 selected then cost = x, 
    else  then cost = x
    • 이동됨David M MortonMVP2009년 11월 30일 월요일 오후 8:03ASP.NET (From:Visual C# General)
    •  

모든 응답