asp.net mvc 4 - How to get select option value inside razor in mvc -
i have <select> tag in view. example: <html><head></head> <body> <div> <select> <option value="">select</option> <option value="alert1">alert1</option> <option value="alert2">alert2</option> </select> </div> <div id="preview"> `enter razor code here`@ { here have write condition based on <select option> tag value, need display respective viewbag. } </div> </body></html> from controller passing viewbag , e.g.: viewbag.alert1="some html template1". viewbag.alert2="some html template2". my requirement is: on selecting <option> , if select 'alert1', in <div id="preview"> need display viewbag.alert1 content. if user selects 'alert2' in <div id="preview"> need display viewbag.alert2 value. i know, c