大家好,我在设计 Web 应用程序时,我在 addregistration
中有两个母版页 Default.aspx
和 Addregistration.aspx
我存储了使用 SQL
数据库中的数据,我在默认页面中将数据显示为 gridview
,当我单击它时,我将我的列设置为 hyperlink in grid view
链接它应该转到 addregistration page
我如何用我输入的字段和文本存储数据。下面是列的 Css
最佳答案
用javascript处理。你的NavigateUrl是#,加上一个onclick事件,或者直接用一个input类型的按钮更方便
<asp:HyperLink ID="hlink" CssClass="control" runat="server" NavigateUrl='#' onclick="gotoRegistration(<%#Bind("ReferenceNo")%>)" Text='<%#Bind("ReferenceNo")%>'></asp:HyperLink>
尝试将 ReferenceNo 传递给 JS 函数,如果 Bind 不起作用,请尝试 Eval。 和你的 JS
<script>
function gotoRegistration(theRefNo)
{
theUrl = "~/AddRegistration.aspx?refNo="+ theRefNo
window.location = theUrl;
}
</script>
然后您的注册页面从请求的查询中读取它
关于html - asp.net 如何使用超链接将数据从一页显示到另一页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34349711/