Click here to Skip to main content
15,890,336 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Dependency hell Pin
Bernhard Hiller23-Oct-13 20:38
Bernhard Hiller23-Oct-13 20:38 
AnswerRe: Dependency hell Pin
Abhinav S23-Oct-13 22:16
Abhinav S23-Oct-13 22:16 
QuestionGetting the *.aspx working on a server Pin
juno10123-Oct-13 11:26
juno10123-Oct-13 11:26 
AnswerRe: Getting the *.aspx working on a server Pin
Sanjay Kumar Dwivedi24-Oct-13 1:16
professionalSanjay Kumar Dwivedi24-Oct-13 1:16 
QuestionRe: Getting the *.aspx working on a server Pin
juno10124-Oct-13 4:53
juno10124-Oct-13 4:53 
QuestionHow to reset application state or recall Application_Start Pin
swapnil709023-Oct-13 0:31
swapnil709023-Oct-13 0:31 
QuestionConvert text into hyperlinkable email dynamically Pin
Member 1045459222-Oct-13 8:10
professionalMember 1045459222-Oct-13 8:10 
AnswerRe: Convert text into hyperlinkable email dynamically Pin
Richard Deeming22-Oct-13 9:15
mveRichard Deeming22-Oct-13 9:15 
I think I originally saw this on CodeProject some years ago, but I can't remember where:
C#
public static string AutoLink(string text)
{
    return AutoLinkRegex.Replace(text, match =>
    {
        string link = match.Value;

        // Remove trailing periods:
        int length = link.Length;
        int index = length;
        while (index > 0 && link[index - 1] == '.')
        {
            index--;
        }
        if (index != length)
        {
            link = link.Substring(0, index);
        }

        if (link.StartsWith("www.", StringComparison.OrdinalIgnoreCase))
        {
            return "<a href=\"http://" + link + "\">" + link + "</a>";
        }
        if (link.StartsWith("ftp.", StringComparison.OrdinalIgnoreCase))
        {
            return "<a href=\"ftp://" + link + "\">" + link + "</a>";
        }

        string protocol = match.Groups[1].Value;
        if (!string.IsNullOrEmpty(protocol) && protocol[protocol.Length - 1] == '@')
        {
            return "<a href=\"mailto:" + link + "\">" + link + "</a>";
        }

        return "<a href=\"" + link + "\">" + link + "</a>";
    });
}

private static readonly Regex AutoLinkRegex = new Regex(
    @"\b((http://|https://|ftp://|mailto:|news:)|www\.|ftp\.|[^ \,\;\:\!\)\(\""\'\<\>\f\n\r\t\v]+@)([^ \,\;\:\!\)\(\""\'\<\>\f\n\r\t\v]+)",
    RegexOptions.IgnoreCase | RegexOptions.Singleline);




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Convert text into hyperlinkable email dynamically Pin
Member 1045459222-Oct-13 9:55
professionalMember 1045459222-Oct-13 9:55 
GeneralRe: Convert text into hyperlinkable email dynamically Pin
Richard Deeming22-Oct-13 11:01
mveRichard Deeming22-Oct-13 11:01 
Questionsession related problem Pin
Member 1028388122-Oct-13 7:03
professionalMember 1028388122-Oct-13 7:03 
QuestionGridView binding Image Not working Pin
Member 1045459222-Oct-13 3:14
professionalMember 1045459222-Oct-13 3:14 
AnswerRe: GridView binding Image Not working Pin
Richard Deeming22-Oct-13 3:40
mveRichard Deeming22-Oct-13 3:40 
GeneralRe: GridView binding Image Not working Pin
Member 1045459222-Oct-13 8:01
professionalMember 1045459222-Oct-13 8:01 
QuestionUploading an Image Pin
Member 1031225720-Oct-13 18:29
Member 1031225720-Oct-13 18:29 
AnswerRe: Uploading an Image Pin
Abhinav S21-Oct-13 18:35
Abhinav S21-Oct-13 18:35 
AnswerRe: Uploading an Image Pin
Pratik Bhuva1-Nov-13 4:14
professionalPratik Bhuva1-Nov-13 4:14 
Questioninterview questions Pin
ananta117-Oct-13 7:46
ananta117-Oct-13 7:46 
AnswerRe: interview questions Pin
Richard MacCutchan17-Oct-13 7:59
mveRichard MacCutchan17-Oct-13 7:59 
AnswerRe: interview questions Pin
R. Giskard Reventlov17-Oct-13 8:07
R. Giskard Reventlov17-Oct-13 8:07 
AnswerRe: interview questions Pin
thatraja17-Oct-13 21:54
professionalthatraja17-Oct-13 21:54 
AnswerRe: interview questions Pin
Abhinav S19-Oct-13 21:20
Abhinav S19-Oct-13 21:20 
QuestionStretching an Image in a Table cell (IE7) Pin
Blikkies17-Oct-13 4:54
professionalBlikkies17-Oct-13 4:54 
QuestionFiltering - web api c# Pin
miss78617-Oct-13 0:01
miss78617-Oct-13 0:01 
AnswerRe: Filtering - web api c# Pin
Bernhard Hiller17-Oct-13 2:29
Bernhard Hiller17-Oct-13 2:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.