using an external function in asp.net page

  • Thread starter Thread starter Thiago Temple
  • Start date Start date
T

Thiago Temple

I just built a component and I want to use it in my asp.net page.

I did this

<%@ Register tagprefix="infra" Namespace="SGVendasSys.Infra"
Assembly="SGVendasSys"%>
.....
<a href='SVUSU00103.aspx?IdUsuario=<%#
Encrypt(DataBinder.Eval(Container.DataItem, "IdUsuario"))%>'></a>

Note that the Encrypt function is a function that exists only in the
SGVendasSys component.
but when I use it a receive the following error

Compiler Error Message: BC30469: Reference to a non-shared member requires
an object reference.

Is there anyway to use the function in the page like this??

Thank you

Temple
 
Hi,
Add the user control ID befor the function :

<a href='SVUSU00103.aspx?IdUsuario=<%#
SGVendasSys1.Encrypt(DataBinder.Eval(Container.DataItem,
"IdUsuario"))%>'></a>

by the way if you want to create library of functions that you can use
from all form there are better ways to achieve it.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
 
Back
Top