Tag: asp.net

Refresh updatepanel after fixed interval

This is my script: <script type=”text/javascript”> $(document).ready( function (){ setTimeout(‘myFun()’, 10000); }); function myFun() { var btn = document.getElementById(‘<%=myBtn.ClientID %>’); alert(btn); btn.click(); } </script> My markup: <asp:UpdatePanel ID=”upMain” runat=”server” UpdateMode=”Conditional”> <ContentTemplate> <asp:Label ID=”lblValue” runat=”server” Text=””></asp:Label> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID=”myBtn” EventName=”Click” /> </Triggers> </asp:UpdatePanel> <asp:Button ID=”myBtn” runat=”server” Text=”hit” /> Code Behind: protected void Page_Load(object sender, EventArgs […]

ASP.NET/Javascript error. Sporadically occurs, 'length is null or not an object'

This one has me perplexed. I have a web app that does many functions, but the part that it is bombing out is when doing a Search function which calls a webservice and returns results back from DB2. The odd thing, is the error doesn’t always occur and only seems to occur when accessing my […]

Javascript confirm dialog and middle/right mouse click

I’m working on an ASP.NET MVC 3 project, and I want to display a confirmation message before deletion, I’ve wrote the following line: @Html.ActionLink(“Delete”, “Delete”, new { id = item.ID }, new { onclick = “return confirm(‘Are you sure?’)” }) Which is ok and works fine, however when I click middle button on the mouse […]

Asp.net development and clientside operations integration

I’ve been using prado framework for a short time. In some projects I may be required to develop on Microsoft’s web tools platform. Can I easily integrate javascripts I’m familiar with(prototype, jquery or others) with ASP.Net as it was in prado? Or is there a Microsoft specific solution for web browser clientside operations? I develop […]

jQuery Modal Dialog is not working with postback

I’m having issues with the jQuery modal dialog. In the code below, I’m opening a dialog, and then using the buttons to return a value to a field in the form (id=”form1″) in the parent window. Then I perform a click on the ASP button, and finally I close the dialog. The result is that […]

ajaxToolKit autoCompleteExtender OnClientItemSelected

I am trying to implement an autoCompleteExtender into my project. Currently I am using the OnClientItemSelected property to call a javascript on the client side. Is there a way (using another property or some other code) that will let me call a method in the code behind when the user selects an option?

Receive answer from WCF-service's boolean method

my problem is: I have WCF service, which contains one method, that can return true of false. I call this method by JS on client. My problem is to call this method, then to wait it’s answer and then, for example, alert if true. My SVC file: namespace MyNamespace { [ServiceContract(Namespace = “AttributeSetAttributeService”)] [AspNetCompatibilityRequirements(RequirementsMode = […]

JavaScript cannot see declared variable?

I have a C# aspx page with this declaration: <asp:Button ID=”Button1″ runat=”server” Text=”Samples (Lab)” OnClientClick=”toggleLab(); return false;” />&nbsp; The toggleLab function is described in the document script section and is called just fine. In the same script section, before the functions, a global is defined, so the code is like this: var samplesOff; function toggleLab() […]

Why does my container lose its content after a setInterval div replacement in IE?

I have been developing a web page using chrome and ff. I recently was told it has to work in IE as well. I have already solved the IE double padding issue. The problem is the content of my “grid” disappears after the javascript setinterval causes the div to be replaced. This only happens when […]

onbeforeunload and asp:Update Panel in Safari and FireFox

I am working on a asp.net (framework 4) that has a requirement for the user to be notified if they are trying to leave the page without saving changes. Well I found a solution by calling the onbeforeunload function via JavaScript. Works great in IE but not in Firefox, Safari or Chrome. Now here is […]