ASP.NET - javascript function button click even not support in firefox

Asked By msakt
10-Feb-12 09:02 AM
javascript function button click even not support in firefox
  dipa ahuja replied to msakt
10-Feb-12 10:27 AM
Use the onClientClick event

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="IsEmpty();" />
 
<script type="text/ecmascript">
 
function IsEmpty() {
 
  var name = document.getElementById("<%= TextBox1.ClientID %>").value;
  if (name == "") {
    alert("Name can't be empty");
  }
}
</script>
 
 

  kalpana aparnathi replied to msakt
10-Feb-12 01:28 PM
hi,

use http://jquery.com/ for this. The click event exposed by jQuery is designed to be cross browser compatible and you'll likely find it works more consistently than what you're currently using.


Your method will then become:

 function ExecuteLink(linkID)
{
   $
("#" + linkID).click();
}
Create New Account
help
Net hi friends Any one send frequently asked Important questions in C# .Net, ADO .Net, Asp .Net and Sql Server. . . . . . . . tx in Advance. . . . . . Hi, Find this. . (B)What is an IL? (B A) What is scavenging? (B) What are different types of caching using cache object of ASP.NET? (B) How can you cache different version of same page using ASP.NET cache object? (A) How will implement Page Fragment Caching? (B) Can you compare ASP.NET sessions with classic ASP? (B) Which are the various modes of storing ASP.NET session
in Sql server as var_name int How do you separate business logic while creating an ASP.NET application? There are two level of asp.net debugging 1. Page level debugging For this we have to edit the page level debugging The control itself will take care of the date display How can you deploy an asp.net application ? You can deploy an ASP.NET Web application using any one of the following three deployment options. a) Deployment using VS
Migration from ASP to ASP.net How to convert ASP site to ASP.NET site using C# http: / / www.asp.net / downloads / archived-v11 / migration-assistants / asp-to-aspnet hi, ASP.NET framework is very much different from unstrucured ASP and there is no correct way to
Tracing in ASP.NET? hi all, what is tracing? how to achieve tracing in asp.net? different ways of doing tracing? thanks and regards Aman Khan hi. . Tracing in ASP.NET 2.0 Tracing is a way to monitor the execution of your ASP.NET application. You can record exception details and program flow in a way that doesn't
session is user based mean u can differentiate login user in different way • Process independent. ASP.NET session state is able to run in a separate process from the ASP.NET host process. If session state is in a separate process, the ASP.NET process can come and go while the session state process remains available. Of course, you ASP, too. • Support for server farm configurations. By moving to an out-of-process model, ASP.NET also solves the server farm problem. The new out-of-process model allows all servers