首页 \ 问答 \ 如何在对话框中确定它是否由其父项打开为模态或非模态对话框?(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 ...
  • 您可以考虑使用表单身份验证: 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 ...
  • 修改您的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 ...

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。