Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/31.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net FormView在bind中调用字符串函数_Asp.net_Asp.net Mvc - Fatal编程技术网

Asp.net FormView在bind中调用字符串函数

Asp.net FormView在bind中调用字符串函数,asp.net,asp.net-mvc,Asp.net,Asp.net Mvc,我的网站(edituser.aspx)中有一个编辑用户页面。用户名和密码放在Access数据库中,我在FormView中显示它们。像这样: <asp:FormView ID="EditForm" runat="server" DefaultMode="Edit"> <EditItemTemplate> <strong>username:</strong><br /> <asp:Text

我的网站(edituser.aspx)中有一个编辑用户页面。用户名和密码放在Access数据库中,我在FormView中显示它们。像这样:

<asp:FormView 
ID="EditForm" 
runat="server" 
DefaultMode="Edit">
    <EditItemTemplate>
        <strong>username:</strong><br />
        <asp:TextBox ID="usernameIDTextBox" runat="server" Text='<%# Bind("usernameID") %>' /><br />

        <strong>Password:</strong><br />
        <asp:TextBox ID="passwordIDTextBox" TextMode="password" runat="server" Text='<%# Bind("passwordID") %>' /><br />
    ... .

尝试使用Eval而不是Bind:

<%# Decrypt(Eval("passwordID")) %>

如果我从Bind切换到Eval。将出现错误:一个或多个必需参数没有给定值。
Public Function Decrypt(ByVal strDecoded_Pword As String) As String
        On Error Resume Next
        Dim i, ct As Integer
        Dim letter, dec, StrValappend, strVal As String
        dec = ""
        strDecoded_Pword = StrReverse(strDecoded_Pword)

        For ct = 1 To Len(strDecoded_Pword) Step 2
            StrValappend = Chr(Val("&H" & (Mid(strDecoded_Pword, ct, 2))))
            strVal = strVal & StrValappend
        Next
        strDecoded_Pword = strVal

        For i = 1 To Len(strDecoded_Pword)
            letter = Mid(strDecoded_Pword, i, 1)
            dec = dec & Chr(Asc(letter) - i - 5)
        Next
        Decrypt = dec
    End Function
<%# Decrypt(Eval("passwordID")) %>