有关代码的简单问题 [英] Simple question about code

查看:122
本文介绍了有关代码的简单问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Response.Redirect("~/UserDetails.aspx?Id=" + Session["Id"].ToString());


这条线是做什么的?

什么是ID?


What this line do?

What Is Id?

推荐答案

Id是querystring参数,它将被重定向到下一页,并且id值可以用作参数. /> 请参见 http://en.wikipedia.org/wiki/Query_string [
Id is the querystring parameter, This will be redirected to the next page and the id value can be used as the parameter.
See http://en.wikipedia.org/wiki/Query_string[^] for more information on query strings.


这是重定向转到UserDetails页面,并输入查询字符串 [

基本上,在加载UserDetails页面时,它将能够检索传递给它的ID并加载与该ID相匹配的User.
It''s saying redirect to the UserDetails page and pass in a query string [^] with a name of ''Id'' and the value is retrieved from the Session.


Basically, when the UserDetails page loads, it will be able to retrieve the Id passed to it and load up the User that matches the Id.


1. Redirect方法使浏览器将客户端重定向到其他URL.

2.总之之后是什么?将被分类为查询字符串的名称和值.可以有多个查询字符串.在这种情况下,ID是第一个.

要详细了解URL,可以通过
URL规范 [
1. The Redirect method causes the browser to redirect the client to a different URL.

2. In short anything after ? will be categorized into query string as name and value. There can be multiple query string. In this case ID is the first one.

for detailed understanding of URL you can go through URL Specification[^]


这篇关于有关代码的简单问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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