Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have updated the grid and if i return partialview("/grid",lstNames). Then in my screen only grid is displaying, whereas I have Username and password controls also in the same page.

How to solve this please help me out and thanks in advance.

Pavan.
Posted

1 solution

What is the signature of the method you are calling, and how are you invoking it?

If you are linking to the method (rather than requesting it via Ajax) then the browser will be redirected to the returned content. Also, returning a partial view from an action method that is requested as the URL will mean that your page is skipping the _layout rendering.

When you update the grid, do you mean you're POSTing values? Submitting a form? If the form action is executed, the browser's just going to want to take the user to that page. You'll need to instead bundle the form values up (JSON should be easy for this) and then POST the values to your action method. This will allow you to return the partial and inject/replace it in your page.

Hope this helps some.

Cheers.
 
Share this answer
 

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



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