0

This is not a pretty application by any stretch. It's only meant for a select few to use in the office and does not require street appeal. With that said...

I have a gridview with the following template column:

    <asp:TemplateField HeaderStyle-HorizontalAlign="Left">
<ItemTemplate>
<asp:Label ID="lblAction" runat="server" Text='<%#(Eval("Action"))%>' 
                ToolTip="Action to be Taken"></asp:Label>
       </ItemTemplate>
       <EditItemTemplate>
        <asp:TextBox ID="txtAction" runat="server" 
                TextMode="MultiLine" Width="450px" Height="100px" ValidationGroup="UpdateFU"
                     Text='<%#Eval("Action")%>'
                     CssClass="RequiredText" ToolTip="Follow-Up Action">
              </asp:TextBox>
              <asp:RequiredFieldValidator ID="rfv_txtAction" runat="server" 
                ControlToValidate="txtAction" ErrorMessage="FollowUp Action is Required" 
                     Text="*" ValidationGroup="UpdateFU">
              </asp:RequiredFieldValidator>
</EditItemTemplate>
<FooterTemplate>
    <asp:TextBox ID="txtAction" runat="server" 
TextMode="MultiLine" Width="250px" 
ValidationGroup="UpdateFU"
CssClass="RequiredText"
ToolTip="Follow-Up Action">
</asp:TextBox>
<asp:RequiredFieldValidator ID="rfv_txtAction" runat="server" 
ControlToValidate="txtAction" ErrorMessage="FollowUp Action is Required" 
Text="*" ValidationGroup="AddFU">
</asp:RequiredFieldValidator>
</FooterTemplate>
</asp:TemplateField>

For the example that is causing me trouble, the data in the field that is bound to this column is: **Testing with a link. <a href="http://www.google.com">Google</a>**

The label in the ItemTemplate displays as I expect it to. The regular text is not hyperlinked and the hyperlink text is. Please see the included image: ItemTemplate

When my row is in Edit mode, it also displays in the TextBox as I would suspect. Please see the included image: EditItemTemplate

When I attempt to Save or Cancel the record, the gridview does not recognize that the command button was clicked. It just sits there. If I remove the text that references the tag (leaving from my example, **Testing with a link.**), it works beautifully. The only problem being that I can't save any text in the textbox with my link.

Any help is greatly appreciated.

Jay
  • 33
  • 3

1 Answers1

0

I think you are using UpdatePanel around your GridView. That is why you are missing exceptions if you are not checking the browser console. And that exception could very well be A potentially dangerous Request.Form value was detected from the client

Fixes for that here

A potentially dangerous Request.Form value was detected from the client

A potentially dangerous Request.Form value was detected from the client

https://www.codeproject.com/Tips/297679/A-potentially-dangerous-Request-Form-value-was-det

https://www.aspsnippets.com/Articles/ASPNet-Error-A-potentially-dangerous-RequestForm-value-was-detected-from-the-client.aspx

VDWWD
  • 35,079
  • 22
  • 62
  • 79
  • Thanks so much for the input. I found that the solution from your first link worked beautifully. I added validateRequest="false" in my page directive. Based on a little extra research and the fact that this is a very small intranet only application, this change will not adversely affect anything else. Thanks again! – Jay Nov 08 '17 at 15:55