Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET HTML MVC MVC3
Hello Everyone!
 
First of all, I want to say I am very new to MVC and I would like to be little patient.
 
I have some radio buttons and a submit button that must redirect to another page depending on what radio buttons you are choosing.
 
I will post the html code radio buttons.
<div>
                                <div>
                                        <table>
                                                <tr>
                                                        <td colspan="2"><strong>Example</strong></td>
                                                </tr>
                                                <tr>
                                                        <td><input type="radio"></td>
                                                        <td>Example1</td>
                                        </tr>
                                                <tr>
                                                        <td><input type="radio"></td>
                                                        <td>Example2</td>
                                                </tr>
                                                <tr>
                                                        <td><input type="radio"></td>
                                                        <tdExample3</td>
                                                </tr>
                                        </table>
                                <!--    <p class="error">Error</p>-->
                                        <div></div>
                                </div>
 
                                <div>
 
                                        <table>
                                                <tr>
                                                        <td colspan="2"><strongShow</strong></td>
                                                </tr>
                                                <tr>
                                                        <td><input type="radio"></td>
                                                        <td>Show1</td>
                                                </tr>
                                                <tr>
                                                        <td><input type="radio"></td>
                                                        <td>Show2</td>
                                                </tr>
                                                <tr>
                                                        <td><input type="radio"></td>
                                                        <td>Show3</td>
                                                </tr>
                                        </table>
 
                                <!--    <p class="error">Error</p>-->
                                        <div></div>
                                </div>
 
                                <div>
                                        <table>
                                                <tr>
                                                        <td colspan="4"><strong>Search</strong></td>
                                                </tr>
                                                <tr>
                                                        <td><input type="radio"></td>
                                                        <td>1</td>
                                                        <td><input type="radio"></td>
                                                        <td>2</td>
                                                </tr>
                                        </table>
 
                                        <!--<p class="error">Error</p>-->
                                        <div></div>
                                </div>
 
                                <a href=""><span>&nbsp;Submit</span></a>
                                <div>&nbsp;</div>
                        </div>
I will need please someone to help me to build a controller which will control this html file. Since I was reading on the internet I need a javascript file to play the role as trigger for the html.
 
Example:
 
If I select Example1 radio button and Show1 and 1 it will redirect to Page1. If I select Example1 and Show2 and 1 it will redirect to Page2. If I select Example1 and Show3 and 1 it will redirect to Page2. As you see if you select Show2 and Show3 with Example1 they redirect to same page. I read about this and is ok to start with Enum, but I dont know.
 
Please can someone help me with the controller code?
 
Thank you so much
Posted 9-Apr-13 9:35am
Edited 9-Apr-13 9:49am
v4
Comments
Bala Selvanayagam at 11-Apr-13 5:55am
   
May be you can pass a parameter/ argument from the view to the controller and within the controller check the parameter and redirect to different pages

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web01 | 2.8.1411022.1 | Last Updated 9 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100