Saturday, March 31, 2012

String was not recognized as a valid Boolean

We're receiving the following error: "String was not recognized as a valid Boolean" whenever we click button1 then immediately click button2 before allowing the entire page to completely refresh/render. Under normal transaction (not clicking multiple buttons all at the same time), we don't encounter such error

1) Populate hidden fields with string values of "true" or "false
2) Upon post back, convert values of hidden fields into boolea

Highlevel logic of our page that triggers the error.We suspect that clicking 2 buttons almost at the same time fails to properly populate the hidden fields as described in step 1 above. Any ideas on how to gracefully handle the "clicking too fast" scenario? Would appreaciate your suggestions

Thanks
LesterOne thing that comes to mind is handling your button clicks with a client
side script. In your script, first disable the buttons which shouldn't be
pushed without a full round trip, collect and convert your data, and then
submit the form.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Lester Lee" <anonymous@.discussions.microsoft.com> wrote in message
news:45A10F5F-6C2A-4C4B-810C-9F20C298B68D@.microsoft.com...
> We're receiving the following error: "String was not recognized as a valid
> Boolean" whenever we click button1 then immediately click button2 before
> allowing the entire page to completely refresh/render. Under normal
> transaction (not clicking multiple buttons all at the same time), we don't
> encounter such error.
> 1) Populate hidden fields with string values of "true" or "false"
> 2) Upon post back, convert values of hidden fields into boolean
>
> Highlevel logic of our page that triggers the error.We suspect that
> clicking 2 buttons almost at the same time fails to properly populate the
> hidden fields as described in step 1 above. Any ideas on how to gracefully
> handle the "clicking too fast" scenario? Would appreaciate your
> suggestions.
> Thanks!
> Lester
I noticed your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Lester Lee" <anonymous@.discussions.microsoft.com> wrote in message
news:45A10F5F-6C2A-4C4B-810C-9F20C298B68D@.microsoft.com...
> We're receiving the following error: "String was not recognized as a valid
Boolean" whenever we click button1 then immediately click button2 before
allowing the entire page to completely refresh/render. Under normal
transaction (not clicking multiple buttons all at the same time), we don't
encounter such error.
> 1) Populate hidden fields with string values of "true" or "false"
> 2) Upon post back, convert values of hidden fields into boolean
>
> Highlevel logic of our page that triggers the error.We suspect that
clicking 2 buttons almost at the same time fails to properly populate the
hidden fields as described in step 1 above. Any ideas on how to gracefully
handle the "clicking too fast" scenario? Would appreaciate your suggestions.
> Thanks!
> Lester
How about a simple js on both buttons which disables the other button.

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:%23Zpqv4s6DHA.3052@.TK2MSFTNGP09.phx.gbl...
> I noticed your post went unanswered. Have you resolved this issue?
> --
> Regards,
> Alvin Bruney [ASP.NET MVP]
> Got tidbits? Get it here...
> http://tinyurl.com/3he3b
> "Lester Lee" <anonymous@.discussions.microsoft.com> wrote in message
> news:45A10F5F-6C2A-4C4B-810C-9F20C298B68D@.microsoft.com...
> > We're receiving the following error: "String was not recognized as a
valid
> Boolean" whenever we click button1 then immediately click button2 before
> allowing the entire page to completely refresh/render. Under normal
> transaction (not clicking multiple buttons all at the same time), we don't
> encounter such error.
> > 1) Populate hidden fields with string values of "true" or "false"
> > 2) Upon post back, convert values of hidden fields into boolean
> > Highlevel logic of our page that triggers the error.We suspect that
> clicking 2 buttons almost at the same time fails to properly populate the
> hidden fields as described in step 1 above. Any ideas on how to gracefully
> handle the "clicking too fast" scenario? Would appreaciate your
suggestions.
> > Thanks!
> > Lester

0 comments:

Post a Comment