Hi. I need to store my validation expression strings in the
web.config file. For URL validation, I have the following code in my
<asp:TextBox ID="txtRedirectUrl" runat="server" />
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" ControlToValidate="txtRedirectUrl" Display="dynamic"
Text="Please enter a valid URL" ValidationExpression='<%#
My web.config entry looks like this:
<add key="UrlValExpression" value="
./?%&=]*)?|([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)? "
reason, it's not working. Nothing passes validation; not even valid
URL's. Then the app is stuck on the page; i.e., I cannot backspace out
the text and try again. I have to do a postback in order to attempt
the validation again.
I need to be able to retrieve the validation expression from the aspx page, and not the code behind file. Thanks for the help.