Pulling the HTML From asp.net

Last post 09-19-2007, 4:31 AM by Sleb. 5 replies.
Sort Posts: Previous Next
  •  09-18-2007, 9:53 AM 33600

    Pulling the HTML From asp.net

    Hi there wonder if any one can help me?
     
    Basically, i want to detect when a user  has put a hyperlink, image, flash etc in and then if they have i want to add to the database that they have done this, sort of as an approval process.
     
    i have got it working for when a user doesnt insert image or video(s) etc that was.
     
    I thought it might be
    Editor1.Text.Contains("<href=") along the lines of this but it does not work im guessing due to the fact that the text doesnt contain the href but the HTML does.
     
    Any Suguestions would be great
     
    Thanks
     
    Matt
  •  09-18-2007, 12:23 PM 33604 in reply to 33600

    Re: Pulling the HTML From asp.net

    Matt,
     
    After you extract the editor from the editor, you need to use Regular Expression to detect the content.
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  09-19-2007, 3:24 AM 33613 in reply to 33604

    Re: Pulling the HTML From asp.net

    Hi There Thanks for the reply.
     
    Could you give me an example how to do this that would be great.
     
    Many Thanks
     
    Matt
  •  09-19-2007, 3:44 AM 33616 in reply to 33613

    Re: Pulling the HTML From asp.net

    Try this


            Dim URLMatch As Match = Regex.Match(Editor1.Text, "(?<http>(http:[/][/]|www.)([a-z]|[A-Z]|[0-9]|[/.]|Movie)*)")

            If URLMatch.Success = True Then

                Response.Write("found a url")
                'your code to make a db record here

            End If

    If the regular expression is not exactly what you need you'll find more on http://regexlib.com/

    Hope this help.

    Seb



  •  09-19-2007, 4:08 AM 33617 in reply to 33616

    Re: Pulling the HTML From asp.net

    Hi There Seb
     
    Thanks for you help that looks great shall try it out.
     
     
     just one thing what is the movie image stand for is the same as the msn one which is (~)
     
    Sorry

    Thanks for the help and the site
     
    Matt
  •  09-19-2007, 4:31 AM 33618 in reply to 33617

    Re: Pulling the HTML From asp.net

    You're welcome Matt

    The movie image should be [ ~ ] , without spaces obviously.

    I put  a post too, if you know the answer please help out.

    Thanks
View as RSS news feed in XML