This topic is locked
[SOLVED]

 Which page am I on?

4/5/2019 8:55:18 AM
ASPRunner.NET General questions
T
Tim author

Hi all,
In version 10.1 I have created 2 edit pages and now I want to run different event code depending on which page loads. The event I'm using is Before record updated. So something like:
if (GET_PAGE_NAME == "edit1")

{

Do stuff

}

else

{

Do other stuff

}
How do I get the page name? Or maybe there's a different way to run different code for different edit pages of the same table?
Thanks,

Tim

M
Mack88DevClub member 4/8/2019

Hi Tim,
I'm not sure if this blog item will help ... Additional Pages
Cheers,
Chris

admin 4/8/2019

Read "page" parameter from the URL as HttpContext.Current.Request.QueryString["page"].ToString()
i.e.

if (HttpContext.Current.Request.QueryString["page"].ToString() == "edit1")

{

Do stuff

}

else

{

Do other stuff

}
T
Tim author 4/9/2019

Thank you both! Chris, based on your link (not sure how I missed that blog post) I was able to see that this is just a post value, so I came up with:
if (MVCFunctions.postvalue("page")=="edit1")

{

Do stuff

}

else

{

Do other stuff

}
Which seems to work fine.
Admin, your solution seems to be the same approach but uses standard ASP.Net code instead of the ASPRunner function...? Maybe this is a better way to go.
Either way, now that I'm getting familiar with adding multiple pages in version 10, this seems like a trick I'm going to want to use often.
Thanks again.

Tim

C
Corrie 4/20/2019

You might be able to use $_GET["page"]
IF(IsSet($_GET["page"]))

{

if ($_GET["page"] == "edit1")

{

Do stuff

}

else

{

Do other stuff

}

}
Also check out my channel: https://www.youtube.com/channel/UCGly4nw_dkdHhdjTuto6urg



Hi all,
In version 10.1 I have created 2 edit pages and now I want to run different event code depending on which page loads. The event I'm using is Before record updated. So something like:
if (GET_PAGE_NAME == "edit1")

{

Do stuff

}

else

{

Do other stuff

}
How do I get the page name? Or maybe there's a different way to run different code for different edit pages of the same table?
Thanks,

Tim