.net前台调用后台函数的简单实例

时间:2022-02-03 23:45:53

.aspx:

复制代码代码如下:


<asp:DataList ID="dlstCon" runat="server">
      <ItemTemplate>
          <li><a href='<%# "ShowList.aspx?ExhibitionID="+Eval("ExhibitionID") %>' 
            /> .cs:

复制代码代码如下:

protected string IsMultiLang(object pTitle, object pTitleValue)
{
    string mReturn = "";
    if (pTitleValue.ToString() != "Null" && pTitleValue.ToString() != "")
    {
        mReturn = pTitle.ToString() + "[" + pTitleValue.ToString() + "]";
    }
    else
    {
        mReturn = pTitle.ToString();
    }
    return mReturn;
}