how to pass the strMessage (from codebehind to the script) to get the alert message

Posted by Ranjana on Stack Overflow See other posts from Stack Overflow or by Ranjana
Published on 2010-04-17T09:15:50Z Indexed on 2010/04/17 9:23 UTC
Read the original article Hit count: 251

Filed under:
|
|

how to pass the strMessage (from codebehind to the script) to get the alert message

i.e if my strmessage from code behind is hi,

then i need

You Have Used already the message : hi

My code...

<script type="text/javascript">
     var strFileName;

    function alertShowMessage() {
    alert("You Have Used already the message :"+ <%=strFileName %>+ ");
    }
</script>


datatable dtChkFile =new datatable();
dtChkFile = objutility.GetData("ChkFileName_SMSSent", new object[] {"rahul"}).Tables[0];
         if (dtChkFile.Rows.Count > 0)
         {
             for (int i = 0; i < dtChkFile.Rows.Count; i++)
             {
                  strMessage= dtChkFile.Rows[i]["Message"].To);

             }
         }

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET