c# asp.net controls single quote and dashes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • karenRoss
    New Member
    • Jun 2007
    • 27

    c# asp.net controls single quote and dashes

    I have a search form on a .aspx page. On the same page I have a ASP SQL Data Source control and a repeater control. The only code behind is there to show and hide certain objects on the page. The page is PostBack for results.

    When people enter a single quote( ' ) or a dash( - ) into the search form it explodes (figuratively). I tried putting on "On_Click" code behind, however, since the ASP.Net SQL Data control seems to bypass my code behind page and gather data from the search form controls anyway. I do not want to change the stored procedure because I'm not sure who/what all uses it.

    How can I handle ( ' ) and ( - ) in my search form? Any ideas?
  • giveDsolution
    New Member
    • May 2007
    • 107

    #2
    Originally posted by karenRoss
    I have a search form on a .aspx page. On the same page I have a ASP SQL Data Source control and a repeater control. The only code behind is there to show and hide certain objects on the page. The page is PostBack for results.

    When people enter a single quote( ' ) or a dash( - ) into the search form it explodes (figuratively). I tried putting on "On_Click" code behind, however, since the ASP.Net SQL Data control seems to bypass my code behind page and gather data from the search form controls anyway. I do not want to change the stored procedure because I'm not sure who/what all uses it.

    How can I handle ( ' ) and ( - ) in my search form? Any ideas?

    Give the javascript validation for ( ' ) and ( - ) in ur page

    Comment

    • karenRoss
      New Member
      • Jun 2007
      • 27

      #3
      Originally posted by giveDsolution
      Give the javascript validation for ( ' ) and ( - ) in ur page
      I should probably post a new better version of this question.

      Comment

      Working...