This is a migrated thread and some comments may be shown as answers.

Friendly search engine url mask

1 Answer 65 Views
Input
This is a migrated thread and some comments may be shown as answers.
Pablo
Top achievements
Rank 1
Pablo asked on 20 Jul 2008, 09:04 PM
Hello, I am saving a value for a friendly search engine url string.
I am doing a site that is displaying news and I want the news to be easily read by google or yahoo.
So instead of having:
News.aspx?id=334
I want to have:
News.aspx?id=tropical-storm-forms-in-caribbean
I am wanting to save the "tropical-storm-forms-in-caribbean" part in a database field.  I want to use RadMaskedTextBox for the user to enter it, but I can't seem to figure out what mask to use.

Is it possible?  The AjaxControlToolKit has an extender for the TextBox control where you set validchars="abcdefghijklmnopqrstuvwxyz-" and you are done.

Is it something similar here? 

Thanks a lot!!

1 Answer, 1 is accepted

Sort by
0
Kevin Babcock
Top achievements
Rank 1
answered on 22 Jul 2008, 03:31 AM
Hello Pablo,

I'm not sure a RadMaskedTextBox is the best option for this circumstance. The mask options do not include the ability to create a mask for input of dynamic length. What I suggest is a RegularExpressionValidator.

<telerik:RadTextBox ID="RadTextBox1" runat="server" />       
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"  
    ValidationExpression="([a-zA-Z]+-?)+" 
    ControlToValidate="RadTextBox1" 
    ForeColor="Red" 
    ErrorMessage="*"
</asp:RegularExpressionValidator> 

I hope this was helpful.

Regards,
Kevin Babcock


Tags
Input
Asked by
Pablo
Top achievements
Rank 1
Answers by
Kevin Babcock
Top achievements
Rank 1
Share this question
or