how can I pass values from one view to another view in mvc3 without page refresh.

Posted by Rajanarayanan under ASP.NET on 12/10/2012 | Points: 10 | Views : 1985 | Status : [Member] | Replies : 3
Hi,

How can I pass values from one view to another view in mvc3 without page refresh.

I have two views in mvc3.
First view I have drop down list and link button. i have selected value from drop down list then when i click on the link button the second view will be open.
In my second view i am selected the value from grid that value is passed to the first view.
that time Drop down list value returns to -select- after page refresh.

How can i solve this issue.may i use Ajax call in mvc3.....

Thanks & Regards
Narayanan P



Responses

Posted by: Funda on: 12/10/2012 [Member] Starter | Points: 25

Up
0
Down
If it is one value you can pass it through URL...if not it cant be done using anchor tag or action.link....Go for button..return the view using model...

Rajanarayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rajanarayanan on: 12/10/2012 [Member] Starter | Points: 25

Up
0
Down
I have attached Screen shot for my application..
 Download source file

Thanks & Regards
Narayanan P

Rajanarayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Funda on: 12/10/2012 [Member] Starter | Points: 25

Up
0
Down
I am not sure how ur handeled this....you told ur using AJAX Call rigtht....
May be this will help u.....
$.ajax({
url: 'YOUR/URL',
dataType: 'html',
cache: false,
data: { "parameter1": DropDownValue1,
"parameter2": DropDownValue2
},
success: function (htmlResult) {

var window = $("#Window");
window.center().open();
}
});
if it is not fullfilled send ur code....I will check it...

Rajanarayanan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response