首页
\
问答
\
如何在对话框中确定它是否由其父项打开为模态或非模态对话框?(How determine within a dialog form if it was opened as a modal or non-modal dialog by its parent?)
如何在对话框中确定它是否由其父项打开为模态或非模态对话框?(How determine within a dialog form if it was opened as a modal or non-modal dialog by its parent?)
我有一个对话框表单,可以作为模态或非模态对话框打开。 在对话框中,如何判断对话框的打开方式,即模态与否?
I have a dialog form that can be opened as a modal or non-modal dialog. From within the dialog, how can I tell in which manner the dialog was opened, i.e. modal or not?
原文:https://stackoverflow.com/questions/8004023
更新时间:2022-03-27 13:03
最满意答案
你最好为
RefID
值创建一个类。 这将允许您这样做:public class RefContainer { // maybe RefID is not an int...? public Int32 RefID { get; set; } } Session["WorkingList"] = q.Select(x => new RefContainer { RefID = x.RefID }); var workingList = Session["WorkingList"] as IEnumerable<RefContainer>; if (workingList != null) { var nextRecord = workingList .SkipWhile(i => i.RefID != currentRecord) .Skip(1).First(); }
You're much better off creating a class for the
RefID
value. This will allow you to do this:public class RefContainer { // maybe RefID is not an int...? public Int32 RefID { get; set; } } Session["WorkingList"] = q.Select(x => new RefContainer { RefID = x.RefID }); var workingList = Session["WorkingList"] as IEnumerable<RefContainer>; if (workingList != null) { var nextRecord = workingList .SkipWhile(i => i.RefID != currentRecord) .Skip(1).First(); }
相关问答
更多-
如果您从asp.net传递到asp然后编码您的会话值并在查询字符串的帮助下传递并在页面级别捕获此会话值并使用一些编码和解码方法进行解码。 如果你在session_start方法的global.asax页面中从asp传递到asp.net,你可以使用session cokies来捕获。 就像我给你的一些例子,你可以遵循它 if (null == Request.Cookies["SessionCookie"]) { Session.Abandon(); ...
-
你最好为RefID值创建一个类。 这将允许您这样做: public class RefContainer { // maybe RefID is not an int...? public Int32 RefID { get; set; } } Session["WorkingList"] = q.Select(x => new RefContainer { RefID = x.RefID }); var workingList = Session["WorkingList"] as I ...
-
asp.net中的会话(Session in asp.net)[2022-10-21]
您可以考虑使用表单身份验证: http : //msdn.microsoft.com/en-us/library/aa480476.aspx You might consider using Forms Authentication: http://msdn.microsoft.com/en-us/library/aa480476.aspx -
您可以使用经典的asp页面来设置会话变量,例如post参数。 然后从你的asp.net页面调用那个经典的asp页面。 session(不完整)session.asp: if session("userIsloggedIn") = true and request.form("act") = "setSessionVar" then session(request.form("name")) = request.form("value") end if 当然这是某种黑客,但我们正在谈论经典的asp ...
-
由于Uploadify纯粹是一个前端脚本,我不明白为什么它会从ASP.NET获得一个会话。 我也不完全明白你的具体问题是什么。 如果您的问题是,一旦文件上传,用户无法在屏幕上看到它们,那么我建议找出一个显示独立于Uploadify的文件列表的方法。 如果可以,让它与文件一起发送ID令牌,然后从数据库中获取显示列表所需的数据。 This is the solution I came up with. I haven't done much testing, but it seems to be an acce ...
-
ASP.net会话清除(ASP.net Session Clear)[2024-01-03]
修改您的OnLoad代码,以便仅在首次调用该登录页面时清除会话, 而不是在回发时: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not IsPostback Then Session.RemoveAll() Session.Clear() Session.Abandon() End If End Sub ... -
除了womp: 未启用Cookie 在设置会话变量之后立即重定向 我会特别怀疑第二个,特别是如果你使用任何形式的Response.Redirect的urlrewriting机制。 In addition to womp: Not having cookies enabled Redirecting immediately after setting the session variable(s) I would suspect the second one in particular, especially ...
-
我认为不是直接的,但是你自己很容易做到。 在global.asax中,您可以将代码添加到Session_Start甚至处理程序,在该处理程序中添加会话变量,该变量指示会话何时创建。 像这样的东西: void Session_Start(object sender, EventArgs e) { // Code that runs when a new session is started Session["SessionStartTime"] = DateTime.Now; ...
-
会话存储在应用程序存储库中。 这两个应用程序各自拥有自己的存储库,无论它们是否共享某些代码,它们都不知道另一个存在。 有几种方法可以实现这一点。 有些产品允许多个应用程序共享会话状态,但这可能会导致其自身的后勤问题。 我不推荐这种方法。 正确的方法不是拥有通用代码,而是拥有一个公共存储库 - 即两个应用程序都有自己的会话,但是有两个应用程序都可以访问的第三个数据库 。 App1可以使用唯一键将对象写入第三个数据库,通过查询字符串或其他内容将密钥传递给App2,App2可以返回此公共数据库并使用相同的密钥检索 ...
-
您可以使用全局asax和以下方法。 sub session_onStart() application.lock() // your logic application.unlock() end sub sub session_onEnd() application.lock() // your logic application.unlock() end sub you can use global asax and following ...