ASP.NET web app not working on IE7

M

Marisa

Hi!

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" %>
<h2>Species Application</h2>
<br />
<p>Select a Category:</p>
<asp:ListBox ID="lsbCategory" runat="server"
DataSourceID="CategoryDataSource" CssClass="parkpark3"
DataTextField="Category"
DataValueField="CategoryID" SelectionMode="Multiple"
AppendDataBoundItems="True">
<asp:ListItem Value="-1">*Select Category</
asp:ListItem>
</asp:ListBox>
<asp:ObjectDataSource ID="CategoryDataSource"
runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetCategory" TypeName="All_ResultsBLL"></
asp:ObjectDataSource>
<br />
<p>Select a Park:</p>
<asp:ListBox ID="lsbPark" runat="server"
DataSourceID="ParkDataSource" CssClass="parkpark3"
DataTextField="ParkName"
DataValueField="ParkCode" AppendDataBoundItems="True"
SelectionMode="Multiple">
<asp:ListItem Value="-1">*Select Park</asp:ListItem>
</asp:ListBox>
<asp:ObjectDataSource ID="ParkDataSource"
runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetParkCode"
TypeName="All_ResultsBLL"></asp:ObjectDataSource>
<asp:ListBox ID="lsbParkStatus" runat="server"
DataSourceID="ParkStatusDataSource"
DataTextField="ParkStatus" SelectionMode="Multiple"
DataValueField="tblParkStatus_LU_ParkStatusID"
AppendDataBoundItems="True">
<asp:ListItem Value="-1">*Select Status(es)</
asp:ListItem>
</asp:ListBox>
<asp:ObjectDataSource ID="ParkStatusDataSource"
runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetParkStatus" TypeName="All_ResultsBLL">
</asp:ObjectDataSource>
<asp:ListBox ID="lsbSpecies" runat="server"
DataSourceID="CombinedSpeciesDataSource"
DataTextField="Species_Descriptor"
SelectionMode="Multiple" DataValueField="SpeciesCode"
AppendDataBoundItems="True">
<asp:ListItem Value="-1">*Select Species</asp:ListItem>
</asp:ListBox>
<asp:ObjectDataSource ID="CombinedSpeciesDataSource"
runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetSpecies" TypeName="All_ResultsBLL">
</asp:ObjectDataSource>
<asp:Button ID="ButtonSubmit" runat="server"
OnClick="ButtonSubmit_Click" Text="Search" />
<asp:Button ID="ButtonReset" runat="server"
OnClick="ButtonReset_Click" Text="Reset Search" />
<asp:GridView ID="GridViewMajor" runat="server"
AutoGenerateColumns="False"
DataSourceID="gvMajorDataSource"
OnPageIndexChanged="GridViewMajor_PageIndexChanged">
<Columns>
<asp:BoundField DataField="Category"
HeaderText="Category" SortExpression="Category" />
<asp:BoundField DataField="CategoryID"
HeaderText="CategoryID" SortExpression="CategoryID" />
<asp:BoundField DataField="ParkName"
HeaderText="ParkName" SortExpression="ParkName" />
<asp:BoundField DataField="ParkCode"
HeaderText="ParkCode" SortExpression="ParkCode" />
<asp:BoundField DataField="ParkStatus"
HeaderText="ParkStatus" SortExpression="ParkStatus" />
<asp:BoundField
DataField="tblParkStatus_LU_ParkStatusID"
HeaderText="tblParkStatus_LU_ParkStatusID"

SortExpression="tblParkStatus_LU_ParkStatusID" /

<asp:BoundField DataField="SpeciesCode"
HeaderText="SpeciesCode" SortExpression="SpeciesCode" />
<asp:BoundField DataField="Family"
HeaderText="Family" SortExpression="Family" />
<asp:BoundField DataField="ResidencyDetails"
HeaderText="ResidencyDetails" SortExpression="ResidencyDetails" />
<asp:BoundField DataField="AbundanceDetails"
HeaderText="AbundanceDetails" SortExpression="AbundanceDetails" />
<asp:BoundField DataField="NativityID"
HeaderText="NativityID" SortExpression="NativityID" />
<asp:BoundField DataField="Comments"
HeaderText="Comments" SortExpression="Comments" />
<asp:BoundField DataField="AbundanceID"
HeaderText="AbundanceID" SortExpression="AbundanceID" />
<asp:BoundField DataField="ResidencyID"
HeaderText="ResidencyID" SortExpression="ResidencyID" />
<asp:BoundField DataField="FullLatinName"
HeaderText="FullLatinName" SortExpression="FullLatinName" />
<asp:BoundField DataField="CommonName"
HeaderText="CommonName" SortExpression="CommonName" />
<asp:BoundField DataField="StatusDetails"
HeaderText="StatusDetails" SortExpression="StatusDetails" />
</Columns>
</asp:GridView>
<asp:AccessDataSource ID="gvMajorDataSource" runat="server"
DataFile="~/App_Data/Species_Lists.mdb" SelectCommand="SELECT
[Category], [CategoryID], [ParkName], [ParkCode], [ParkStatus],
[tblParkStatus_LU_ParkStatusID], [SpeciesCode], [Family],
[ResidencyDetails], [AbundanceDetails], [NativityID], [Comments],
[AbundanceID], [ResidencyID], [FullLatinName], [CommonName],
[StatusDetails] FROM [tblAll_Results2]" ></asp:AccessDataSource>


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<string> selectedItems = new List<string>();
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<string> selectedItems = new List<string>();
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<string> selectedItems = new List<string>();
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<string> selectedItems = new List<string>();
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(")");
}
 
M

Mohamad Elarabi [MCPD]

You need to add a <form> tag to your page.

try placing this line right under your <@Page> tag
<form id="form1" runat="server">

