Microsoft Content Management Server - MondoSearch template unable to validate data message

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > April 2006 > MondoSearch template unable to validate data message





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author MondoSearch template unable to validate data message
Randel

2006-04-18, 12:47 am


I am working on implementing the .net templates created by MondoSearch
into our MCMS environment.

I've added the results.aspx code to my template file and have published
to the live site.

Stand-alone the posting works great. I attempted to incoporate a
search
box on each page. It is a txt field named "Query" which when submitted
submits the form to my posting location.

I am getting the following error in the browser:

Server Error in '/OKDHS' Application.
------------------------------------------------------------------------
--------

Unable to validate data.
Description: An unhandled exception occurred during the execution of
the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

What does this error mean? Can you give me suggestions on how to
troubleshoot this?

Thanks in advance! Randel

Stefan [MSFT]

2006-04-18, 12:47 am

Hi Randel,

how are you doing the post to the other page?
ASP.NET 1.1 only support postback to the same page.
To postback to a different page you would need to use GET requests and query
strings - or you would need to remove the viewstate variable.

With ASP.NET 2.0 you would need to use a special property to do cross-page
postback.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------


"Randel" <randel.mckee@okdhs.org> wrote in message
news:1144766928.261683.102280@e56g2000cwe.googlegroups.com...
>
> I am working on implementing the .net templates created by MondoSearch
> into our MCMS environment.
>
> I've added the results.aspx code to my template file and have published
> to the live site.
>
> Stand-alone the posting works great. I attempted to incoporate a
> search
> box on each page. It is a txt field named "Query" which when submitted
> submits the form to my posting location.
>
> I am getting the following error in the browser:
>
> Server Error in '/OKDHS' Application.
> ------------------------------------------------------------------------
> --------
>
> Unable to validate data.
> Description: An unhandled exception occurred during the execution of
> the
> current web request. Please review the stack trace for more information
> about the error and where it originated in the code.
>
> What does this error mean? Can you give me suggestions on how to
> troubleshoot this?
>
> Thanks in advance! Randel
>



Randel

2006-04-18, 12:47 am

Hi Stefan,
Before we installed MondoSearch, I built a simple user control that
submitted the page to a web page outside of MCMS. Just a form submit
(code below).

---start code--
<script>
<!--
//This function is called on keypressup from the text input field.
//If [ENTER] is detected, the go_search fucntion is called.
function checkKey()
{
if (window.event.keyCode == 13)
{
go_search();
}
}

//this function first calls the trim function to take off
leading/trailing
//spaces. If data is left in the text field, the form action is
changed to
//point to okdhs search and form is submitted.
function go_search()
{
document.Form1.Query.value = Trim(document.Form1.Query.value);
if (document.Form1.Query.value != "")
{
document.Form1.action='/en/search/searchOKDHS';
document.Form1.submit();
}
}
function Trim(TRIM_VALUE)
{
if(TRIM_VALUE.length < 1)
{
return "";
}
TRIM_VALUE = RTrim(TRIM_VALUE);
TRIM_VALUE = LTrim(TRIM_VALUE);
if(TRIM_VALUE=="")
{
return "";
}
else
{
return TRIM_VALUE;
}
} //End Function

function RTrim(VALUE)
{
var w_space = String.fromCharCode(32);
var v_length = VALUE.length;
var strTemp = "";
if(v_length < 0)
{
return "";
}
var iTemp = v_length -1;

while(iTemp > -1)
{
if(VALUE.charAt(iTemp) == w_space)
{
}
else
{
strTemp = VALUE.substring(0,iTemp +1);
break;
}
iTemp = iTemp-1;
} //End While
return strTemp;

} //End Function

