解决方案 »
- 求助!使用SQL存储过程返回多结果集?
- ASP.net 前台页面判断querystring值
- 如何在datagrid的ItemCreated里,给在datagrid里面的Label加超联接属性
- 从没见的.net错误~!求助啊。
- 关于TreeView请教大家!急~~~~~~~!谢谢
- 麻烦问下,大家有什么好的关于asp.net,c#的好的英文网站么,想看看英文的学习下 谢谢
- 如何将DataGrid表纵向排列,在线等
- 不能在对象中插入重复键
- 用函数统计EXCEL的行列的数目 但不对
- ASP.NET 未被授权访问所请求的资源。请考虑授予 ASP.NET 请求标识访问此资源的权限。这个到底是怎么回事呀?就这句Dim oApp As New Excel.
- URLDecoder用不了
- “/”应用程序中的服务器错误。 在位置 1 处没有任何行。
<%#Eval("fileDepartment").ToString() == "1" ? "<input class=\"BtnView\" type=\"button\" onclick=\"window.location='Detail.aspx?fileNum="+Eval("fileNum")+"'\"/>" : "<input class=\"BtnView\" type=\"button\" onclick=\"window.location='Detail2.aspx?fileNum="+Eval("fileNum")+"'\"/>"%>
</td>
用js可以,在后台写也行啊!
<script language="JavaScript" type="text/javascript">
function checkreg()
{
if ( Eval("fileType") =="合同")
{
document.location = "../ManagerHetong/Detail.aspx?fileNum=<%#Eval("fileNum")%> ";
}
<input class="BtnView" type="button" onclick="checkreg();"/>JS这么写的,不会跳转
<%#Eval("fileDepartment").ToString() == "1" ? "<input class=\"BtnView\" type=\"button\" onclick=\"window.location='Detail.aspx?fileNum="+Eval("fileNum")+"'\"/>" : Eval("fileDepartment").ToString() == "2" ? "<input class=\"BtnView\" type=\"button\" onclick=\"window.location='Detail2.aspx?fileNum="+Eval("fileNum")+"'\"/>" : "<input class=\"BtnView\" type=\"button\" onclick=\"window.location='Detail3.aspx?fileNum="+Eval("fileNum")+"'\"/>"%>
</td>
<script language="JavaScript" type="text/javascript">
function checkreg()
{
if ( Eval("fileType") =="合同")
{
document.location = "../ManagerHetong/Detail.aspx?fileNum=<%#Eval("fileNum")%> ";
}
<input class="BtnView" type="button" onclick="checkreg();"/>JS这么写的,不会跳转
这样应该也可以啊,window.location="detail.aspx";
只是你少写了循环吧用循环,套住itemtemplate,这样每行就可以绑定不同的数据,即filenum不同。
跳转的url就会根据每行的实际值来构建具体文件名,然后跳转。或者onclick那里,写个js函数,在函数里跳转,这样子更好,不会在标记里写入一大堆逻辑影响阅读。