Tag: asp.net

Check whether console is present

I am writing a plugin. For that I will log a few things, say warnings, necc things, etc. To log them I will use console, but there can be an error if some browser doesn’t support console. To handle this error, I am thinking of using this code: if (typeof console == ‘undefined’) console = […]

Match two fields with jQuery validate plugin

I have an e-mail field, and a confirm e-mail field. I need to validate both of them to make sure their values match. Is there a way to add a rule to match those two fields?

Handling dates with Asp.Net MVC and KnockoutJS

I recently started working with KnockoutJs and quickly realized using the default Json(myModelWithADate) resulted in the default json encoding of \/Date(-62135578800000)\/ With a bit of research I located four potential ways to handle the display of my dates in dom elements. 1) Create a binding that handles the conversion from the Json date to the […]

Reconciling ASP.NET script bundles and source maps

Is there any way to set up the default System.Web.Optimization.ScriptBundle to generate source maps for the bundled and minified files? Is there an equivalent solution, other than having to pre-generate the bundles and source maps before each build?

Run javascript function after Postback

How do i run a javascript event after a postback within an updatepanel

How to call a client side javascript function after a specific UpdatePanel has been loaded

How is it possible to call a client side javascript method after a specific update panel has been loaded? Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler) does not work for me because this will fire after ANY update panel finishes loading, and I can find no client side way to find which is the one ScriptManager.GetCurrent(Page).AsyncPostBackSourceElementID AsyncPostBackSourceElementID does not work for […]

How can I read the client's machine/computer name from the browser?

How can I read the client’s machine/computer name from the browser? Is it possible using JavaScript and/or ASP.NET?

Pass C# ASP.NET array to Javascript array

Does anyone know how to pass a C# ASP.NET array to a JavaScript array? Sample code will also be nice. Sorry if I was vague earlier guys. The question is actually quite simple. Let’s say for simplicity that in my aspx.cs file I declare: int [] numbers = new int[5]; Now I want to pass […]

jQuery Ajax call – Set variable value on success

This question already has an answer here: How do I return the response from an asynchronous call? 23 answers

How to call code behind server method from a client side javascript function?

I am having an javascript function for a HTML button click event in aspx page. And a server Method in its code behind page. Now i want to call the server method from the javascript function with some parameters only when the HTML button is clicked by the user. Please don’t change this scenario and […]