Click here to Skip to main content
15,909,747 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hi all

i have this problem , i am using edit int list view, how i can use edit insert in th

----The DetailsView 'DetailsViewBranch' fired event ModeChanging which wasn't handled.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: The DetailsView 'DetailsViewBranch' fired event ModeChanging which wasn't handled.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
-----------
Posted
Comments
Sergey Alexandrovich Kryukov 13-Nov-11 22:04pm    
What's the sense in this question without a code sample? Also, indicate the lines where exception is thrown.
--SA

Looks like your proxy is not matching between client and server code. Try after refreshing the proxy code, either by updating the service reference or by building new proxy class using 'wsdl' command.
 
Share this answer
 
:((Where is the code? :(( how can we give you solution for an incomplete question? Here I'm throwing you a thread, fix it yourself

The DetailsView 'DetailsView1' fired event ModeChanging which wasn't handled[^]
 
Share this answer
 
Comments
ahmad zrein 14-Nov-11 1:54am    
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Branch : System.Web.UI.Page
{

protected void Page_Load(object sender, EventArgs e)
{
String queryStringBranch = "SELECT * FROM Branch";
DataSet dsBranch = GetData(queryStringBranch);
if (dsBranch.Tables.Count > 0)
{
DetailsViewBranch.DataSource = dsBranch;
DetailsViewBranch.DataBind();
}
else
{
//Message.Text = "Unable to connect to the database.";
}
}

#region
DataSet GetData(String queryString)
{

// Retrieve the connection string stored in the Web.config file.
String connectionString = "Data Source=nancyintdatabase.db.8547965.hostedresource.com; Initial Catalog=nancyintdatabase; User ID=nancyintdatabase; Password=NANint001;";

DataSet ds = new DataSet();

try
{
// Connect to the database and run the query.
SqlConnection connection = new SqlConnection(connectionString);
SqlDataAdapter adapter = new SqlDataAdapter(queryString, connection);

// Fill the DataSet.
adapter.Fill(ds);
}
catch
{
// The connection failed. Display an error message.
//Message.Text = "Unable to connect to the database.";
}
return ds;
}
#endregion
#region
protected void NextButton_Click(object sender, EventArgs e)
{
Response.Redirect(Request.RawUrl);
}
protected void PreviousButton_Click(object sender, EventArgs e)
{

}
protected void CustomerDetailView_DataBound(object sender, EventArgs e)
{

// Get the pager row.
DetailsViewRow pagerRow = DetailsViewBranch.BottomPagerRow;

// Get the Label controls that display the current page information
// from the pager row.
Label pageNum = (Label)pagerRow.Cells[0].FindControl("PageNumberLabel");
Label totalNum = (Label)pagerRow.Cells[0].FindControl("TotalPagesLabel");

if ((pageNum != null) && (totalNum != null))
{
// Update the Label controls with the current page values.
int page = DetailsViewBranch.DataItemIndex + 1;
int count = DetailsViewBranch.DataItemCount;

pageNum.Text = page.ToString();
totalNum.Text = count.ToString();
}
}
protected void DetailsViewBranch_PageIndexChanging(object sender, DetailsViewPageEventArgs e)
{
}
#endregion
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900