跳转后的新页面需要参数传递,怎么得到参数

_hzm _hzm 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
求教!!跳转后的新页面需要参数(id)传递,怎么传递

第一页面的前台代码:
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
<script type="text/javascript" src="../Scripts/jquery-1.7.1.js"></script>
<script type="text/javascript">
$(function () {
var a = $("a");
a.click(function () {
var id = $("#id").text();
alert(id);
window.showModalDialog("QuestionDateils.aspx?id=+id", "newWin", "height=300, width=700");
})
})
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="gvQuestionList" runat="server" AutoGenerateColumns="False" DataKeyNames="questionId">
<Columns>
<asp:TemplateField HeaderText="ID">
<ItemTemplate>
<asp:Label ID="lbquestionId" runat="server" Text='<%#Bind("questionId") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="科目">
<ItemTemplate>
<asp:Label ID="lbSubject" runat="server" Text='<%#Bind("Subject.SubjectName") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="题型">
<ItemTemplate>
<asp:Label ID="lbQuestionType" runat="server" Text='<%#Bind("QuestionType.questionTypeName") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="题目内容">
<ItemTemplate >
<asp:Label ID="lbQuestionContent" runat="server" Text='<%#Bind("QuestionContent") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<%--<asp:HyperLinkField HeaderText="查看详情" Text="查看详情" DataNavigateUrlFields="questionId"/>--%>
<asp:TemplateField HeaderText="查看详情">
<ItemTemplate>
<a href="#" id="id">查看详情</a>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</form>
</body>
</html>


新页面的后台代码:
int id = int.Parse(Request.QueryString["id"]); 怎么得到第一页面的Id


...全文

相关推荐

在Js页面通过POST传递参数跳转到新页面详解

主要给大家介绍了关于在Js页面通过POST传递参数跳转到新页面的相关资料,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧。

weixin_38567956

微信小程序之页面跳转和参数传递的实现

主要介绍了微信小程序之页面跳转和参数传递的实现的相关资料,希望通过本文能帮助到大家,需要的朋友可以参考下

weixin_38622962

鸿蒙登录跳转实现[项目代码]

本文详细介绍了在鸿蒙系统中实现登录后页面跳转的步骤。首先,在现有登录界面的基础上添加一个新页面;其次,通过点击登录按钮触发跳转,并将登录结果作为参数传递到新页面。登录成功时,新页面显示欢迎语;登录失败则显示“登录失败,无操作权限”。代码示例展示了如何通过router.pushUrl实现页面跳转和参数传递,以及如何在Second页面接收并显示这些参数。此外,还提供了登录验证逻辑和错误提示的实现方法。

gamma

Android中Activity之间跳转和参数传递的实例

本篇文章主要介绍了Android中Activity之间跳转和参数传递的实例,小编觉得挺不错的,现在分享给大家,也给大家做个参考。一起跟随小编过来看看吧

weixin_38682254

微信小程序小知识点:传递参数,跳转,FORM表单

作者:周起,来自授权地址 在做小程序的时候,有时候会因为文档看的不仔细,或者其他原因,总会有一些小错误,因此记录下来。 1.关于FORM表单 &lt;form bindsubmit="formSubmit"&gt; &lt;button formType="submit"&gt;提交&lt;/button&gt; &lt;/form&gt; 表单一定要设置一个绑定函数,即  bindsubmit的属性值     formSubmit 另外一定要设置一个button,并且属性key=”value”是固定的   formType="submit"   js端 formSubmit: function(e){ console.log(e

weixin_38741030
评论 9
收藏 已收藏
分享
返回顶部
_hzm
.NET社区 62,274 成员 668,968 内容