function LTrim(VALUE)
{
var w_space = String.fromCharCode(32);
if(v_length < 1)
{
return "";
}
var v_length = VALUE.length;
var strTemp = "";

var iTemp = 0;

while(iTemp < v_length)
{
if(VALUE.charAt(iTemp) == w_space)
{
}
else
{
strTemp = VALUE.substring(iTemp,v_length);
break;
}
iTemp = iTemp + 1;
} //End While
return strTemp;
} //End Function

// -->
</script>
&nbsp;
<input type="text" name="Query" onkeyup="checkKey()" id="Query"
size="11" alt="Type search information in this field." value=""
style="WIDTH: 101px; HEIGHT: 20px">
<input type="button" onclick="go_search()" value="Go" name="gotoform"
alt="Click this button to perform the search function." style="WIDTH:
27px; HEIGHT: 20px">
----end code

We're running 1.1. It sounds as if removing the viewstate variable
might be a simpler solution. How do you accomplish this? Also, would
this impact my other postings in some way?

Which of the two would you recommend pursuing?

thanks. Randy

Randel

2006-04-18, 12:47 am

How do I disable viewstate? thanks.

Stefan [MSFT]

2006-04-18, 12:47 am

Hi Randel,

this code should not work with ASP.NET webforms as destination.
To disable the viewstate you need to inject client side code that removes
the __VIEWSTATE form field.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------


"Randel" <randel.mckee@okdhs.org> wrote in message
news:1144774355.039233.52230@i39g2000cwa.googlegroups.com...
> Hi Stefan,
> Before we installed MondoSearch, I built a simple user control that
> submitted the page to a web page outside of MCMS. Just a form submit
> (code below).
>
> ---start code--
> <script>
> <!--
> //This function is called on keypressup from the text input field.
> //If [ENTER] is detected, the go_search fucntion is called.
> function checkKey()
> {
> if (window.event.keyCode == 13)
> {
> go_search();
> }
> }
>
> //this function first calls the trim function to take off
> leading/trailing
> //spaces. If data is left in the text field, the form action is
> changed to
> //point to okdhs search and form is submitted.
> function go_search()
> {
> document.Form1.Query.value = Trim(document.Form1.Query.value);
> if (document.Form1.Query.value != "")
> {
> document.Form1.action='/en/search/searchOKDHS';
> document.Form1.submit();
> }
> }
> function Trim(TRIM_VALUE)
> {
> if(TRIM_VALUE.length < 1)
> {
> return "";
> }
> TRIM_VALUE = RTrim(TRIM_VALUE);
> TRIM_VALUE = LTrim(TRIM_VALUE);
> if(TRIM_VALUE=="")
> {
> return "";
> }
> else
> {
> return TRIM_VALUE;
> }
> } //End Function
>
> function RTrim(VALUE)
> {
> var w_space = String.fromCharCode(32);
> var v_length = VALUE.length;
> var strTemp = "";
> if(v_length < 0)
> {
> return "";
> }
> var iTemp = v_length -1;
>
> while(iTemp > -1)
> {
> if(VALUE.charAt(iTemp) == w_space)
> {
> }
> else
> {
> strTemp = VALUE.substring(0,iTemp +1);
> break;
> }
> iTemp = iTemp-1;
> } //End While
> return strTemp;
>
> } //End Function
>
> function LTrim(VALUE)
> {
> var w_space = String.fromCharCode(32);
> if(v_length < 1)
> {
> return "";
> }
> var v_length = VALUE.length;
> var strTemp = "";
>
> var iTemp = 0;
>
> while(iTemp < v_length)
> {
> if(VALUE.charAt(iTemp) == w_space)
> {
> }
> else
> {
> strTemp = VALUE.substring(iTemp,v_length);
> break;
> }
> iTemp = iTemp + 1;
> } //End While
> return strTemp;
> } //End Function
>
> // -->
> </script>
> &nbsp;
> <input type="text" name="Query" onkeyup="checkKey()" id="Query"
> size="11" alt="Type search information in this field." value=""
> style="WIDTH: 101px; HEIGHT: 20px">
> <input type="button" onclick="go_search()" value="Go" name="gotoform"
> alt="Click this button to perform the search function." style="WIDTH:
> 27px; HEIGHT: 20px">
> ----end code
>
> We're running 1.1. It sounds as if removing the viewstate variable
> might be a simpler solution. How do you accomplish this? Also, would
> this impact my other postings in some way?
>
> Which of the two would you recommend pursuing?
>
> thanks. Randy
>



