Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • suzyb 474 posts 932 karma points
    Jun 12, 2012 @ 10:50
    suzyb
    0

    passing parameters between scripts

    I am trying to pass a parameter from one script to another but it doens't seemt to be working.  This is my test code. In one script I just have this line

    @{
      Page.IsPPC = "xyz";
    }

    And the other script is

    @{
      @RenderPage("IsPPC.cshtml")
      
      
      <h1>@Page.IsPPC</h1>
    }

    When I include the second script in my template I don't get any output.  I have read this article and assume using Page will still work even though I am passing from the inner script to the outer one and not the other way the article shows.

    Is this not the case.  If not how can I pass a variable from a script to the script that called it.

  • Alex Skrypnyk 6147 posts 24056 karma points MVP 8x admin c-trib
    Jun 12, 2012 @ 16:24
    Alex Skrypnyk
    0

    Hi,

    Try to use @ViewBag

  • suzyb 474 posts 932 karma points
    Jun 19, 2012 @ 11:34
    suzyb
    0

    Been a while since I got back working on this.  That gives me a The name 'ViewBag' does not exist in the current context error.

Please Sign in or register to post replies

Write your reply to:

Draft