碰到一个怪问题

「已注销」 2013-12-07 08:32:55
是这样的,我本来有一个页面,然后有一个操作列,是在一个gridview里面的一个操作列,然后这个操作列是一个链接,链接指向另一个页面,并带入参数,传到另一个页面。
然后呢,如果这个参数为空的话,那么带入另一个页面的也应该是空的,但是带入另一个页面的结果,却是一个“?”这个问号从哪里来的?我根本没写啊。

PS:我开始用的是韩文的UNICODE系统,然后又改为中文的,因为我要玩一些韩服游戏,没改中文系统之前是好的,后来改成中文系统就又编辑了下代码,就变成下面这样了。

下面是开始的页面,点击修改,到下一个页面:

下面的是带入页面后的图,有问号的里面的参数内容为空

下面是主要代码:


void GridView_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{


string userid = e.Row.Cells[1].Text;
string userid1 = e.Row.Cells[9].Text;
//e.Row.Cells[4].Text = "<a href='AddUser.aspx?UserID=" + e.Row.Cells[4].Text + "'><font color='blue'>编辑</font></a>";
//string str = "";
string str= "<a href='LeaderTourMain.aspx?leaderid=" +userid1 + "&LeaderName=" + e.Row.Cells[2].Text + "&starttime=" + e.Row.Cells[3].Text + "&endtime=" + e.Row.Cells[4].Text + "&leaderlocation="+e.Row.Cells[5].Text.Trim()+"&maincontext="+e.Row.Cells[6].Text.Trim()+"&message="+e.Row.Cells[7].Text.Trim()+ "'><font color='blue'>修改</font></a>";
// str += "<a href='AddUser.aspx?UserID=" + e.Row.Cells[4].Text + "'><font color='blue'> 授权</font></a>";
e.Row.Cells[10].Text = str;
//e.Row.Cells[9].Visible = false;
e.Row.Cells[9].Visible = false;
e.Row.Cells[8].Visible = false;

e.Row.Cells[3].Text = e.Row.Cells[3].Text.Substring(0, e.Row.Cells[3].Text.Length-8);
e.Row.Cells[4].Text = e.Row.Cells[4].Text.Substring(0, e.Row.Cells[4].Text.Length-8);




if (e.Row.Cells[6].Text.Length > 20)
{

e.Row.Cells[6].Text = e.Row.Cells[6].Text.Substring(0, 20);




}




}

if (e.Row.RowType == DataControlRowType.Header)
{
e.Row.Cells[8].Visible = false;
e.Row.Cells[9].Visible = false;

}
}


 protected void Page_Load(object sender, EventArgs e)
{

if (!IsPostBack)
{

if (Request.QueryString["leaderid"] != null)
{

leaderName.Text = Request.QueryString["LeaderName"].ToString();

newBtn.Visible = false;
submitBtn.Visible = false;
if (Request.QueryString["starttime"] != null)
{

beginTime.SelectedDate = Convert.ToDateTime(Request.QueryString["starttime"].ToString());


}

if (Request.QueryString["endtime"] != null)
{
endTime.SelectedDate = Convert.ToDateTime(Request.QueryString["endtime"].ToString());

}


}


if (Request.QueryString["leaderlocation"] != null)
{
curLocation.Text = Request.QueryString["leaderlocation"].ToString();

}



if (Request.QueryString["maincontext"] != null)
{

travelContent.InnerText = Request.QueryString["maincontext"].ToString();
}



if (Request.QueryString["message"] != null)
{

leaderAttachment.Text = Request.QueryString["message"].ToString();
}



else
{
modifyBtn.Visible = false;
returnBtn.Visible = false;



}


}


}


各位大神救救我啊,明天就要交任务了
...全文
294 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
丨shadow 2013-12-11
  • 打赏
  • 举报
回复
编码格式问题吧
feiyun0112 2013-12-09
  • 打赏
  • 举报
回复
看看修改按钮的url

*****************************************************************************
签名档: http://feiyun0112.cnblogs.com/
quanwuhui 2013-12-09
  • 打赏
  • 举报
回复
看你数据上【领导】那列有的数据不是为空吗?比较一下?和真实空的数据差别,另外用IE抓一下包,看后台给你传回的是什么数据。抓包方法按F12——>点击网络->开始抓包

62,266

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