M
msch-prv
I have a gridview with an icon. Clicking on the icon via the OnCommand
event causes a pop up form to appear. This however generates an
'Invalid postback or callback argument' at run time.
To disable the error message, I set EnableEventValidation="false" in
the page directive. However, because I am concerned by possible
injection attacks, I don't like the idea of having to disable this
feature on the whole page.
Question: How can I suspend validation for this control? I looked up K.
Scott Allen's article
http://odetocode.com/Blogs/scott/archive/2006/03/20/3145.aspx. Being a
newbie, I am really reluctant to dig into ASP's advanced design
spheres. Is there a simpler approach? Would removing the
CausesValidation="False" statement in a tag carry out control
validation despite the page directive?
TIA for any hints, Mark
Template code:
<ItemTemplate>
<asp:ImageButton ID="ImageButton1" runat="server"
CausesValidation="False"
CommandArgument='<%# Bind("ActID")%>'
ImageUrl="~/icons/icon_edit.gif" OnCommand="ImageButton1_Command" />
</ItemTemplate>
event causes a pop up form to appear. This however generates an
'Invalid postback or callback argument' at run time.
To disable the error message, I set EnableEventValidation="false" in
the page directive. However, because I am concerned by possible
injection attacks, I don't like the idea of having to disable this
feature on the whole page.
Question: How can I suspend validation for this control? I looked up K.
Scott Allen's article
http://odetocode.com/Blogs/scott/archive/2006/03/20/3145.aspx. Being a
newbie, I am really reluctant to dig into ASP's advanced design
spheres. Is there a simpler approach? Would removing the
CausesValidation="False" statement in a tag carry out control
validation despite the page directive?
TIA for any hints, Mark
Template code:
<ItemTemplate>
<asp:ImageButton ID="ImageButton1" runat="server"
CausesValidation="False"
CommandArgument='<%# Bind("ActID")%>'
ImageUrl="~/icons/icon_edit.gif" OnCommand="ImageButton1_Command" />
</ItemTemplate>