string pagePath = " MCDEX时讯&nbsp;>&nbsp;" + list[i].c_issue+ "&nbsp;>&nbsp;" + list[i].c_category + "&nbsp;>&nbsp;" + list[i].c_name;                    Page.RegisterStartupScript("1", string.Format("<script>parent.TopFrame.onSetPagePath(true,'{0}');parent.TopFrame.setTitle('{1}');</script>", pagePath, list[i].c_name));
              
想在 pagePath 里 list[i].c_issue
添加链接怎么添加啊?
直接加不行整个都不出啦O(∩_∩)O~!

解决方案 »

  1.   

    调试方法
    1,看客户端的html里面生成的
    <script>parent.TopFrame.onSetPagePath(true,'{0}');parent.TopFrame.setTitle('{1}');</script>
    是否正确2,打印
    pagePath, list[i].c_name
    分别是什么特别注意
     list[i] 里面的i,难道是要输出多行的js?
      

  2.   

    pagePath 里面有'号吗?要是有,需要进行转义
    或者
    Page.RegisterStartupScript("1", string.Format("<script>parent.TopFrame.onSetPagePath(true,\"{0}\");parent.TopFrame.setTitle(\"{1}\");</script>", pagePath, list[i].c_name));
        
      

  3.   

       string pagePath = " MCDEX时讯 > " + list[i].c_issue+ " > " + list[i].c_category + " > " + list[i].c_name;            Page.ClientScript.RegisterStartupScript(this.GetType(),"",string.Format(" parent.TopFrame.onSetPagePath(true,\"{0}\");parent.TopFrame.setTitle(\"{1}\") ;</script>", pagePath, list[i].c_name),true);
      

  4.   

    Page.ClientScript.RegisterStartupScript(this.GetType(),"",string.Format(" parent.TopFrame.onSetPagePath(true,\"{0}\");parent.TopFrame.setTitle(\"{1}\");", pagePath, list[i].c_name),true);
      

  5.   

    单步查看数据
    ClientScript.RegisterStartupScript(this.GetType(), "", javaScript); 
      

  6.   

    string pagePath = " MCDEX时讯 > " + list[i].c_issue+ " > " + list[i].c_category + " > " + list[i].c_name;  Page.ClientScript.RegisterStartupScript(this.GetType(),"",string.Format(" parent.TopFrame.onSetPagePath(true,\"{0}\");parent.TopFrame.setTitle(\"{1}\") ;</script>", pagePath, list[i].c_name),true);list[i].c_issue的链接是 <a href="liload.aspx?issueid=>list[i].c_issue</a>
      

  7.   


    Page.ClientScript.RegisterStartupScript(this.GetType(),"",string.Format(" parent.TopFrame.onSetPagePath(true,'{0}');parent.TopFrame.setTitle('{1}')", pagePath, list[i].c_name),true);跟Page.ClientScript.RegisterStartupScript
    还是Page.RegisterStartupScript没有关系看你的数据是
      

  8.   

    本帖最后由 net_lover 于 2010-10-15 15:00:25 编辑
      

  9.   

     List<Model.mn_content> list = bll.getModel(mnid, seqno);            for (int i = 0; i < list.Count; i++)
                {
                    string tempContent = list[i].m_content.Replace(" ", "&nbsp;").Replace("\r\n", "<br />");
                    if (list[i].i_title_seqno == 1)
                    {
                        pArtTitle.InnerHtml = string.Format("{0}</br>({1})</br>{2}", list[i].c_name, list[i].c_issue, list[i].c_datetime.ToString("yyyy-MM-dd"));
                        
                        string pagePath = " MCDEX时讯&nbsp;>&nbsp;" + list[i].c_issue+ "&nbsp;>&nbsp;" + list[i].c_category + "&nbsp;>&nbsp;" + list[i].c_name;                    Page.RegisterStartupScript("1", string.Format("<script>parent.TopFrame.onSetPagePath(true,'{0}');parent.TopFrame.setTitle('{1}');</script>", pagePath, list[i].c_name));
                    }
                    sb.AppendFormat("<div class=\"ParTitle\">{0}</div>", list[i].c_title);
                    sb.AppendFormat("<div class=\"ParContent\"><p>{0}</p></div>", tempContent);
                }
                pArtContent.InnerHtml = sb.ToString();
            }
      

  10.   

    string pagePath = " MCDEX时讯 > " + list[i].c_issue+ " > " + list[i].c_category + " > " + list[i].c_name;这个里面貌似不能拼接 <a></a>之类的标签 不知道该怎么写啦
      

  11.   

    给你一个例子,这里用数组替代<%@ Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script runat="server">
      protected void Page_Load(object sender, EventArgs e)
      {
        String[] link = { "http://dotnet.aspx.cc", "http://dotnet.aspx.cc", "http://dotnet.aspx.cc" };
        String[] title = { "我的站点", "孟宪会", ".NET 学习" };
        string pagePath = " MCDEX时讯 >";
        for (int i = 0; i < link.Length; i++)
        {
          if (i == link.Length - 1)
          {
            pagePath += " <a href='" + link[i] + "'>" + title[i] + "</a>";
          }
          else
          {
            pagePath += " <a href='" + link[i] + "'>" + title[i] + "</a> > ";
          }
        }    Page.ClientScript.RegisterStartupScript(Page.GetType(), "m", "SetTitle(\"" + pagePath + "\")", true);  }
    </script>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
      <title></title>
      <script type="text/javascript">    function SetTitle(s) {
          document.getElementById("x").innerHTML = s;
        }  </script>
    </head>
    <body>
      <form id="form1" runat="server">
      <div id="x">
      </div>
      </form>
    </body>
    </html>
    看明白方法了吧
      

  12.   

    string pagePath = " MCDEX时讯&nbsp;>&nbsp;<a href='"+ "链接地址" +"'>" + list[i].c_issue+ "</a>&nbsp;>&nbsp;<a href='"+ "链接地址" +"'>" + list[i].c_category + "</a>&nbsp;>&nbsp;" + list[i].c_name;