<img src="<%= YourProjectBase.YourConfigUtility.HomeURL %>yourfolder/images/<%# Eval("ImageName")%>.png" alt="" width="17" height="21" align="left" />
Showing posts with label URL. Show all posts
Showing posts with label URL. Show all posts
Wednesday, December 7, 2011
Image with HomeURL
Wednesday, September 21, 2011
Validate URL in ASP.NET
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script language="javascript" type="text/javascript">
function Validate() {
var txtURL = document.getElementById("<%=txtURL.ClientID %>");
if (txtURL.value == "http://") {
ValidatorEnable(document.getElementById("<%=rxURL.ClientID %>"), false);
}
else {
ValidatorEnable(document.getElementById("<%=rxURL.ClientID %>"), true);
return document.getElementById("<%=rxURL.ClientID %>").isvalid;
}
return false;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:RegularExpressionValidator ID="rxURL" runat="server" ControlToValidate="txtURL" SetFocusOnError="true"
ValidationGroup="requiredGroup" Enabled="false" ErrorMessage="*" ValidationExpression="[http(s)?://]*([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?"></asp:RegularExpressionValidator>
<asp:TextBox runat="server" ID="txtURL"></asp:TextBox>
<asp:Button ID="btnCheckURL" Text="Check URL" runat="server" OnClientClick="return Validate();" />
</div>
</form>
</body>
</html>
Subscribe to:
Posts (Atom)