This topic is locked
[SOLVED]

Pre populating fields in a new record from the query string.

4/14/2021 2:19:06 PM
ASPRunner.NET General questions
A
Alan Coleman author

Hello everyone,

Is it possible to pre populate a field, a drop down menu in this example, on a new record from the query string?

Many thanks

img alt

admin 4/14/2021

Moved this question to ASPRunner.NET category.

You can use System.Web.HttpContext.Current.Request.QueryString["parameter name here"] as a default value of one of fields.

A
Alan Coleman author 4/14/2021

Thanks very much for your help, and apologies for postsing to the wrong group, I always forget that we upgraded to the .NET Version.

I'm adding the HttpContext string to the edit lookup wizard like this...

img alt

However on build the following is entered into the log after a not succeed message.

Thanks again for helping out.

\\ cms.csproj
Microsoft (R) Build Engine version 4.8.3761.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.

\\ cmsEventsCS.csproj
Microsoft (R) Build Engine version 4.8.3761.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.

include\CustomExpressions.cs(84,18): error CS0103: The name 'HttpContext' does not exist in the current context [H:\cms\asprunnernet\fbt_cms\cms\output\cmsEventsCS.csproj]
admin 4/14/2021

It needs a fully qualified class name, I've updated my reply.

A
Alan Coleman author 4/15/2021

Thanks very much for your help, as always!