Passing Eval from ASPX to Javascript function as Parameter

<asp:LinkButton ID="lnkDocShow" runat="server" CausesValidation="false" OnClientClick='<%# String.Format("javascript:return DownloadMyFile(\"{0}\")", Eval("Field1").ToString()) %>'  CssClass="commiicondown"  Text='<%# Bind("Field2") %>'></asp:LinkButton>


<script type="text/javascript" language="javascript">
         function DownloadMyFile(Document) {
             window.open('abcd.aspx?Document=' + Document, '_self', false)
         }
    </script>
                                                          

Comments

Popular posts from this blog

Executing PowerShell scripts from C#

HOW TO Use the NumericUpDown Control

Exposing Agile Software Development Myths