Click here to Skip to main content
15,888,286 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: trouble sending message to the view from controller Pin
John C Rayan1-Jun-17 22:05
professionalJohn C Rayan1-Jun-17 22:05 
GeneralRe: trouble sending message to the view from controller Pin
Hamiltonian139-Jun-17 6:28
Hamiltonian139-Jun-17 6:28 
GeneralRe: trouble sending message to the view from controller Pin
John C Rayan16-Jun-17 2:48
professionalJohn C Rayan16-Jun-17 2:48 
Questionadd small delete button or image to the options of select Pin
indian14326-May-17 13:51
indian14326-May-17 13:51 
QuestionNeed some help in implementing Partial View Pin
indian14323-May-17 13:44
indian14323-May-17 13:44 
AnswerRe: Need some help in implementing Partial View Pin
jkirkerx24-May-17 12:33
professionaljkirkerx24-May-17 12:33 
GeneralRe: Need some help in implementing Partial View Pin
indian14324-May-17 13:26
indian14324-May-17 13:26 
GeneralRe: Need some help in implementing Partial View Pin
jkirkerx25-May-17 10:08
professionaljkirkerx25-May-17 10:08 
I understand what you want to do, I have just never done it. I never thought about using a partial view for data presentation or work form.

I think some critical thinking is required here.
Remember that the Controller is called first to populate a model, then add some ViewData if required.
Then the View is rendered, including your partial view.
Now the HTML is downloaded by the browser and begins to render.
Once the DOM is set in the browser, Ready is called and your JQuery then runs.

Technically, as an example in the Microsoft Owin Security package, I think ViewData is passed from the parent View to the Partial View. This means you should be able to pack a model into ViewData that will be passed along to the partial. I've done it with Sessions, in which I loaded a model into a session for checkout, and I've done it with ViewData as well.

so it you have a ViewData, this would pull the model back out of the ViewData in the partial view.
var names = (model_array_names)ViewData["NameArray"];
And to pack the ViewData["NameArray"] in the controller
ViewData["NameArray"] = model_array_names;

I would just design a better model or form layout first. If you have to make a choice on a form before data is loaded, then I would design HTML containers for all the scenarios, and then fill those containers with an AJAX call via JQuery.
If it ain't broke don't fix it

Questioncell_double click even on grid view Pin
Mayank Kumar23-May-17 0:14
Mayank Kumar23-May-17 0:14 
AnswerRe: cell_double click even on grid view Pin
Maciej Los23-May-17 20:19
mveMaciej Los23-May-17 20:19 
QuestionReturn message to user if file already exists Pin
Hamiltonian1322-May-17 10:59
Hamiltonian1322-May-17 10:59 
AnswerRe: Return message to user if file already exists Pin
F-ES Sitecore22-May-17 22:59
professionalF-ES Sitecore22-May-17 22:59 
GeneralRe: Return message to user if file already exists Pin
Hamiltonian1324-May-17 8:14
Hamiltonian1324-May-17 8:14 
QuestionSingleton Class in Asp.net application Pin
Rafique Abdullah19-May-17 21:54
Rafique Abdullah19-May-17 21:54 
AnswerRe: Singleton Class in Asp.net application Pin
Nathan Minier20-May-17 12:43
professionalNathan Minier20-May-17 12:43 
GeneralRe: Singleton Class in Asp.net application Pin
Rafique Abdullah22-May-17 7:15
Rafique Abdullah22-May-17 7:15 
GeneralRe: Singleton Class in Asp.net application Pin
F-ES Sitecore22-May-17 22:50
professionalF-ES Sitecore22-May-17 22:50 
QuestionHow to populate dropdownlist in the partial view, base upon the selection of another dropdown value in the view, using angular js Pin
Member 1318632317-May-17 20:16
Member 1318632317-May-17 20:16 
QuestionError Pin
Member 1116162516-May-17 20:10
Member 1116162516-May-17 20:10 
AnswerRe: Error Pin
Kornfeld Eliyahu Peter16-May-17 21:27
professionalKornfeld Eliyahu Peter16-May-17 21:27 
AnswerRe: Error Pin
Richard MacCutchan16-May-17 21:36
mveRichard MacCutchan16-May-17 21:36 
AnswerRe: Error Pin
F-ES Sitecore16-May-17 22:11
professionalF-ES Sitecore16-May-17 22:11 
SuggestionRe: Error Pin
Richard Deeming17-May-17 1:24
mveRichard Deeming17-May-17 1:24 
QuestionTelerik version upgradation issue in Asp.net Pin
Member 1058746112-May-17 1:28
Member 1058746112-May-17 1:28 
SuggestionRe: Telerik version upgradation issue in Asp.net Pin
Richard Deeming12-May-17 4:08
mveRichard Deeming12-May-17 4:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.