wapt49 wapt49 - 5 months ago 46
Vb.net Question

How to pass evaluated Eval in javascript function

I am very new in VB.NET, Can Evaluated Eval be passed as an argument to a javascript function? If so how I can do that? I need true or false in to be pass on javascript function

onclick='ShowViewPopup(this, "detail", null, null, <%#IIf(String.IsNullOrEmpty(Eval("CustomerNumber"))) %>';

Many Thanks


Just get rid of IIf, you do not seem to need it. I also recommend output the whole function call with C# code, makes it easier on quotes. So (formatted for better readability):

    "ShowViewPopup(this, \"detail\", null, null, "
    + String.IsNullOrEmpty(Eval("CustomerNumber"))
    + ")"