Object must implement IConvertible.

15 views
Skip to first unread message

Michael Foltz

unread,
Mar 7, 2007, 9:56:36 AM3/7/07
to castle-pro...@googlegroups.com
hey,

I've got a form that attempts to post a boolean value into an action param

-----------------------

 - form:

<form method="POST">
    <input type="text" name="ID" value="$ID" />
    <input type="hidden" name="confirmDelete" value="true" />
    <input type="submit" value="Delete" />
</form>

 - action:

public void DeleteArticle(int ID, bool confirmDelete)

-----------------------

after a bit of testing, I've determined that its a result of a failure to convert the string value "true" to a boolean.
i can change the param type to string, but I'm curious, what's the logic behind which element-types can be implicitly converted to a boolean type?

is there any documentation on this particular issue?

Jonathon Rossi

unread,
Mar 7, 2007, 10:05:34 AM3/7/07
to castle-pro...@googlegroups.com

My understanding is that CGI\Form Posts never know what the element types are they just have name and value pairs like a querystring; so this might be a bug. Have you tried using “1” instead of “true” to see if that works?

 

Regards, Jonathon Rossi


Michael Foltz

unread,
Mar 7, 2007, 10:03:42 AM3/7/07
to castle-pro...@googlegroups.com
er.  scratch that.  problem was a result of both a querystring value & form-post value
Reply all
Reply to author
Forward
0 new messages