Case change after page post

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    Case change after page post

    Hi

    How can I change the case of the text entered by user to first letter
    capital, after user has submitted the webform?

    Thanks

    Regards


  • Enrique Santa Cruz

    #2
    Re: Case change after page post

    You can use a function like so feel free to modify it to your needs.
    private string Capitalizer(str ing text)

    {

    for(int i = 0; i < text.Length; i++)

    {

    if(Char.IsUpper (text[i]) && i != 0)

    {

    text = text.Insert(i, " ");

    i++;

    }

    }

    return text;

    }

    Then right the value back to the text box before the post back of the page.
    You can also store the value in a Session object then in the page load right
    it to the textbox.

    Enrique.

    "John" <John@nospam.in fovis.co.uk> wrote in message
    news:e9Q3PAewEH A.1408@TK2MSFTN GP10.phx.gbl...
    [color=blue]
    > Hi
    >
    > How can I change the case of the text entered by user to first letter
    > capital, after user has submitted the webform?
    >
    > Thanks
    >
    > Regards
    >
    >[/color]


    Comment

    Working...