﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - WebDesktop - WebButton FlyPostBack OnClicked event</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebButton-FlyPostBack-OnClicked-event/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>WebButton FlyPostBack OnClicked event</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebButton-FlyPostBack-OnClicked-event/</link><pubDate>Tue, 10 Dec 2013 21:13:27 GMT</pubDate><dc:creator>bernard</dc:creator><description>&lt;p&gt;Hi Roi,&lt;/p&gt;&lt;p&gt;I think you could validate the session when flypostback in Page_Load event.&lt;/p&gt;&lt;pre&gt;protected void Page_Load(object sender, EventArgs e)
{
	if (IsPostBack)
	{
		//you can validate the page session in here and call the response from here
		WebButton1.ClientAction.InvokeScript("Redirect()");
		WebButton2.ClientAction.InvokeScript("Redirect()");
		WebButton3.ClientAction.InvokeScript("Redirect()");
		WebButton4.ClientAction.InvokeScript("Redirect()");
	}
}&lt;/pre&gt;
&lt;p&gt;Page_Load event will be called during postback in postback cycle. It will be better if you put the validation in there. However, when doing flyposyback the page need to get the responses from Server side. With the method above, the javascript will be called right after the response has been by the page. Hope this helps.&lt;/p&gt;
&lt;p&gt;You can download the file from my SkyDrive here: &lt;a href="https://skydrive.live.com/redir?resid=F226E4DAA368F2A6!317&amp;amp;authkey=!AFYTwg_yj77uUYk&amp;amp;ithint=file%2c.zip" target="_blank" style="font-size: 10pt;"&gt;https://skydrive.live.com/redir?resid=F226E4DAA368F2A6!317&amp;amp;authkey=!AFYTwg_yj77uUYk&amp;amp;ithint=file%2c.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Bernard&lt;/p&gt;</description></item><item><title>WebButton FlyPostBack OnClicked event</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebButton-FlyPostBack-OnClicked-event/</link><pubDate>Mon, 09 Dec 2013 09:23:46 GMT</pubDate><dc:creator>roiu@a-g-r-e.com</dc:creator><description>&lt;p&gt;Bernard Hi, &lt;/p&gt;&lt;p&gt;For some reason I am not able to use the link you have sent me. &lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&lt;br /&gt;Do you happen to know of a way to dynamically &lt;b&gt;OVERRIDE &lt;/b&gt;the "OnClicked" event of each WebButton control?&amp;nbsp;&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;For example, I can use this function to override each OnLoad event of each page:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&lt;br /&gt;protected override void OnLoad(EventArgs e)&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;{ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; base.OnLoad(e);&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size: 10pt;"&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Overriding the "OnClicked" event could be very helpful.&lt;/p&gt;
&lt;p&gt;  &lt;/p&gt;</description></item><item><title>WebButton FlyPostBack OnClicked event</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebButton-FlyPostBack-OnClicked-event/</link><pubDate>Sun, 08 Dec 2013 21:48:45 GMT</pubDate><dc:creator>bernard</dc:creator><description>&lt;p&gt;Hi Roi,&lt;/p&gt;&lt;p&gt;I think there are no other way than redirect the page using InvokeScript method that you mentioned before. Perhaps, you doesn't need to check it in all OnFlyPostback event of our control that you used in your page because you could add this validation on Page_Load event. Everytime our control do Flypostback, it needs to return the parameter to its page. So it will be better if you redirect the page in client side because it won't bother the FlyPostback mechanism to return the parameter.&lt;/p&gt;
&lt;p&gt;I also attach my sample &lt;a href="https://www.mediafire.com/?sa92stpbesy1qg4" target="_blank"&gt;here&lt;/a&gt;. Hope this helps.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Bernard&lt;/p&gt;</description></item><item><title>WebButton FlyPostBack OnClicked event</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebButton-FlyPostBack-OnClicked-event/</link><pubDate>Sun, 08 Dec 2013 09:19:26 GMT</pubDate><dc:creator>roiu@a-g-r-e.com</dc:creator><description>Bernard Hi, 
Session Client side checks are not optional for me, since it's not secured. 
Furthermore, that would require me to client side check each and every onclick made.</description></item><item><title>WebButton FlyPostBack OnClicked event</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebButton-FlyPostBack-OnClicked-event/</link><pubDate>Thu, 05 Dec 2013 23:51:18 GMT</pubDate><dc:creator>bernard</dc:creator><description>&lt;p&gt;Hi Roi,&lt;/p&gt;&lt;p&gt;Sorry for my misunderstanding. I think the response.redirect only can be used when you are in fullpostback mode. However, you could achieve this scenario in client side. In OnClientClick you could request the session in server side and save it to a hidden field in your page. Then using window.location attribute, you could redirect when the session is over. To get this session in server side your could use our WebFlyPostBackManager or you could do Ajax request to server. Hope this helps.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Bernard&lt;/p&gt;</description></item><item><title>WebButton FlyPostBack OnClicked event</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebButton-FlyPostBack-OnClicked-event/</link><pubDate>Thu, 05 Dec 2013 04:36:22 GMT</pubDate><dc:creator>roiu@a-g-r-e.com</dc:creator><description>&lt;p&gt;Barnard Hi, &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Page_load would not work, neither by using Response.Redirect or by adding a redirect javascript function for that matter, simply because the flypostback occurs behind the scene. &lt;/p&gt;
&lt;p&gt;You must attach a javascript function to the control by using: &lt;/p&gt;
&lt;p&gt;WebButton.ClientAction.InvokeScript("Redirect()");&lt;/p&gt;
&lt;p&gt;Since I need it to occure for every WebButton that does a flypostback, I need to overried the it's Click event in the base page.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Any suggestions how I do that?&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>WebButton FlyPostBack OnClicked event</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebButton-FlyPostBack-OnClicked-event/</link><pubDate>Tue, 03 Dec 2013 21:07:30 GMT</pubDate><dc:creator>bernard</dc:creator><description>&lt;p&gt;Hi Roi,&lt;/p&gt;&lt;p&gt;I think you could do this scenario with session timeout. However, you should check this session on Page_Load event because it will call Page_Load event even when the page do FlyPostback. You can check if the session still available and redirect it to login page when the session is over. Also, you could do flypostback method from client side to request the session in server side. You can also redirect the page in client side. Hope this helps.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Bernard&lt;/p&gt;</description></item><item><title>WebButton FlyPostBack OnClicked event</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebButton-FlyPostBack-OnClicked-event/</link><pubDate>Tue, 03 Dec 2013 02:02:55 GMT</pubDate><dc:creator>roiu@a-g-r-e.com</dc:creator><description>&lt;p&gt;Bernard Hi, &lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Thank you very much for your kind answer. Though it is not quite what I ment.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I'd like to check session availability on server side (using inherited page base), for &lt;b&gt;all&lt;/b&gt; intersoft's controls that use FlyPostBack, without actually checking session for each event. &lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;In case the session has ended, I would like to &lt;b&gt;cancel the AJAX request&lt;/b&gt; made by the flypostback, and redirect the user to login page.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Is there a way to actually cancel the AJAX request and inject a javascript redirection?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;</description></item><item><title>WebButton FlyPostBack OnClicked event</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebButton-FlyPostBack-OnClicked-event/</link><pubDate>Mon, 02 Dec 2013 21:39:50 GMT</pubDate><dc:creator>bernard</dc:creator><description>Hi Roi,&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;I think you could do this scenario by using WebButton's OnClientClick client side event. In that function, you could return false to deny the server side event to be executed. It would be like this:&lt;/div&gt;
&lt;div&gt;&lt;pre&gt;function bttn_OnClientClick(controlId)
{
   return false;
}&lt;/pre&gt;&lt;p&gt;This will cancel your OnClick event in server side. Hope this helps.&lt;/p&gt;&lt;p&gt;Regards,&lt;br /&gt;Bernard&lt;/p&gt;&lt;/div&gt;</description></item><item><title>WebButton FlyPostBack OnClicked event</title><link>http://www.intersoftsolutions.com/Community/WebDesktop/WebButton-FlyPostBack-OnClicked-event/</link><pubDate>Mon, 02 Dec 2013 09:50:29 GMT</pubDate><dc:creator>roiu@a-g-r-e.com</dc:creator><description>&lt;p&gt;Hello, &lt;/p&gt;
&lt;p&gt;I'm trying to figure out how to &lt;b style="text-decoration: underline;"&gt;prevent&lt;/b&gt; the "OnClicked" event(server side) of a WebButton&lt;/p&gt;
&lt;p&gt;from within some &lt;span style="text-decoration: underline;"&gt;inheritted base page&lt;/span&gt; (On_Init event) in case session has ended, and actually redirect the user into another page without allowing the event to fire.&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;I have tried Response.Redirect and even &lt;/span&gt;&lt;font style="font-size: 13px;"&gt;Page.ClientScript.RegisterClientScriptBlock &lt;/font&gt;&lt;b style="font-size: 10pt; text-decoration: underline;"&gt;prior&lt;/b&gt;&lt;font style="font-size: 13px;"&gt; to invoking the event, but nothing seemed to work. I believe something is&amp;nbsp;&lt;/font&gt;interfering &lt;font style="font-size: 13px;"&gt;with&amp;nbsp;&lt;/font&gt;&lt;span style="font-size: 10pt;"&gt;FlyPostBack mechanism(?)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Help would be much appreciated!&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;I'm using the following control &amp; code:&lt;/p&gt;
&lt;p&gt;&amp;lt;ISWebDesktop:WebButton ID="bttn" runat="server"  Height="20px" Width="150px" &lt;/p&gt;
&lt;p&gt;                                            Text="Click" DisplayMode="Text" AutoPostback="true" TabIndex="108"&lt;/p&gt;
&lt;p&gt;                                            OnClientClick="bttn_OnClientClick" OnClicked="bttn_OnClicked"&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;FlyPostBackSettings PostHiddenFields="True" PostInputControls="True" /&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/ISWebDesktop:WebButton&amp;gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;protected void bttn_OnClicked(object sender, WebButtonClickedEventArgs e)&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;bttn.ClientAction.InvokeScript("JSFunc();");&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;</description></item></channel></rss>