开发者

Close Child Browser and Reload Parent Browser using C#

I have a Browser A from which when a link button is clicked Browser B is opened. In Browser B I have a grid in which I have a "Add Link button". In that Add Link button I am using OnClientClick for some Javascript Validation and OnClick for some submission. After OnClick If the submission is true passed I need to close that browser(B) and reload the Parent Browser(A).

I CAN'T USE JAVASCRIPT OnClientClick event on LinkButton as I am using it already. Is there any other way or els开发者_运维技巧e using C#, can I do that ??


C# does not run on the client side.

The only way to do it is through javascript.

You need to find some way to call it from javascript, just use a callback function or method to run once you have completed the rest of the work.

Edit:

You could always use a hidden field as well, set this on the postback using C#, then pick it up front end using javascript check for a particular value in there or something?!

or, use a script manager and let the c# call javascript through this.

This is another couple of methods you could use.


Yeah, it worked finallly.. I modified the JavaScript function for relaoding/refreshing the Parent Window from reload to "window.opener.location.href = window.opener.location.href" then it stopped from warning popup --

Close Child Browser and Reload Parent Browser using C#

I below line, it worked with out any pop up waring.. Page.ClientScript.RegisterStartupScript(this.GetType(), "close", "window.opener.location.href = window.opener.location.href;self.close();");

Thanks for your help & input..!!!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