Copied to clipboard

Flag this post as spam?

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


  • suzyb 464 posts 877 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 5908 posts 22603 karma points MVP 4x admin c-trib
    Jun 12, 2012 @ 16:24
    Alex Skrypnyk
    0

    Hi,

    Try to use @ViewBag

  • suzyb 464 posts 877 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.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies