you can add a regular expression validator like
<asp:TextBox ID="txtUrl" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator
EnableClientScript="false"
ID="validatorUrl"
runat="server"
ValidationExpression="(http|https)://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?"
ControlToValidate="txtUrl"
SetFocusOnError="true"
ErrorMessage="* Url not valid!" />
code behind :
if (this.validatorUrl.IsValid)
{
}
this reg-ex is quite syple, there are a lot more complicated
or you can use Uri.TryCreate Method
public static bool TryCreate(Uri baseUri,Uri relativeUri,out Uri result)
Return Value :A Boolean value that is true if the Uri was successfully created; otherwise, false.