MondoSearch template unable to validate data message
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Content Management Server > MondoSearch template unable to validate data message




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    MondoSearch template unable to validate data message  
Randel


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-18-06 05: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






[ Post a follow-up to this message ]



    Re: MondoSearch template unable to validate data message  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-18-06 05: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
>







[ Post a follow-up to this message ]



    Re: MondoSearch template unable to validate data message  
Randel


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-18-06 05: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






[ Post a follow-up to this message ]



    Re: MondoSearch template unable to validate data message  
Randel


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-18-06 05:47 AM

How do I disable viewstate?  thanks.






[ Post a follow-up to this message ]



    Re: MondoSearch template unable to validate data message  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-18-06 05: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
>







[ Post a follow-up to this message ]



    Re: MondoSearch template unable to validate data message  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-18-06 05: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.
>







[ Post a follow-up to this message ]



    Re: MondoSearch template unable to validate data message  
Randel


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-18-06 05: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






[ Post a follow-up to this message ]



    Re: MondoSearch template unable to validate data message  
Stefan [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-18-06 05: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
>







[ Post a follow-up to this message ]



    RE: MondoSearch template unable to validate data message  
J Foreman


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-18-06 05: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
>
>





[ Post a follow-up to this message ]



    Re: MondoSearch template unable to validate data message  
Thomas Fritzen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-27-06 12:27 PM

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







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:31 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register