Click here to Skip to main content
15,885,856 members
Home / Discussions / C#
   

C#

 
AnswerRe: Name Generator Pin
Gerry Schmitz30-Jul-20 8:10
mveGerry Schmitz30-Jul-20 8:10 
AnswerRe: Name Generator Pin
OriginalGriff30-Jul-20 8:55
mveOriginalGriff30-Jul-20 8:55 
QuestionExecuteScalar to cshtml view Pin
Member 1490312930-Jul-20 5:30
Member 1490312930-Jul-20 5:30 
AnswerRe: ExecuteScalar to cshtml view Pin
Gerry Schmitz30-Jul-20 8:02
mveGerry Schmitz30-Jul-20 8:02 
GeneralRe: ExecuteScalar to cshtml view Pin
Member 1490312930-Jul-20 11:42
Member 1490312930-Jul-20 11:42 
GeneralRe: ExecuteScalar to cshtml view Pin
Dave Kreskowiak30-Jul-20 12:47
mveDave Kreskowiak30-Jul-20 12:47 
GeneralRe: ExecuteScalar to cshtml view Pin
Member 1490312930-Jul-20 12:55
Member 1490312930-Jul-20 12:55 
GeneralRe: ExecuteScalar to cshtml view Pin
Dave Kreskowiak30-Jul-20 13:17
mveDave Kreskowiak30-Jul-20 13:17 
A Razor page can be returned by any number of methods in a controller, so long as every one of those methods understands that that page can only accept one particular type.

If you've got multiple methods that are sending data to a view page, each method is going to need it's own Razor page, each defining what type it's looking for to match the data passed to it.

You're not going to get away with a single Razor page handling all kinds of data types.

Now, if you're trying to get multiple controller methods to all send data to the same page being returned, only one method can send data to the Razor page (view).

To get multiple methods to generate data, the method that returns the View is going to have to call the other methods and get the data returned by each. It can then wrap all those pieces of data in a single class you'll have to write, and assemble all that data into a single instance of this container class, passing it to the View.

GeneralRe: ExecuteScalar to cshtml view Pin
Member 1490312930-Jul-20 13:26
Member 1490312930-Jul-20 13:26 
GeneralRe: ExecuteScalar to cshtml view Pin
Dave Kreskowiak30-Jul-20 17:10
mveDave Kreskowiak30-Jul-20 17:10 
GeneralRe: ExecuteScalar to cshtml view Pin
Gerry Schmitz31-Jul-20 7:40
mveGerry Schmitz31-Jul-20 7:40 
GeneralRe: ExecuteScalar to cshtml view Pin
Dave Kreskowiak31-Jul-20 7:54
mveDave Kreskowiak31-Jul-20 7:54 
GeneralRe: ExecuteScalar to cshtml view Pin
Gerry Schmitz31-Jul-20 12:58
mveGerry Schmitz31-Jul-20 12:58 
GeneralRe: ExecuteScalar to cshtml view Pin
Dave Kreskowiak31-Jul-20 14:01
mveDave Kreskowiak31-Jul-20 14:01 
SuggestionRe: ExecuteScalar to cshtml view Pin
Richard Deeming4-Aug-20 0:05
mveRichard Deeming4-Aug-20 0:05 
GeneralRe: ExecuteScalar to cshtml view Pin
Dave Kreskowiak4-Aug-20 4:01
mveDave Kreskowiak4-Aug-20 4:01 
QuestionHaving the image at the third second of a video Pin
Tec Zone30-Jul-20 6:11
Tec Zone30-Jul-20 6:11 
AnswerRe: Having the image at the third second of a video Pin
CHill6030-Jul-20 6:12
mveCHill6030-Jul-20 6:12 
AnswerRe: Having the image at the third second of a video Pin
jsc4230-Jul-20 6:25
professionaljsc4230-Jul-20 6:25 
AnswerRe: Having the image at the third second of a video Pin
Gerry Schmitz30-Jul-20 7:42
mveGerry Schmitz30-Jul-20 7:42 
QuestionHaving the image at the third second of a video Pin
Tec Zone30-Jul-20 6:11
Tec Zone30-Jul-20 6:11 
Questionanswer Pin
Member 1490198229-Jul-20 7:29
Member 1490198229-Jul-20 7:29 
AnswerRe: answer Pin
OriginalGriff29-Jul-20 7:45
mveOriginalGriff29-Jul-20 7:45 
AnswerRe: answer Pin
Gerry Schmitz29-Jul-20 10:01
mveGerry Schmitz29-Jul-20 10:01 
GeneralRe: answer Pin
OriginalGriff29-Jul-20 10:12
mveOriginalGriff29-Jul-20 10:12 

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.