0

I have one doubt.

I have one view called CustomerMaster. In CustomerMaster view I have field Like 'Area', 'City' etc. If city is already in the list it will be automatically shown in the Dropdown .

Suppose the City which I need is not in the list, means I have to add that city. So I decided to keep one 'Add' button near to 'city' field. If I click that button it needs to redirect to that view. So how can i do this in MVC4?

1) How can I keep button near to the field?
2) How to redirect from one view to another view while clicking the button in mvc4?

Thanks .

Priya
  • 23
  • 1
  • 10
  • next time ask google first –  Nov 26 '15 at 10:21
  • Sneha, I don't think questions like this will be encouraged in SO. Please do a research by yourself before posting a question. Try to do by yourself and raise questions if you stuck with some issues. – ssilas777 Nov 26 '15 at 10:22
  • I am a fresher and very very new to mvc so only i stuck with this simple concept. How could you say like this. what freshers can do think about that? – Priya Nov 26 '15 at 10:32

2 Answers2

1

answer of question 1 is "using HTML" answer of question 2 is "using Html.ActionLink()" method

  • 1
    I know button coding to keep button .. but i donno how to redirect to another view . In need that "using Html.ActionLink()" coding – Priya Nov 26 '15 at 10:29
0

Make an ajax call from the view CustomerMaster on click of button. The syntax would be like

 $.ajax({
url : updatecontroller
success: dosomething
});

In the updatecontroller return the corresponding view which is one more html page.

I have given you the idea, for the exact syntax of making an ajax on button click here is the link http://www.codeproject.com/Articles/41828/JQuery-AJAX-with-ASP-NET-MVC.

user1907849
  • 960
  • 4
  • 19
  • 42
  • Additionally check this link: This looks pretty simple follow this http://stackoverflow.com/questions/16186083/making-a-simple-ajax-call-to-controller-in-asp-net-mvc – user1907849 Nov 26 '15 at 10:42
  • ok Dudes . lets i have a try . If i get any error means i will post my question again.. – Priya Nov 26 '15 at 10:43