如何保持会议 [英] How to Maintain Session

查看:108
本文介绍了如何保持会议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在asp.net中做我的项目...我已经在3个单独的aspx页中创建了3个表... ..我的主页是default.aspx .....我已经给出了指向第一个表的链接(vdetails.aspx)在我的主页(default.aspx)中...当我单击table1的保存按钮时,它将把数据保存在数据库中并重定向到第二张表,同样地,第三张表也....... .如果我编辑VDETAILS.ASPX而不是DEFAULT.ASPX,则出现在我的地址栏中……出现2 ND TABLE ... ...就像我单击保存1 ST TABLE的按钮一样,它一定不会出现WIL REDIRECT但不能在地址栏中进行编辑.... plz可以帮助我完成我想做的事情???

在此先感谢...

解决方案

尝试这样

  in 中的VDETAILS.ASPX页:// 如果(会话[" ] == " )
{
response.redirect(" );
}

或其他将地址栏只读

参见链接
< a href = " > http://  forums.asp.net/t/1207625.aspx/1</a> [ < a href ="http://forums.asp.net/t/1207625.aspx/1" target ="_ blank" title ="New Window"> ^</a>]] 

< a href = "  asp.net应用程序中的地址栏 a  "  target =   _ blank" title =  新窗口"> ^  a   ASP.NET中的会话管理 [在ASP.NET中浏览会话 [ ASP.NET中的会话管理选项 [ ASP.NET会话管理内部 [ http://msdn.microsoft.com/en-us/library/ms178581.aspx  [  ^ ] 
http://msdn.microsoft.com/en-us/library/ms972429.aspx [ ^ ]
最好的问候
M.Mitwalli


最好的方法是在第一页的会话或缓存中存储唯一的ID类型值.当用户打开第二页时,请检查此值是否存在.如果存在,则仅在第二页上显示数据,否则不显示.

还要确保当您打开第二页并找到会话/缓存值时,然后在显示页面后删除该会话/缓存值,以使该页面无法直接再次打开.


Hi,

i am doing my project in asp.net...i have created 3 tables in 3 seperate aspx pages...... ..my home page is default.aspx ..... i had given a link to 1st table(vdetails.aspx) in my home page(default.aspx)...when i click the save button of table1 it wil save the data in database and redirected to 2 nd table likewise 3rd table.......... BUT IN MY ADDRESS BAR IF I EDIT VDETAILS.ASPX INSTEAD OF DEFAULT.ASPX THE 2 ND TABLE WIL APPEAR ......... IT MUST NOT COME LIKE THAT WHEN I CLICK THE SAVE BUTTON OF 1 ST TABLE ONLY IT WIL REDIRECT BUT NOT EDITING IN THE ADDRESS BAR....plz help me what i want to do????

Thanks in Advance...

解决方案

try like this

in VDETAILS.ASPX page ://by using session concept
under page load:
if(session["name"]=="")
{
response.redirect ("default1.aspx");
}

or else put the address bar readonly

see this link
<a href="http://forums.asp.net/t/1207625.aspx/1">http://forums.asp.net/t/1207625.aspx/1</a>[<a href="http://forums.asp.net/t/1207625.aspx/1" target="_blank" title="New Window">^</a>]

<a href="http://www.codeproject.com/Questions/147018/how-to-hide-address-bar-in-asp-net-application">how to hide address bar in asp.net application</a>[<a href="http://www.codeproject.com/Questions/147018/how-to-hide-address-bar-in-asp-net-application" target="_blank" title="New Window">^</a>]


Hi ,
check this links
Session Management in ASP.NET[^]
Exploring Session in ASP.NET[^]
Session management options in ASP.NET[^]
ASP.NET Session Management Internals[^]
http://msdn.microsoft.com/en-us/library/ms178581.aspx[^]
http://msdn.microsoft.com/en-us/library/ms972429.aspx[^]
Best Regards
M.Mitwalli


The best way would be to store a unique ID type value in session or cache from first page. when user opens second page then check this value exist or not. if it exist then only show the data on second page otherwise not.

Also make sure that when you open the second page and the session/cache value is found then after displaying the page remove that session/cache value so that the page could not be opened again directly.


这篇关于如何保持会议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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