SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Enthusiast Spartan4085's Avatar
    Join Date
    Oct 2012
    Location
    Michigan, USA
    Posts
    32
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question @RenderPage() If Div is Empty

    I want to render a page using @RenderPage() if a specific div is empty (excluding whitespace). However, I don't know how to go upon doing this.
    I tried doing this:
    Code:
    @if (Request["#divid"].IsEmpty()){
       @RenderPage("pagepath.cshtml")
    }
    I thought maybe this might work like when requesting the the content of an input tag using the 'name' attribute, but it doesn't.

    If this would be better to do in Javascript then point me in the right direction.

    Thanks. (Also, sorry if this is in the wrong forum, I thought since I'm using C# this might belong here.)

  2. #2
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,652
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    I don't think you can make @RenderPage directives conditional but you might be able to do that for @RenderSection().


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •