У меня есть вопрос о перемещении веб-сайта с одной МКС на другую и об ошибке, которая идет с ним. Когда я добавляю новый веб-сайт как приложение, похожее на старую ситуацию, при открытии я получаю следующее сообщение об ошибке:
Я понятия не имею, как я могу это исправить, я смотрю его в Google и прочее, но мойноу-кодинг - это то, что мне нужно в правильном направлении. поэтому я надеюсь, что некоторые из вас могут помочь мне сделать эту работу.
код, который я получаю:
Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.
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.
Stack Trace:
[IndexOutOfRangeException: Index was outside the bounds of the array.]
Incidentensysteem.Index.Page_Load(Object sender, EventArgs e) in C:\Users\Michel\Documents\Incidentensysteem\Incidentensysteem\Index.aspx.cs:32
System.Web.UI.Control.OnLoad(EventArgs e) +106
System.Web.UI.Control.LoadRecursive() +68
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3785
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3429.0
**Full Code:**
namespace Incidentensysteem
{
public partial class Index : System.Web.UI.Page
{
private Klant klant;
private string medewerkerNaam;
protected void Page_Load(object sender, EventArgs e)
{
string datumString = "2000-01-01";
//string datumString = datum.Year + "-" + datum.Month + "-" + datum.Day;
if (ObjectDataSource3.SelectParameters.Contains(ObjectDataSource3.SelectParameters["Datum"]))
{
ObjectDataSource3.SelectParameters["Datum"].DefaultValue = datumString;
}
if (ObjectDataSource4.SelectParameters.Contains(ObjectDataSource4.SelectParameters["Datum"]))
ObjectDataSource4.SelectParameters["Datum"].DefaultValue = datumString;
//Random random = new Random();
//LabelIncidentZoeken.Text = random.Next().ToString();
this.klant = null;
string v = medewerkerNaam = Request.ServerVariables["AUTH_USER"].Split('\\')[1];
//this.medewerkerNaam = "Michel";
if (Request.QueryString.Count > 0)
{
ObjectDataSource2.SelectParameters["Klant_ID"].DefaultValue = Request.QueryString[0];
ObjectDataSource2.DataBind();
ObjectDataSource3.SelectParameters["Klant_ID"].DefaultValue = Request.QueryString[0];
ObjectDataSource3.DataBind();
ObjectDataSource4.SelectParameters["Klant_ID"].DefaultValue = Request.QueryString[0];
ObjectDataSource4.DataBind();
ObjectDataSource5.SelectParameters["Klant_ID"].DefaultValue = Request.QueryString[0];
ObjectDataSource5.DataBind();
showControls();
}
if (TextBoxZoeken.Text.Length > 0)
zoeken(DropDownListZoeken.SelectedValue, GridView1.SelectedIndex);