ASP.NET链接按钮服务器标签格式不正确 [英] ASP.NET link button Server tag is not well formed

查看:76
本文介绍了ASP.NET链接按钮服务器标签格式不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在网格视图中添加一个按钮,该按钮会将我重定向到另一个页面并传递电影的ID.这是我的代码

Im trying to add a button in my grid view that will redirect me to another page and pass the id of the movie. This is my code

<asp:Button ID="Button1" runat="server" CausesValidation="False" 
                     PostBackUrl="~/Add/CheckMovie.aspx?movie=<%#Eval("mov_id")%>" 
                />

前一段时间,在另一个应用程序中,我使用了类似的代码,并且效果很好

A while back in a different app I used similar code and it worked fine

<a href="editUser.aspx?usr=<%# Eval("usr") %>"><%# Eval("usr") %></a>

是因为Im使用了不同的标签,还是因为网址?

Is it because Im using a different tag, or maybe because of the url ?

推荐答案

PostBackUrl='<%# "~/Add/CheckMovie.aspx?movie=" + Eval("mov_id") %>'

这篇关于ASP.NET链接按钮服务器标签格式不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