ASP.NET web app not working on IE7

ASP.NET web app not working on IE7

am 15.01.2008 17:25:20 von 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" %>

Species Application




Select a Category:


DataSourceID="CategoryDataSource" CssClass="parkpark3"
DataTextField="Category"
DataValueField="CategoryID" SelectionMode="Multiple"
AppendDataBoundItems="True">
*Select Category asp:ListItem>

runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetCategory" TypeName="All_ResultsBLL"> asp:ObjectDataSource>


Select a Park:


DataSourceID="ParkDataSource" CssClass="parkpark3"
DataTextField="ParkName"
DataValueField="ParkCode" AppendDataBoundItems="True"
SelectionMode="Multiple">
*Select Park

runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetParkCode"
TypeName="All_ResultsBLL">

DataSourceID="ParkStatusDataSource"
DataTextField="ParkStatus" SelectionMode="Multiple"
DataValueField="tblParkStatus_LU_ParkStatusID"
AppendDataBoundItems="True">
*Select Status(es) asp:ListItem>

runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetParkStatus" TypeName="All_ResultsBLL">

DataSourceID="CombinedSpeciesDataSource"
DataTextField="Species_Descriptor"
SelectionMode="Multiple" DataValueField="SpeciesCode"
AppendDataBoundItems="True">
*Select Species

runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetSpecies" TypeName="All_ResultsBLL">

OnClick="ButtonSubmit_Click" Text="Search" />
OnClick="ButtonReset_Click" Text="Reset Search" />
AutoGenerateColumns="False"
DataSourceID="gvMajorDataSource"
OnPageIndexChanged="GridViewMajor_PageIndexChanged">

HeaderText="Category" SortExpression="Category" />
HeaderText="CategoryID" SortExpression="CategoryID" />
HeaderText="ParkName" SortExpression="ParkName" />
HeaderText="ParkCode" SortExpression="ParkCode" />
HeaderText="ParkStatus" SortExpression="ParkStatus" />
DataField="tblParkStatus_LU_ParkStatusID"
HeaderText="tblParkStatus_LU_ParkStatusID"

SortExpression="tblParkStatus_LU_ParkStatusID" /

HeaderText="SpeciesCode" SortExpression="SpeciesCode" />
HeaderText="Family" SortExpression="Family" />
HeaderText="ResidencyDetails" SortExpression="ResidencyDetails" />
HeaderText="AbundanceDetails" SortExpression="AbundanceDetails" />
HeaderText="NativityID" SortExpression="NativityID" />
HeaderText="Comments" SortExpression="Comments" />
HeaderText="AbundanceID" SortExpression="AbundanceID" />
HeaderText="ResidencyID" SortExpression="ResidencyID" />
HeaderText="FullLatinName" SortExpression="FullLatinName" />
HeaderText="CommonName" SortExpression="CommonName" />
HeaderText="StatusDetails" SortExpression="StatusDetails" />


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]" >



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

RE: ASP.NET web app not working on IE7

am 16.01.2008 07:00:01 von MohamadElarabiMCPD

You need to add a

tag to your page.

try placing this line right under your <@Page> tag


And close that at the bottom of your aspx by writing


Please share your findings. Thanks,

--
Mohamad Elarabi
MCP, MCTS, MCPD.


"Marisa" wrote:

> 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" %>
>

Species Application


>

>

Select a Category:


> > DataSourceID="CategoryDataSource" CssClass="parkpark3"
> DataTextField="Category"
> DataValueField="CategoryID" SelectionMode="Multiple"
> AppendDataBoundItems="True">
> *Select Category > asp:ListItem>
>

> > runat="server"
> OldValuesParameterFormatString="original_{0}"
> SelectMethod="GetCategory" TypeName="All_ResultsBLL"> > asp:ObjectDataSource>
>

>

Select a Park:


> > DataSourceID="ParkDataSource" CssClass="parkpark3"
> DataTextField="ParkName"
> DataValueField="ParkCode" AppendDataBoundItems="True"
> SelectionMode="Multiple">
> *Select Park
>

> > runat="server"
> OldValuesParameterFormatString="original_{0}"
> SelectMethod="GetParkCode"
> TypeName="All_ResultsBLL">

> > DataSourceID="ParkStatusDataSource"
> DataTextField="ParkStatus" SelectionMode="Multiple"
> DataValueField="tblParkStatus_LU_ParkStatusID"
> AppendDataBoundItems="True">
> *Select Status(es) > asp:ListItem>
>

> > runat="server"
> OldValuesParameterFormatString="original_{0}"
> SelectMethod="GetParkStatus" TypeName="All_ResultsBLL">
>

> > DataSourceID="CombinedSpeciesDataSource"
> DataTextField="Species_Descriptor"
> SelectionMode="Multiple" DataValueField="SpeciesCode"
> AppendDataBoundItems="True">
> *Select Species
>

> > runat="server"
> OldValuesParameterFormatString="original_{0}"
> SelectMethod="GetSpecies" TypeName="All_ResultsBLL">
>

> > OnClick="ButtonSubmit_Click" Text="Search" />
> > OnClick="ButtonReset_Click" Text="Reset Search" />
> > AutoGenerateColumns="False"
> DataSourceID="gvMajorDataSource"
> OnPageIndexChanged="GridViewMajor_PageIndexChanged">
>
> > HeaderText="Category" SortExpression="Category" />
> > HeaderText="CategoryID" SortExpression="CategoryID" />
> > HeaderText="ParkName" SortExpression="ParkName" />
> > HeaderText="ParkCode" SortExpression="ParkCode" />
> > HeaderText="ParkStatus" SortExpression="ParkStatus" />
> > DataField="tblParkStatus_LU_ParkStatusID"
> HeaderText="tblParkStatus_LU_ParkStatusID"
>
> SortExpression="tblParkStatus_LU_ParkStatusID" /
>
> > HeaderText="SpeciesCode" SortExpression="SpeciesCode" />
> > HeaderText="Family" SortExpression="Family" />
> > HeaderText="ResidencyDetails" SortExpression="ResidencyDetails" />
> > HeaderText="AbundanceDetails" SortExpression="AbundanceDetails" />
> > HeaderText="NativityID" SortExpression="NativityID" />
> > HeaderText="Comments" SortExpression="Comments" />
> > HeaderText="AbundanceID" SortExpression="AbundanceID" />
> > HeaderText="ResidencyID" SortExpression="ResidencyID" />
> > HeaderText="FullLatinName" SortExpression="FullLatinName" />
> > HeaderText="CommonName" SortExpression="CommonName" />
> > HeaderText="StatusDetails" SortExpression="StatusDetails" />
>

>

> > 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]" >

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