Click here to Skip to main content
15,884,353 members

on button click calling either of the action result in controller as per condition

Member 9359591 asked:

Open original thread
Hi friends, i need some help.
Condition in the home view
I have and if conditon
if{ conditon 1 }
else { condition 2 }

button

i have a javascript for the button click to perform condition 1 and call the action result in the controller

i have a javascript for the button click to perform condition 2 and call the action result in the controller

now i need to give a javascript where i tell the button if condition 1 is satified then choose condition1 javascript and call the action result for that in controller.

Or if condition2 is satisfied then the button should choose the condition2 javascript and call that respective action result in controller

I have two action results in the controller for a button click in the controller. How do i do this..Can anyone help
Tags: C# (C# 4.0), Javascript, Ajax, jQuery, Razor, MVC3

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900