And close that at the bottom of your aspx by writing </form>

Please share your findings. Thanks,

--
Mohamad Elarabi
MCP, MCTS, MCPD.


Marisa said:
Hi!

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" %>
<h2>Species Application</h2>
<br />
<p>Select a Category:</p>
<asp:ListBox ID="lsbCategory" runat="server"
DataSourceID="CategoryDataSource" CssClass="parkpark3"
DataTextField="Category"
DataValueField="CategoryID" SelectionMode="Multiple"
AppendDataBoundItems="True">
<asp:ListItem Value="-1">*Select Category</
asp:ListItem>
</asp:ListBox>
<asp:ObjectDataSource ID="CategoryDataSource"
runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetCategory" TypeName="All_ResultsBLL"></
asp:ObjectDataSource>
<br />
<p>Select a Park:</p>
<asp:ListBox ID="lsbPark" runat="server"
DataSourceID="ParkDataSource" CssClass="parkpark3"
DataTextField="ParkName"
DataValueField="ParkCode" AppendDataBoundItems="True"
SelectionMode="Multiple">
<asp:ListItem Value="-1">*Select Park</asp:ListItem>
</asp:ListBox>
<asp:ObjectDataSource ID="ParkDataSource"
runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetParkCode"
TypeName="All_ResultsBLL"></asp:ObjectDataSource>
<asp:ListBox ID="lsbParkStatus" runat="server"
DataSourceID="ParkStatusDataSource"
DataTextField="ParkStatus" SelectionMode="Multiple"
DataValueField="tblParkStatus_LU_ParkStatusID"
AppendDataBoundItems="True">
<asp:ListItem Value="-1">*Select Status(es)</
asp:ListItem>
</asp:ListBox>
<asp:ObjectDataSource ID="ParkStatusDataSource"
runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetParkStatus" TypeName="All_ResultsBLL">
</asp:ObjectDataSource>
<asp:ListBox ID="lsbSpecies" runat="server"
DataSourceID="CombinedSpeciesDataSource"
DataTextField="Species_Descriptor"
SelectionMode="Multiple" DataValueField="SpeciesCode"
AppendDataBoundItems="True">
<asp:ListItem Value="-1">*Select Species</asp:ListItem>
</asp:ListBox>
<asp:ObjectDataSource ID="CombinedSpeciesDataSource"
runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetSpecies" TypeName="All_ResultsBLL">
</asp:ObjectDataSource>
<asp:Button ID="ButtonSubmit" runat="server"
OnClick="ButtonSubmit_Click" Text="Search" />
<asp:Button ID="ButtonReset" runat="server"
OnClick="ButtonReset_Click" Text="Reset Search" />
<asp:GridView ID="GridViewMajor" runat="server"
AutoGenerateColumns="False"
DataSourceID="gvMajorDataSource"
OnPageIndexChanged="GridViewMajor_PageIndexChanged">
<Columns>
<asp:BoundField DataField="Category"
HeaderText="Category" SortExpression="Category" />
<asp:BoundField DataField="CategoryID"
HeaderText="CategoryID" SortExpression="CategoryID" />
<asp:BoundField DataField="ParkName"
HeaderText="ParkName" SortExpression="ParkName" />
<asp:BoundField DataField="ParkCode"
HeaderText="ParkCode" SortExpression="ParkCode" />
<asp:BoundField DataField="ParkStatus"
HeaderText="ParkStatus" SortExpression="ParkStatus" />
<asp:BoundField
DataField="tblParkStatus_LU_ParkStatusID"
HeaderText="tblParkStatus_LU_ParkStatusID"

SortExpression="tblParkStatus_LU_ParkStatusID" /

<asp:BoundField DataField="SpeciesCode"
HeaderText="SpeciesCode" SortExpression="SpeciesCode" />
<asp:BoundField DataField="Family"
HeaderText="Family" SortExpression="Family" />
<asp:BoundField DataField="ResidencyDetails"
HeaderText="ResidencyDetails" SortExpression="ResidencyDetails" />
<asp:BoundField DataField="AbundanceDetails"
HeaderText="AbundanceDetails" SortExpression="AbundanceDetails" />
<asp:BoundField DataField="NativityID"
HeaderText="NativityID" SortExpression="NativityID" />
<asp:BoundField DataField="Comments"
HeaderText="Comments" SortExpression="Comments" />
<asp:BoundField DataField="AbundanceID"
HeaderText="AbundanceID" SortExpression="AbundanceID" />
<asp:BoundField DataField="ResidencyID"
HeaderText="ResidencyID" SortExpression="ResidencyID" />
<asp:BoundField DataField="FullLatinName"
HeaderText="FullLatinName" SortExpression="FullLatinName" />
<asp:BoundField DataField="CommonName"
HeaderText="CommonName" SortExpression="CommonName" />
<asp:BoundField DataField="StatusDetails"
HeaderText="StatusDetails" SortExpression="StatusDetails" />
</Columns>
</asp:GridView>
<asp:AccessDataSource ID="gvMajorDataSource" runat="server"
DataFile="~/App_Data/Species_Lists.mdb" SelectCommand="SELECT
[Category], [CategoryID], [ParkName], [ParkCode], [ParkStatus],
[tblParkStatus_LU_ParkStatusID], [SpeciesCode], [Family],
[ResidencyDetails], [AbundanceDetails], [NativityID], [Comments],
[AbundanceID], [ResidencyID], [FullLatinName], [CommonName],
[StatusDetails] FROM [tblAll_Results2]" ></asp:AccessDataSource>


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<string> selectedItems = new List<string>();
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<string> selectedItems = new List<string>();
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<string> selectedItems = new List<string>();
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<string> selectedItems = new List<string>();
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(")");
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top