This topic is locked
[SOLVED]

 pass parameter in URL and use as default value on add page

11/4/2014 2:35:36 PM
ASPRunner.NET General questions
T
Tim author

In ASPR Pro I used to pass parameters to "Add" pages to set defaults for fields. I would create a query like this:
select

'table2_add.asp?pass=' + ID as AddLink

from Table1
On the list page of table1 I would make that field a hyperlink.
And then on the "Add" page of table2 I could set the default value of some field to "Request.QueryString("pass")".
How can I do this in ASPR .Net? Obviously I can setup the link via the select statement the same, but when I add "Request.QueryString["pass"]" as the default value of a field I get a compile error saying "The name 'Request' does not exist in the current context".
I have also tried putting it in a session variable like so:
Add page: Before process

XSession.Session["Type"] = Request.QueryString["type"];
and then using the session variable as the default value, but I get the same error.
From the help file it looks like maybe I can only access "request" data on list pages in BeforeProcessList. Is this true?
Thanks,

Tim

T
Tim author 11/10/2014

Any help with this one? Does the question make sense?
Thanks,

Tim

T
Tim author 11/10/2014

Never mind, I figured it out. To access request query string info use MVCFunctions.postvalue("whatever"). This can be the default value of a field on an Add page.
I gleaned this info while reading about the trick to turn on debug mode by adding code to the "After application initialized" event and then altering the URL, which is a great trick, by the way.
Thanks,

Tim