Play an html class within an Asp.net code

Asked

Viewed 368 times

1

I have that code:

<%# Eval("DsPathDocumento") != null && !String.IsNullOrEmpty(Eval("DsPathDocumento").ToString()) ? String.Concat("href='/UpLoads/", Eval("DsPathDocumento"), "'") : "style='cursor: default; color:#000000;'" %>>

How would I play this class: class="linkUpload" within the first condition of the ternary expression? That is, would you like just the part after the "?" take this class so that my jquery function can run.

$(document).ready(function () {
        $('.linkUpload').click(function (event) {
            event.preventDefault();
            window.open($(this).attr("href"), "popupWindow", "scrollbars=yes");
        });
    });

1 answer

1

I resolved so:

<strong><a <%# Eval("DsPathDocumento") != null && !String.IsNullOrEmpty(Eval("DsPathDocumento").ToString()) ? String.Concat("href='/UpLoads/", Eval("DsPathDocumento"), "'","class='linkUpload'") : "style='cursor: default; color:#000000;' class='disabled'" %>>
                        <%# Eval("NmTipoDocumento") %>
                    </a></strong>     

Browser other questions tagged

You are not signed in. Login or sign up in order to post.