.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links


View Complete Post

event.keyCode problem in Firefox and chrome

Posted By:      Posted Date: October 04, 2010    Points: 0   Category :ASP.Net

Following code is working in IE but not in Firefox and chorme

TextBox1.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('"+Button1.UniqueID+"').click();return false;}} else {return true}; "); 

More Related Resource Links

Has anyone experienced problems using a reorder list control in Chrome/Firefox?


I have three reorder lists on a page, one does not want to work. It is no different to the others, but is behaving like it is not enabled.

All working fine in IE 7 + 8.

Any ideas appreciated :)

Javascript fails in chrome and firefox, works fine in IE



I am customizing Newform.aspx i.e. hiding some fields, making other readonly etc. It works fine in IE but fails miserably in chrome and firefox i.e. readonly are no more readonly, hidden are no more hidden. Here is my code:

<script language="javascript" type="text/javascript">
    function autoFillFields()
       var ctrl = findacontrol("Reference Customer");
    var param = getURLParam('RefFromCust');   
    var properParam = replaceCharacters(param);
    ctrl.value = properParam;
    var ctrl = findacontrol("RefReqOpptyId");
    var param = getURLParam('OpptyId');   
    var properParam = replaceCharacters(param);
    ctrl.value = properParam;

    param = getURLParam('RefFromAE');
    properParam = replaceCharacters(param);
    setPeoplePicker("People Picker", properParam);
    hideFldCtrl("Approval Sta

Pre_Init event handler problem


Hi all my friends

   I have to masterpages for my home page.

1. The first is for the annonymous users which has the login controls. its name is General_Anonymous.master.

2. The second one is for the logged in users which has a logout button and it hasn't the login controls in it. its name is General_LoggedIn.master.

in my default.aspx page I wrote the following code

protected void Page_PreInit(object sender, EventArgs e)
            if (Session["SupId"] == null && Session["CustomerId"] == null)
                this.MasterPageFile = "~/Masters/General_Anonymous.master";
                this.MasterPageFile = "~/Masters/General_LoggedIn.master";

Visual Studio designer event problem


Hi there

I have a small issue that I'm sure others have experienced - but haven't yet found a solution / workaround for this.

When adding controls to Visual Studio in designer you normally get a event button (the yellow flash light) in the properties window.

But when you nest a button inside a placeholder (for example) you cannot mark the button from the designer - only the placeholder! When trying to go into "split-view" on the designer you'll be able to mark the button in the bottom of the designer - but only properties and not the event button appers in the properties window!

I know that you can go into codebehind and manually add the event but I thiink it is really tiresome to do so if I don't have to...

I had a small hope that VS2010 the issue would be gone but sadly it isn't...

Anyone ever found a solution for this one?

Kind regards Thomas

Autocompleteextender problem in google chrome

Hi, I've used autocompleteextender inside a repeater control. On OnClientItemSelected event of autocompleteextender i am setting some hidden field value to use it on server. The code is working fine in all browsers except google chrome. Actually when i traced the code, event is occuring and hidden field is getting value set but the hidden field value is not appearing on the server. On the server i got empty hidden field.  

Sharepoint 2010 List Added Event Problem

Hi All, I have created List Added Event Handler. In that Event I want to Add Custom Field in List as List is created. I get an Error "The Specified Program Requires    a newer version of windows" Is there ant solution for it. I have tried it also creating new instances of spweb and spsite rather than getting it from "Properties" Thanks Saumil Thakkar

TopNavFlyOuts won't display in IE but will display in FireFox, Chrome etc

My company decided it would like to add 1 level flyouts to the website which seems easy enough but I have an issue I just can't figure out. I changed the master to display 1 level and added CSS to format the flyouts. In Internet Explorer, the flyouts are a big blank white box and no text that can be clicked, no colors, nothing, but the width of the flyouts is just as expected and it's placed on the page as expected. So it picked up a couple of properties in the CSS but nothing else. In FireFox, Chrome and Safari, the flyouts are showing up just fine. This is just wacky to me. Has anyone run across? Any ideas? Thanks in advance.

collapsiblepanelextender problem with firefox

Hiiii Coders, I m trying to expand all the collpsible panels at the same time by clicking on expandall linkbutton and similarly i am trying to collapse all  collapsible panels by clicking on collapse all linkbutton. i have 4 collapsible panels. i have been using javascript code for that provided by sansan. It is working very much fine in Internet Explorer. But it does not work in Firefox. Here is my javascript code-<script type="text/javascript"> function TogglePanels(flag) { var panels = ["cpe1", "cpe2", "cpe3", "cpe4"]; for (var i = 0; i < panels.length; i++) if (flag) $find(panels[i])._doOpen(); else $find(panels[i])._doClose(); } </script> Here is my code for expandll and collapseall linkbuttons-<asp:LinkButton ID="L1" runat="server" Text="expand all" OnClientClick="TogglePanels(true);return false;"> </asp:LinkButton> <asp:LinkButton ID="L2" runat="server" Text="collapse all" OnClientClick="TogglePanels(false);return false;"> </asp:LinkButton> I don' know what is the problem plz provide code snippets as soon as poss as i m new to javascript. thanx and

Response.Redirect problem in Google Chrome

I'm building an ASP.NET 3.5 webapplication using VB.NET, and I'm having problems redirecting to another URL when using Google Chrome. Other browsers like IE and Firefox are fine.My data entry forms all have an OK and an Cancel button, which are both handled server-side. The Cancel button just redirects back to the originating page, while the OK button will add or update a database record and then redirect to the originating page.The redirect to the originating page is done by calling the following shared sub on a general utilities class in my appication: Shared Sub Redirect(ByVal p_sURL As String) Dim l_sURL As String = p_sURL.ToLower If Left(l_sURL, 1) = "~" Then Dim l_oControl As New System.Web.UI.Control l_sURL = l_oControl.ResolveUrl(l_sURL) End If If Left(l_sURL, 1) <> "/" Then If Left(l_sURL, 7) <> "http://" AndAlso Left(l_sURL, 8) <> "https://" Then l_sURL = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) & wsUtils.SiteRoot & l_sURL End If End If HttpContext.Current.Response.Redirect(l_sURL) 'HttpContext.Current.Response.Redirect(l_sURL, False) End Sub As you can see, I've tried using the extra argument in the Response.Redirect call, but that

