是否有类似的东西?
<a id="username" href="http://www.prepp.me/profile/<%: GetUserGUID() %>"><%: Context.User.Identity.Name %></a>
使用此类服务器端代码:
public string GetUserGUID()
{
PREPP2Entities db = new PREPP2Entities();
var uid = (from a in db.Users where a.Login.Contains(Context.User.Identity.Name) select a.UserGUID).First();
return uid;
}
答案 0 :(得分:0)
请试试这个
C#功能:
public string GetText()
{
//your functionality
}
Aspx页码:
<asp:Label ID="Label1" runat="server" Text='<%=GetText()%>'></asp:Label>