开发者

Closing Login Control in iframe outside login.aspx

I have login control which i need to load in an iframe which is outside my body content that is login.aspx. so from my default.aspx page i will load it in an iframe. So far everything works perfectly when using colorbox like this

 <script type="text/javascript">
     $(开发者_StackOverflow社区document).ready(function(){
    $(".login").colorbox({width:"80%", height:"80%", iframe:true,
        onClosed:function(){ parent.location.reload(true); } });
    });

  </script>

Login here

Now when the Login Control load in the overlay, i cant get it to close when the user triggers the login button after validation of the fields.

By so i lose all the data entered and so user cant logged in. Can anyone suggest how to close the colorbox without losing the data and at same being redirect to the default.aspx page


I'm not sure what colorbox is (never used the plugin) but you can open and close elements on a page using plain ole JQuery like this...

function showDiv(curSect, objName) { //re-direct to compliance site til we have more links if ($('#' + objName).is(":visible")) { $('#' + objName).slideUp(); } if ($('#' + objName).is(":hidden")) { $('#' + objName).slideDown("slow"); } }

So then you can have the onmouseclick or onmouseover events trigger the object like so: ');">Reports And you create a hidden div:

... additional markup ...

And then with CSS give the element a: display:none; attribute... Now you can selectively hide or show a div on your page... Obviously it not have to be linked to a click event...


I have done this, but in the ASP.net context; it's a matter of acquiring the Form elements and storing in the parent form prior to closing the iFramed child.

It's not strictly a Colorbox issue, IMHO, rather a parent/child situation where you need to reference Child.Window.Form. before some arbitrary event (in case close of the iFramed window).

Colorbox just happens to be playing the role of window manager here. But you could do the same with straight js or jquery.

I'm afraid I don't have the ASP.Net chops to fully nail this...

Regards - kevin m

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