ASP.NET web app not working on IE7
am 15.01.2008 17:25:20 von MarisaHi!
I am a novice web developer working in C#, and have created a web app
using Visual Studio 2005, which works perfectly in FireFox, but in
IE7, the submit button simply doesn't work! The OnClick event does
not run. I have tried setting the AutoEventWireUp both to true and
false, to no avail. I am using an Access database, and will post my
code upon request. If someone could help me, I'd very much
appreciate
it.
Thanks,
Marisa
Here is my aspx:
<%@ Page Language="C#" AutoEventWireup="false"
CodeFile="Species_Search.aspx.cs" Inherits="Species_Search"
EnableEventValidation="false" %>
Species Application
Select a Category:
DataTextField="Category"
DataValueField="CategoryID" SelectionMode="Multiple"
AppendDataBoundItems="True">
asp:ListItem>
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetCategory" TypeName="All_ResultsBLL">
asp:ObjectDataSource>
Select a Park:
DataTextField="ParkName"
DataValueField="ParkCode" AppendDataBoundItems="True"
SelectionMode="Multiple">
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetParkCode"
TypeName="All_ResultsBLL">
DataTextField="ParkStatus" SelectionMode="Multiple"
DataValueField="tblParkStatus_LU_ParkStatusID"
AppendDataBoundItems="True">
asp:ListItem>
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetParkStatus" TypeName="All_ResultsBLL">
DataTextField="Species_Descriptor"
SelectionMode="Multiple" DataValueField="SpeciesCode"
AppendDataBoundItems="True">
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetSpecies" TypeName="All_ResultsBLL">
DataSourceID="gvMajorDataSource"
OnPageIndexChanged="GridViewMajor_PageIndexChanged">
HeaderText="tblParkStatus_LU_ParkStatusID"
SortExpression="tblParkStatus_LU_ParkStatusID" /
[Category], [CategoryID], [ParkName], [ParkCode], [ParkStatus],
[tblParkStatus_LU_ParkStatusID], [SpeciesCode], [Family],
[ResidencyDetails], [AbundanceDetails], [NativityID], [Comments],
[AbundanceID], [ResidencyID], [FullLatinName], [CommonName],
[StatusDetails] FROM [tblAll_Results2]" >
And my apsx.cs:
protected void ButtonSubmit_Click(object sender, EventArgs e)
{
if (sender is Button)
{
this.GridViewMajor.PageIndex = 0;
}
//This begins the creation of the information to put into the
select statement mentioned above.
StringBuilder sqlWhereClause = new StringBuilder();
//Default select statement for the Category ListBox
if (this.lsbCategory.SelectedIndex > 0)
{
string paramName = "CategoryID";
string columnName = "[CategoryID]";
TypeCode type = TypeCode.String;
//add the WHERE or And parts of the Query if needed
sqlWhereClause.Append(AddWhere(ref whereAdded));
sqlWhereClause.Append(columnName + " IN (");
//This portion is what allows the Listbox to operate as
SelectionMode = "Multiple"
int x = 0;
List
foreach (ListItem li in lsbCategory.Items)
{
if (li.Selected == true)
{
string selectLSBvalue = li.Value.ToString();
selectedItems.Add(" @" + paramName +
x.ToString());
ParamName(paramName + x.ToString(), type,
selectLSBvalue);
x++;
}
}
sqlWhereClause.Append(String.Join(", ",
selectedItems.ToArray()));
sqlWhereClause.Append(")");
}
//SelectedValue for Park, builds the select statment for the
Park Listbox
if (this.lsbPark.SelectedIndex > 0)
{
string paramName = "ParkCode";
string columnName = "[ParkCode]";
TypeCode type = TypeCode.String;
//add the WHERE or And parts of the Query if needed
sqlWhereClause.Append(AddWhere(ref whereAdded));
sqlWhereClause.Append(columnName + " IN (");
int x = 0;
List
foreach (ListItem li in lsbPark.Items)
{
if (li.Selected == true)
{
string selectLSBvalue = li.Value.ToString();
selectedItems.Add(" @" + paramName +
x.ToString());
ParamName(paramName + x.ToString(), type,
selectLSBvalue);
x++;
}
}
sqlWhereClause.Append(String.Join(", ",
selectedItems.ToArray()));
sqlWhereClause.Append(")");
}
//SelectedValue for ParkStatus
if (this.lsbParkStatus.SelectedIndex > 0)
{
string paramName = "ParkStatus";
string columnName = "[ParkStatusID]";
TypeCode type = TypeCode.String;
//add the WHERE or And parts of the Query if needed
sqlWhereClause.Append(AddWhere(ref whereAdded));
sqlWhereClause.Append(columnName + " IN (");
int x = 0;
List
foreach (ListItem li in lsbParkStatus.Items)
{
if (li.Selected == true)
{
string selectLSBvalue = li.Value.ToString();
selectedItems.Add(" @" + paramName +
x.ToString());
ParamName(paramName + x.ToString(), type,
selectLSBvalue);
x++;
}
}
sqlWhereClause.Append(String.Join(", ",
selectedItems.ToArray()));
sqlWhereClause.Append(")");
}
if (this.lsbSpecies.SelectedIndex > 0)
{
string paramName = "SpeciesCode";
string columnName = "[SpeciesCode]";
TypeCode type = TypeCode.String;
//add the WHERE or And parts of the Query if needed
sqlWhereClause.Append(AddWhere(ref whereAdded));
sqlWhereClause.Append(columnName + " IN (");
int x = 0;
List
foreach (ListItem li in lsbSpecies.Items)
{
if (li.Selected == true)
{
string selectLSBvalue = li.Value.ToString();
selectedItems.Add(" @" + paramName +
x.ToString());
ParamName(paramName + x.ToString(), type,
selectLSBvalue);
x++;
}
}
sqlWhereClause.Append(String.Join(", ",
selectedItems.ToArray()));
sqlWhereClause.Append(")");
}