会员
周边
众包
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
Asp.Net技术前瞻--张明Blog
博客园
::
首页
::
新随笔
::
联系
::
订阅
::
管理
公告
asp.net2.0 GridView Url传递中文参数解决方案
Posted on
2006-10-06 05:05
张明
阅读(
1921
) 评论(
2
)
编辑
收藏
举报
<
asp:GridView ID
=
"
GridView1
"
PageSize
=
"
30
"
runat
=
"
server
"
Height
=
"
100%
"
Width
=
"
100%
"
AutoGenerateColumns
=
"
False
"
AllowPaging
=
"
True
"
EmptyDataText
=
"
没有数据记录!!
"
DataKeyNames
=
"
iProductBigSort_ID
"
BackColor
=
"
#EEEEE6
"
OnRowEditing
=
"
GridView1_RowEditing
"
onRowCancelingEdit
=
"
GridView1_RowCancelingEdit
"
onRowDeleting
=
"
GridView1_RowDeleting
"
onRowUpdating
=
"
GridView1_RowUpdating
"
>
<
Columns
>
<
asp:TemplateField HeaderText
=
"
主分类名
"
>
<
ItemTemplate
><%
# Eval(
"
sProductBigSort
"
)
%></
ItemTemplate
>
<
EditItemTemplate
><
asp:TextBox ID
=
"
sProductBigSort
"
Width
=
"
60%
"
runat
=
"
server
"
Text
=
<%
# Eval(
"
sProductBigSort
"
)
%>
/></
EditItemTemplate
>
</
asp:TemplateField
>
<
asp:TemplateField HeaderText
=
"
管理子分类
"
>
<
ItemTemplate
>
<
a href
=
"
Admin_SmallSort.aspx?iProductBigSort_ID=<%# Eval(
"
iProductBigSort_ID
"
)%>&sProductBigSort=<%# Server.UrlEncode(Eval(
"
sProductBigSort
"
).ToString())%>
"
>
查看分类
</
a
>
</
ItemTemplate
>
</
asp:TemplateField
>
<
asp:CommandField ShowEditButton
=
"
True
"
HeaderText
=
"
操作
"
ButtonType
=
"
Button
"
/>
<
asp:TemplateField HeaderText
=
"
删除分类
"
ShowHeader
=
"
False
"
>
<
ItemTemplate
>
<
asp:LinkButton ID
=
"
LinkButton1
"
runat
=
"
server
"
CausesValidation
=
"
False
"
CommandName
=
"
Delete
"
Text
=
"
删除
"
OnClientClick
=
"
return confirm('严重警告!!此操作非常危险!!\n此操作将会删除以下信息:\n此主分类下的二级、三级小分类、相关品牌以及删除相关的全部产品资料。\n确认要删除吗?');
"
></
asp:LinkButton
>
</
ItemTemplate
>
</
asp:TemplateField
>
</
Columns
>
<
PagerSettings Visible
=
"
False
"
/>
</
asp:GridView
>
//
这就实现了GridView的模板列传递URL参数时进行了编码
/**/
/*
a href="Admin_SmallSort.aspx?iProductBigSort_ID=<%# Eval("iProductBigSort_ID")%>&sProductBigSort=<%# Server.UrlEncode(Eval("sProductBigSort").ToString())%>">查看分类</a>
*/
会员力量,点亮园子希望
刷新页面
返回顶部
Powered by:
博客园
Copyright © 2024 张明
Powered by .NET 8.0 on Kubernetes