Firefox 3 problem with Sys.Application.add_load

In the following aspx page, although the ffalert is always displayed, the ff1 alert is only displayed intermitently on a page refresh (about 7 out of 10 times). This works fine with FF2 and IE. FF3.aspx:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head id="hd" runat="server"> <title>FF3 Test</title> </head> <body> <form id="frm" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> FF3 Test <script type="text/javascript"> function page_load() { alert("ff31"); } window.onload = function () {Sys.Application.add_load(page_load); alert("ff30");} </script> </form> </body> </html>  

C# Problem with multiple SerialDataRecieved event handlers

Hi all, I'm relatively new to C# and have no formal programming experience so apologies in advance if the way I do things are bad practice etc - I generally implement things in a way which seems logical to me! As a small project I'm making a toy car which can drive itself, the problem I've currently got is reading data from two serial port devices at once. The way I tend to work is to write smaller applications to do one function and get that working before integrating it into a larger application which will pull all the functions together. I've written a "Serial_Port_Communications" class which allows you to pass a serial port object into it and then perform some typical functions: open a port, close it, read data, write data etc. Thats common code across all of my serial devices (they all need to do the same operation so why re-write it?) Then for each device I've got a class which handles the operations and data specific to it: GPS & Compass. Each of those two create instances of the Serial_Port_Communications class. In the GPS & Compass classes, they each have a SerialPort object which has an eventhandler assigned to it for when data is received e.g GPS.datareceived += & Compass.datareceived +=... They each work flawlessly when they run as the mini-applications i.e. I can Parse the GPS data that is received and I can read

Weird Paint Event Problem

I am creating a .net program which requires a rectangle to be drawn on the screen,  the code is triggered by a menu item click, which runs the code:    this->Paint += gcnew System::Windows::Forms::PaintEventHandler(this, &Form1::PaintForm);   this event draws a rectangle fill, then a rectangle line around it (anybody know how to make that one shape instead of two?) like this: Graphics^ g = this->CreateGraphics(); Pen^ blackPen = gcnew Pen(Color::Black); SolidBrush^ whiteBrush = gcnew SolidBrush(Color::White); Rectangle stage = Rectangle(70, 70, 339, 439); g->DrawRectangle(blackPen, 69, 69, 340, 440); g->FillRectangle(whiteBrush, stage) the code runs fine, but the shape will not appear (the screen won't blit) until I minimize the form, then restore it. I've tried all sorts of things like using e->Graphics-> Instead of the Graphics^ g = this->CreateGraphics();, and nothing seems to fix it. Any help? By the way, I'm fine with receiving code samples in codes other than c++.

dropdownlist - css - problem chrome


          <asp:Label ID="Label18" runat="server" Text="Vrsta kreditne kartice"></asp:Label></span><span
class="formw"><asp:DropDownList ID="DropDownList2" Selected="True" width="200px" runat="server">
              <asp:ListItem>Diners Club Card</asp:ListItem>

div.row {
  clear: both;
  padding-top: 5px;

div.row span.label {
  float: left;
  width: 175px;
  text-align: left;

div.row span.formw {
  float: left;
  width: 500px;
  text-align: left;
/*  margin:0 0 0 10px;*/


I have a

Printing Problem :- Style.Overflow property in Firefox


Hi All,

I have a web application which has two DIV, one is main and one is child. I am having  problem in printing multiple pages. There is a lot of data in the child DIV and i am using JavaScript functions to control the print functionality. When i print using window.print(), only the data on the main page currently being showed is printed. I further researched and checked out the Style.Overflow property.

Now i am using divMain.style.overflow = "visible"

After this the complete print comes. But in Firefox, the scroll bar disappears and only single page is left with no scroll bar

Now if after print i give divMain.style.overflow = "Auto" OR divMain.style.overflow = "Scroll", still the scroll bar doesn't come and if it comes then its inactive. I am unable to see the complete data on the page after the print is taken.

The problem is not coming in I.E and the full data with scroll bar is recovered in I.E.

Please help me how to get the normal page with full data and scroll bar after printing in Firefox. 




Printing Problem :- Style.Overflow property in Firefox


Hi All,

I have a web application which has two DIV, one is main and one is child. I am having  problem in printing multiple pages. There is a lot of data in the child DIV and i am using JavaScript functions to control the print functionality. When i print using window.print(), only the data on the main page currently being showed is printed. I further researched and checked out the Style.Overflow property.

Now i am using divMain.style.overflow = "visible"

After this the complete print comes. But in Firefox, the scroll bar disappears and only single page is left with no scroll

Grid view event problem


i call a sql



mydate <30   grid 1 color is red

mydate <45  grid 1 color is blue

mydate <450   grid 1 color is blue

it is apply on grid coloum how do it

Textbox WebControl Enabled/Disabled problem: Disabled controls looks great in Firefox but in IE they


Hi everyone,

I don't know if you face the same problem when your page logic has to set the enabled textbox's property to FALSE.  If i use FireFox to browse the page, my disbled controls are show with a dark-silver background color (perfect for me), but when i browse with IE, disabled or enabled textboxes are show the same way (no color differences).

Is there a way to manage controls appearance depending on the Enabled property?

I appreciate your support.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend