当前位置:编程学习 > C#/ASP.NET >>

请教:滚动图片新闻不能传两个参数呢

            
             DataSet ds = NewsDAL.TopNews();
             Model.Newsdetail topN = new Newsdetail();
            for (int i = 0; i < ds.Tables["GethotPho"].Rows.Count; i++)
            {
               
                 string k = ds.Tables["GethotPho"].Rows[i]["Typeid"].ToString();
                string j = ds.Tables["GethotPho"].Rows[i]["Nid"].ToString();
               topN. strpics1 += ds.Tables["GethotPho"].Rows[i]["ImgHot"];
                if (i < 4) { topN.strpics1 += "|"; }
                string link1 = "shownews.aspx?NtyeID='"+ k +"'&Nid="+j;
                问题就在这里,string link1 = "shownews.aspx?Nid="+j 这样写就没问题。两个参数就显示不了
                topN.strlinks1 += link1 + "|";
                topN.strtitles1 += ds.Tables["Newsdetail_GethotPho"].Rows[i]["Ntitle"] + "|";
                top.Add(topN);
            }
            return top;
请高手指导。。。 --------------------编程问答-------------------- 可以传多个参数,你看看你是怎么取的querystring。 --------------------编程问答--------------------               int   n = Convert.ToInt32(Request.QueryString["Typeid"]);
                int i = Convert.ToInt32(Request.QueryString["Nid"]); 
             其它页面可传、可取到这两个值,就流动图片上面只能传一个值。。 --------------------编程问答-------------------- 补充一下: string link1 = "shownews.aspx?NtyeID='"+ k +"'&Nid="+j; 传两个参数浏览时整个图片都没显示了。。 --------------------编程问答-------------------- 应该是可以传两个参数的,你可以断点调试一下,返回的实例里面属性的值。 --------------------编程问答-------------------- 改成 string link1= "shownews.aspx?Nid='"+j+"'"; 浏览时什么也不显示 --------------------编程问答-------------------- (1)做一个urlencode编码
(2)去掉' '看看
(3)下一个断点调试
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,