我想在表单完成操作后触发Div打开.但是我只需要根据一个特定的动作就可以做到这一点,所以它是特定的.我不确定从哪里开始.
I would like to trigger a Div to open after a form completes an action. But I need to it only happen based on one particular action so it is specific. I'm not sure where to start.
推荐答案好,因此,如果表单完成操作(即,您已提交)后未加载新页面,则我认为您不是将用户重定向到另一个页面;您只是将最新的数据发布回当前的购物车"页面.
Ok, so if a new page is not loaded after your form completes an action (i.e. you have submitted it), I would assume you mean you're not redirecting the user to a different page; you're just posting back the current "Cart" page with the updated data.
您的问题是,如何仅在回发后才在页面上显示内容".
So your question is, "How do I display content on my page only following a postback".
虽然 jQuery可以完成所有操作,但可能不需要在这里(至少我已经正确解释了您的问题).
While jQuery does all things, it's probably not needed here (if I've interpreted your problem correctly, at least).
您只需要检查页面是第一次加载还是响应回发而加载.为此,请使用Page.IsPostBack属性:
You just need to check whether the page is being loaded for the first time or is being loaded in response to a postback. For that you use the Page.IsPostBack property:
<% if (Page.IsPostBack) { %> <div id="myMessage"><p>You added something to your cart.</p></div> <% } %>如果这不是您的意思,则需要多解释一些问题.
If this isn't what you meant, you need to explain your question a bit more.
更多推荐
在onsubmit之后触发Jquery事件
发布评论