Honored Contributor.. Honored Contributor..
Honored Contributor..

state information is invalid for this page or might be corrupted


Hope you are doing fine.

I am facing an error while replying the script in vugen "state information is invalid for this page or might be corrupted" how can i solve that issue? basically its asp.net website which is throwing that error. looking for help.

Best Regards

2 Replies
Honored Contributor.. Honored Contributor..
Honored Contributor..


Kindly tell me how I can decode following lines. As I am having %2F %24 etc in my script. I want to replace %24 with $ according to book.


and after decoding how can i correlate that decoded value?

Best Regards

Respected Contributor.
Respected Contributor.

Hi Mike,

Please follow below steps:

Step 1: First complete the correlation and store the value. Eg. Assume if we are storing the values in c_CorrelationValue.
Step2 : In Action, put below code.

lr_save_string(lr_eval_string("{c_CorrelationValue}"), "Mypar");

// Replace the %20 characters with $
//Here lr_replace is custom function
lr_replace("MyPar", "$", "%20" );

// Output new result
lr_output_message("%s", lr_eval_string("{MyPar}"));

//lr_replace function code here!

//Note: ******Copy and paste in global.h
//*** Replace function code**

char *strReplace(const char *src, const char *from, const char *to)
char *value;
char *dst;
char *match;
int size;
int fromlen;
int tolen;

// Find out the lengths of the source string, text to replace, and
// the replacement text.
size = strlen(src) + 1;
fromlen = strlen(from);
tolen = strlen(to);

// Allocate the first chunk with enough for the original string.
value = (char *)malloc(size);

// We need to return 'value', so let's make a copy to mess around with.
dst = value;

// Before we begin, let's see if malloc was successful.
if ( value != NULL )
// Loop until no matches are found.
for ( ;; )
// Try to find the search text.
match = (char *) strstr(src, from);
if ( match != NULL )
// Found search text at location 'match'.
// Find out how many characters to copy up to the 'match'.
size_t count = match - src;

// We are going to realloc, and for that we will need a
// temporary pointer for safe usage.
char *temp;

// Calculate the total size the string will be after the
// replacement is performed.
size += tolen - fromlen;

// Attempt to realloc memory for the new size.
// temp = realloc(value, size);
temp = (char *)realloc(value, size);

if ( temp == NULL )
// Attempt to realloc failed. Free the previously malloc'd
// memory and return with our tail between our legs.
return NULL;

dst = temp + (dst - value);
value = temp;

memmove(dst, src, count);
src += count;
dst += count;

memmove(dst, to, tolen);
src += fromlen;
dst += tolen;
else // No match found.
// termination character.
strcpy(dst, src);
} // For Loop()
return value;

int lr_replace( const char *lrparam, char *findstr, char *replacestr )
int res = 0;
char *result_str;
char lrp[1024];

// Finalize the LR Param Name
sprintf( lrp, "{%s}", lrparam);

// Do the Search and Replace
result_str = strReplace( lr_eval_string(lrp), findstr, replacestr );

// Process results
if (result_str != NULL )
lr_save_string( result_str, lrparam );
free( result_str );
res = 1;
return res;


Sakthirajan Kathirvel
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.