Using JavaScript
<script type="text/javascript">
window.onload = function () {
var str = "1000,1001,1002,1003,1004";
if (str.search('1003')) {
alert('String found at ' + str.indexOf('1003') + 1);
}
};
</script>
Using C#
string str = "1000,1001,1002,1003,1004";
if (str.Contains("1003"))
{
int pos = str.IndexOf("1003");
string message = string.Format("string found at {0}", pos.ToString());
ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('" + message + "');", true);
}