Stefan [MSFT]

2006-04-18, 12:47 am

Hi Randel,

something like this javascript code:

document.forms[0].__VIEWSTATE.outerHTML = "";

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------


"Randel" <randel.mckee@okdhs.org> wrote in message
news:1144782255.584862.88020@v46g2000cwv.googlegroups.com...
> How do I disable viewstate? thanks.
>



Randel

2006-04-18, 12:47 am

thanks.

I added this code to my javascript function on the submitting page and
the error disappears on the results page. Unfortunately, my results
page doesn't seem to find any value for Request.Form("Query") that I
submitted.

I believe that I need to rethink my approach to this.

Can you point me to an example of how to submit a form value from one
posting to a different posting?

Thanks in advance. Randel

Stefan [MSFT]

2006-04-18, 12:47 am

Hi Randell,

I would suggest to use GET requests and query string parameters.
Or to upgrade to ASP.NET 2.0 and use the build-in cross-postback features of
2.0.

Cheers,
Stefan

--
This posting is provided "AS IS" with no warranties, and confers no rights

New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------


"Randel" <randel.mckee@okdhs.org> wrote in message
news:1144849136.573577.167830@u72g2000cwu.googlegroups.com...
> thanks.
>
> I added this code to my javascript function on the submitting page and
> the error disappears on the results page. Unfortunately, my results
> page doesn't seem to find any value for Request.Form("Query") that I
> submitted.
>
> I believe that I need to rethink my approach to this.
>
> Can you point me to an example of how to submit a form value from one
> posting to a different posting?
>
> Thanks in advance. Randel
>



J Foreman

2006-04-18, 12:47 am

Hey there, try this:

1. Code behind for the click event of the search submit button:

--> Response.Redirect("http://mywebsite.com/Search/Results.aspx?Query=" &
Server.HtmlEncode(Query.Value))

OR

--> Response.Redirect("http://mywebsite.com/Search/Results.aspx?Query=" &
Server.HtmlEncode(Query.Text))

2. HTML code for Results.aspx page:

--> <MondoSearch:SearchOption Enabled="True" Value="<%# QueryBox.Text %>"
Name="SearchQuery" RequestParameter="Query" />

Let me know if this helps.

J Foreman


"Randel" wrote:

>
> I am working on implementing the .net templates created by MondoSearch
> into our MCMS environment.
>
> I've added the results.aspx code to my template file and have published
> to the live site.
>
> Stand-alone the posting works great. I attempted to incoporate a
> search
> box on each page. It is a txt field named "Query" which when submitted
> submits the form to my posting location.
>
> I am getting the following error in the browser:
>
> Server Error in '/OKDHS' Application.
> ------------------------------------------------------------------------
> --------
>
> Unable to validate data.
> Description: An unhandled exception occurred during the execution of
> the
> current web request. Please review the stack trace for more information
> about the error and where it originated in the code.
>
> What does this error mean? Can you give me suggestions on how to
> troubleshoot this?
>
> Thanks in advance! Randel
>
>

Thomas Fritzen

2006-04-27, 7:27 am

I would recommend that you change the MondoSearch page to a user control
(ascx) and place it on an "empty" MCMS templates.
This is basically a rename and change "@page" to "@user control"
This way you keep the MCMS structure, by having a template with the normal
look and feel, without getting the Postback issues.
This is an approach used by many. Thi scan be combined with the Suggestions
made
by J foreman.
Rgds,
Thomas Fritzen
Mondosoft.com


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com