473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Error Only in Firefox

asp.net 2/C#/VS2005

I have a webform that contains gridview that is databound to a dataset
maintained in session state. Users can enter values into textboxes and
add to the grid. For each row in the grid, there is a command field
called Delete...it allows them to remove the entries if necessary. I
can add just fine from both IE and Firefox, and I can delete just fine
from IE. But when I try to delete a row from Firefox, I get the
following error...
Thre is no row at position 0
....I am handling the delete in the gridview's RowDeleting handler.
Below is the code...
protected void grdMyGrid_RowDeleting(object sender,
GridViewDeleteEventArgs e)
{

((DataSet)this.Session["MyDataSet"]).Tables["MyTable"].Rows[e.RowIndex].Delete();

this.grdMyGrid.DataSource=((DataSet)this.Session["MyDataSet"]);
this.grdMyGrid.DataMember="MyTable";
this.grdMyGrid.DataBind();
}
....the first line inside the function block is what throws the error.
In debug mode I can see that e.RowIndex is always equal to 0. So why
does this work fine in IE but not in Firefox? Why am I getting the
error when using Firefox?

TIA

May 24 '07 #1
1 1947
On May 24, 12:47 pm, Joey <joey.pow...@topscene.comwrote:
asp.net 2/C#/VS2005

I have a webform that contains gridview that is databound to a dataset
maintained in session state. Users can enter values into textboxes and
add to the grid. For each row in the grid, there is a command field
called Delete...it allows them to remove the entries if necessary. I
can add just fine from both IE and Firefox, and I can delete just fine
from IE. But when I try to delete a row from Firefox, I get the
following error...

Thre is no row at position 0

...I am handling the delete in the gridview's RowDeleting handler.
Below is the code...

protected void grdMyGrid_RowDeleting(object sender,
GridViewDeleteEventArgs e)
{

((DataSet)this.Session["MyDataSet"]).Tables["MyTable"].Rows[e.RowIndex].Del*ete();

this.grdMyGrid.DataSource=((DataSet)this.Session["MyDataSet"]);
this.grdMyGrid.DataMember="MyTable";
this.grdMyGrid.DataBind();

}

...the first line inside the function block is what throws the error.
In debug mode I can see that e.RowIndex is always equal to 0. So why
does this work fine in IE but not in Firefox? Why am I getting the
error when using Firefox?

TIA
NEW INFO:

I have discovered that the error is being caused because the table in
my dataset (in Session) is empty when the GridView's Row_Deleting
event fires -if I'm using Firefox. It apparently gets emptied out
somehow before the Row_Deleting function when using Firefox??? I know
that it takes the value initially, because the row shows in the table
after doing a databind, while using Firefox.

To troubleshoot, I checked Rows.Count for the Session's dataset's
table, from within the top of the Row_Deleting function. When I use
Internet Explorer, Count returns 1. When I use Firefox, Count returns
0. This is the exact same compiled/published code.

What's going on here?

May 24 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chuck Martin | last post by:
I am having a most frustrating problem that references, web searches, and other resources are no help so far in solving. Basically, I'm trying to design a pop-up window to be called with a funciton...
7
by: debugger | last post by:
hello, Question, on page load, I populate an existing drop down with createElement and appendChild. It works fine so far. BUT I want to automatically select some option from this populated drop...
4
by: gattaca8 | last post by:
The following script works fine in IE...but gives me a "sBox has no properties" error in Firefox. sBox is only used in the below method. function addTop (sectId) { sBox =...
3
by: Brian A | last post by:
I have written some Javascript that works perfectly in Firefox - no errors reported. The dreaded MSIE 6 produces nothing but a long line of 'undefinedundefinedundefinedundefinedundefined ....'...
0
by: Wayne Deleersnyder | last post by:
Hi All, I'm hoping to try to solve this error. I'm currently putting together a little web app, but I need it to work under both IE6, IE7, Mozilla, etc... Although the formatting is off for...
5
by: Geoff Cox | last post by:
hello, I am writing Javascript using Homesite but if I try to use Firefox v2 as the browser I get the error message "Firefox doesn't know how to open the address, because the protocol (c)...
1
by: nancyisbell | last post by:
I used the following test01.xml file below to exercise the cnlUnit01.xslt. <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="cnlUnit01.xslt"?> <cnlUnitXsl unitDataFile="111111"/> ...
2
by: germ | last post by:
doing a simple page webmethod call an a page via PageMethods works fine in ie7 & opera9 the same call on firefox ( and I assume netscape ) generates the following error : Error: " nsresult:...
1
by: jarret | last post by:
Hello all. First off, I am not a programmer so this question is not related to a problem that I created myself. I am not quite sure what is going on, but I do know that C++ is screwing up. Now I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.