- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我有一个标准表单例份验证 ASP.NET 应用程序。我的注册和登录页面与 2 个 jQuery Mobile 页面位于同一个 .aspx 文件中。如果我回发我的 ASP.NET 页面,例如用户无法正确登录...等,Url 哈希开始一遍又一遍地附加到自身。
示例网址:
http://localhost:56644/Register.aspx?ReturnUrl=%2fDefault.aspx%3fbla%3dtest&bla=test#Register.aspx?ReturnUrl=%2fDefault.aspx%3fbla%3dtest&bla=test/p>
一旦我的用户通过身份验证,我想在没有所有哈希信息的情况下重定向到 ReturnUrl,或者找到一种方法让 url 在回发期间保留?
标记:
<div data-role="page" id="register">
<div data-role="content" data-scroll="true" data-theme="b" class="Content">
......
<a href='#login'>Login</a
</div>
</div>
<div data-role="page" id="login">
<div data-role="content" data-scroll="true" data-theme="b" class="Content">
.....
<a href='#register' >Registered Yet?</a>
</div>
</div>
Register.aspx 上的代码隐藏:
protected void btnLogin_Click(object sender, EventArgs e)
{
if (LoggedIn)
{
FormsAuthentication.SetAuthCookie("blabla", true);
//Note: Request.QueryString["ReturnUrl"] = "/Default.aspx?bla=test";
Response.Redirect(Request.QueryString["ReturnUrl"]);
}
}
最佳答案
这是一篇旧帖子,但遇到了同样的问题,我将发布我已经制定的解决方案 - 它有点粗糙,但它可能对某人有所帮助或有所改进。此外,它在 ASP.NET MVC 4 中 - 不确定如何将相同的代码迁移到 aspx
我基本上做的是捕获 RedirectTo URL 并使用它作为 LogOn 表单标记的 data-url
属性提供。换句话说,在 MVC 4 中:
在 LogOn.Mobile.cshtml 中添加以下内容::
@{
string landPage = Request.Url.Query.Length>11?
Request.Url.Query.Substring(11):"";//very rough, to be improved.
// Here I am clipping the RedirectTo prefix of the Query
}
//replaces the boilerplate @using (Html.BeginForm())
@using (Html.BeginForm("LogOn", "Account", FormMethod.Post,
new { @data_url = landPage}))
这应该足以让它工作
关于c# - ASP.NET Response.Redirect with jQuery Mobile - Url hashing,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6864162/
我正在尝试使用 Rust 的 std::hash 函数: use std::hash::{hash, Hash, SipHasher}; #[test] fn hash_test() { pr
我有以下内容 friends = [{ name: "Jack", attr1:"def", attr2:"def" }, { name: "Jill", attr1:"def", attr2:"de
我有以下数组: names = [ {"Adriana"=>{:gender=>"female", :nationality=>"danish"}}, {"Adriane"=>{:gender=>"f
我有一个哈希的 Perl 哈希......大约 11 或 12 个元素深。请原谅我没有重复下面的结构! 一些级别有固定的标签,例如'NAMES' , 'AGES'或类似的,因此访问这些级别很好,因为我
我试图派生一个描述结构化值的Graphviz文件。这是出于诊断目的,因此我希望我的图形尽可能接近地反射(reflect)内存中的实际结构。我正在使用下面的方法将值映射到Graphviz顶点,以便当一个
我正在尝试获取在 xlm 中传递的事件日志条目,将它们转换为散列,然后存储到数据库中。 我目前正在使用 XmlSimple gem 将 xml 输入转换为散列。 测试样本输入: require 'xm
对于 Ruby 中的 Hash,reject! 和 reject 与 delete_if 有何不同?谁能用简单的代码片段解释它们之间的区别? 最佳答案 由于其他答案指的是 Array#delete_i
我正在尝试处理我使用 Data::Dumper 输出的 perl 数据结构 $VAR1 = 'GAHD'; $VAR2 = [ { 'COUNTRY' => 'US',
无法使用来自辅助进程的现有 rte Hash: h = rte_hash_find_existing("some_hash"); if (h) { // this will w
我有一个散列的散列,其中第一个键是一个字符串,第二个键是一个整数。我试图在散列的散列中获得最低的第二个键。这是我的哈希。 %HoH = ( flintstones => { 8
如何从一系列数组中生成哈希中的哈希?我需要从这里开始: my @data = /one two three/; my $value = 13: 为此: $hoh = { 'one' => { 'two
我有这个配置文件 dbUser=customer dbPass=passwrd dbSid=customer.shadow passwdFile=/production/etc-user tmpUse
我想实现一种thing,可以唯一标识,除此之外,它不包含其他字段。它有点像 ruby 中的 BasicObject 或 java 中的 Object。 我添加了一个 PartialEq 特征。 s
我正在尝试使用以下键存储二维哈希: 维度 1 = 数字但不连续 维度 2 = 字符串(如 :id 和 :value) 当元素未初始化时会出现问题。 memory = Hash.new(Hash.new
我目前正在学习 Michael Hartl 的 Ruby on Rails 教程 不理解在 section 4.4.1 中找到的此语句的含义: Hashes, in contrast, are dif
我很乐意通过更短的表达式访问多维哈希数组的任何元素 h = {a: {b: 'c'}} # default way p h[:a][:b] # => "c" # a nicer way p h[:a,
我想在编写 flutter channel beta 后运行 flutter web 它回复:Can't load kernel binary:Invalid SDK hash,你知道如何解决这个问题
我最近正在研究 Amazon 提供的新 NoSQL 服务,更具体地说是 DynamoDB。 亚马逊说你应该避免使用不均匀分布的键作为主键,即主键应该越独特越好。我可以认为这是最好的情况下每个项目都有唯
我的游戏中有很多哈希值,例如 HMSET('hash1', 'level', 25, 'connected', 2) HMSET('hash2', 'level', 50, 'connected',
我必须翻译这句话:'Susspected overpass-the-hash attack (Kerberos)' 我发现了这篇关于立交桥哈希的文章:https://blog.stealthbits.
我是一名优秀的程序员,十分优秀!