地址栏中的Fething URL [英] Fething URL from Address Bar

查看:131
本文介绍了地址栏中的Fething URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从地址栏中获取URL.
1.每当用户将页面粘贴到
之类的Url中时 "http://localhost:49800/iUwe/Gallery/Inbox.aspx?Id = 1&view = inbox"
2.应该将他重定向到login.aspx页面,因为他的会话ID = null
3.但是无论何时他登录,都应该将他重定向到此页面
"http://localhost:49800/iUwe/Gallery/Inbox.aspx?Id = 1& view = inbox"
而不是他的Home.aspx页面.


怎么可能?"

i want to fetch URL from the address bar.
1. Whenever a user paste a page in Url like
"http://localhost:49800/iUwe/Gallery/Inbox.aspx?Id=1&view=inbox"
2. He should be redired to the login.aspx page because his session Id=null
3. but whenever he login he should be redirected to this page
"http://localhost:49800/iUwe/Gallery/Inbox.aspx?Id=1&view=inbox"
instead of his Home.aspx page.


"How is it possible?"

推荐答案

您不必获取URL".只需查看它们是否已登录即可,否则,将其重定向到登录页面.
You don''t have to "fetch the URL". Just see if they''re logged in, and if not, redirect them to the login page.


多种方式之一:
1.当您的问题步骤1发生时,在Inbox.aspx的页面加载中,检查登录的会话值.
-如果不为null,则显示页面.
-如果为null,则将当前URL保存在一个会话中(将其命名为browserdURLSession),然后重定向到登录页面.
2.用户登录后,将usser配置文件保存在会话中或维护登录的会话,以便您可以标识该用户已登录.
3.检查浏览的URL会话值(browsedURLSession),如果为null,则显示主页.如果其中包含一些网址,请重定向到该网址.

试试吧!
One of various ways:
1. When your question step 1 happens, in the page load of Inbox.aspx, check for the logged-in session value.
- If it is not null then show the page.
- If it is null then, save the current URL in a session (call it browsedURLSession) and then redirect to login page.
2. Once the user logs in, save the usser profile in session or maintain the logged in session such that you can identify that user is logged in.
3. Check for browsed URL session value (browsedURLSession), if it''s null show the home page. If it holds some url, redirect to that one.

Try!


步骤1:存储网址(http://localhost:49800/iUwe/Gallery/Inbox.aspx?Id = 1& view = inbox ).

第二步:成功登录后,从会话中获取值并重定向.
ASP.NET会话状态概述
ASP.NET会话的操作方法
希望以上信息对您有所帮助.如果您还有其他顾虑,请告诉我.
Step 1: Store the url(http://localhost:49800/iUwe/Gallery/Inbox.aspx?Id=1&view=inbox) in session.

Step2: After successful login retrieve value from session and redirect.
ASP.NET Session State Overview
ASP.NET Session How To
I hope the above information will be helpful. If you have more concerns, please let me know.


这篇关于地址栏中的Fething URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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