本文介绍了如何从数据库表绑定HyperLink Text和NavigateUrl字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生,我有一个网站 []。我想在主页的工作面板上发布工作。我想通过管理面板发布这个职位。先生,请帮帮我..



非常感谢...

sir i have a website odishaonweb.com[^].I want to post jobs in job panel which was in home page. I want to put this job posts through admin panel. sir please help me..

thank you very much...

推荐答案

<ul>
<asp:panel runat="server" id="pnlLink" xmlns:asp="#unknown"></asp:panel> 
</ul>




$ b $ c在该页面的c#page_load方法中编写以下代码





in c# page_load method of that page write following code

DataTable dtData = new DataTable();
        Link_MasterDA objLink_MasterDA = new Link_MasterDA();

//your method of datalayer to fetch all links from db
        DataSet Result = objBanner_MasterDA.Select_All_Link();
        if (Result != null && Result.Tables.Count > 0)
        {
            dtData = Result.Tables[0];
            StringBuilder str = new StringBuilder();
            for (int i = 0; i < dtData.Rows.Count; i++)
            {
                if (dtData.Rows[i]["Link"].ToString() != "")
                    str.Append("<a title="" + dtData.Rows[i]["LinkTitle"].ToString() + "" href="" + dtData.Rows[i]["Link"].ToString() + "" />");
            }
            pnlLink.Controls.Add(new LiteralControl(str.ToString()));
        }


这篇关于如何从数据库表绑定HyperLink Text和NavigateUrl字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 03:10