Geeks With Blogs

News
kazim mehdi Javascript
Remove/Disable javascript when using browser's back button
SCENARIO I have page that was hosted inside the iframe and I want to redirect the parent window when a user click a button inside the child page. For that I added the following code in the Button’s click event as I have to execute some server side code before redirecting. Page.ClientScript.RegisterS... RedirectKey, string.Format("window.top.l... = ‘http://google.com’;", url), true); PROBLEM Above mentioned code worked great but when the user used the browser’s back ......

Posted On Friday, June 10, 2011 11:18 AM

Passing additional parameters to JQuery bind event function
To pass the additional parameter to the event function pass an array of key value, as the second parameter to the bind event bind('click', { message: time }, onClick); e.g { message: time } and access it in the function using event<function parameter>.data.message&... <div id="div1" style="border: 1px solid black; width: 100px; height: 100px">click me</div> <script type="text/javascript"> function onClick(event) { alert(event.data.message); } var time = "loaded at:" ......

Posted On Monday, January 31, 2011 11:23 AM

ASP.net AJAX Calling Prototype based client side function on button client click.

I developed a custom control that utilizing client side functionality also. What I needed is calling client side function on clicking button.

to accomplish this we need to find the clientside object for that we use $find passing clientId of the custom web control as mentioned below.

 

btn.OnClientClick = string.Format("$find('{0}').add({1});", this.ClientID, ‘add’);

Posted On Friday, January 28, 2011 12:10 PM

ASP.NET AJAX:Localization Client Side
1. Set EnableScriptGlobalization=true on the script manager <asp:ScriptManager runat="server" EnableScriptGlobalization="... /> 2. Use the Sys.CultureInfo.CurrentCulture command either inside the alert or through Firebug console to check the CultureInfo at the client side 3. use Number.parseLocale instead of pareFloat so that it get correct value according to the current culture. 4. to update the value back with current culture use localeFormat <script type="text/javascript"> function ......

Posted On Thursday, May 12, 2011 11:34 AM

execute javascript function after even after ajax call

Add add_endRequest handler to the Page request manager as followed

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(<javascript name function>);

Posted On Thursday, April 28, 2011 6:02 PM

Execute Parent page’s javascript function from Iframe

call the parent javascript function using parent.

 

parent.update();

where update() is the name of the fuction that exist on the page that host the iframe.

Posted On Friday, February 11, 2011 1:23 PM

Update ASP.Net AJAX UpdatePanel using Javascript

calling __doPostBack method with updatePanel’s client id.

function updateUpdatePanel()
{
__doPostBack('<%=updatePanel.ClientID %>', '');
}

Posted On Friday, February 11, 2011 1:18 PM

Copyright © kazim sardar mehdi | Powered by: GeeksWithBlogs.net