pageValidate equivalent for ascx control?

Discussion in 'ASP .Net' started by howboutafresca@gmail.com, Dec 14, 2007.

  1. Guest

    I'm in a bit of a pickle. I'm dealing with a web portal that uses a
    single aspx file at the top, which dynamically loads ascx controls
    into it. On one of these controls I have a textbox that I'd like to
    enter html codes into.

    Problem-- every time I try submitting the page I get the warning
    message that I may be posting unsafe data. I'd like to set things so
    there is no validation from the ascx file. I cannot set the
    pageValidate attribute, because it's an ascx file I'm dealing with and
    I don't want to set that for what amounts to the entire portal.

    I'm using .Net 1.1. Is there a way to at least htmlencode my textbox
    before the page is submitted? I can't find a way around my quandry,
    and any help is appreciated!
    , Dec 14, 2007
    #1
    1. Advertising

  2. Hello ,

    could you post the exact error u get?

    I suppose it's because your html, which u are trying to insert is not encoded.
    I'd try to use HttpUtility.HtmlEncode to encode insterted text

    ---
    WBR,
    Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

    "The greatest danger for most of us is not that our aim is too high and we
    miss it, but that it is too low and we reach it" (c) Michelangelo


    > I'm in a bit of a pickle. I'm dealing with a web portal that uses a
    > single aspx file at the top, which dynamically loads ascx controls
    > into it. On one of these controls I have a textbox that I'd like to
    > enter html codes into.
    >
    > Problem-- every time I try submitting the page I get the warning
    > message that I may be posting unsafe data. I'd like to set things so
    > there is no validation from the ascx file. I cannot set the
    > pageValidate attribute, because it's an ascx file I'm dealing with and
    > I don't want to set that for what amounts to the entire portal.
    >
    > I'm using .Net 1.1. Is there a way to at least htmlencode my textbox
    > before the page is submitted? I can't find a way around my quandry,
    > and any help is appreciated!
    >
    Michael Nemtsev [MVP], Dec 15, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Quentin
    Replies:
    1
    Views:
    486
    Quentin
    Jul 29, 2003
  2. Jason Shohet
    Replies:
    1
    Views:
    482
    Kevin Spencer
    Nov 10, 2003
  3. Holger (David) Wagner
    Replies:
    2
    Views:
    1,940
    Holger (David) Wagner
    Jul 3, 2004
  4. Joe
    Replies:
    1
    Views:
    372
    Jeffrey Tan[MSFT]
    Feb 16, 2004
  5. Replies:
    2
    Views:
    536
Loading...

Share This Page