2016-07-04 25 views
0

我正在這個網站的asp.net c#工作,其中的數據是通過SQL服務器獲取的。直到星期六,它工作的很好,但現在我得到了DIV在數據中生成的數據,這些數據來自於國家和城市以及州下拉等不同部分的數據庫。我附上了一個圖像來顯示您的div。 Image regarding the error 無論何時即使我正在編輯數據,它也會在整個數據中生成此標記,並且正在被存儲。div的越來越生成,而從數據庫綁定數據在c#asp.net

請幫助我與此。提前感謝。

代碼文件是

protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e) 
    { 
     if (ddlCountry.SelectedValue == "") 
     { 
      ddlState.SelectedIndex = 0; 
      ddlCity.SelectedIndex = 0; 
      ddlState.Enabled = false; 
      ddlCity.Enabled = false; 
      ddlCountrycode.SelectedIndex = 0; 
      ddlCountrycode.Enabled = false; 
     } 
     else 
     { 
      ddlState.Enabled = true; 

      DataSet ds = Data.spGetStateByCountryId(Convert.ToInt32(ddlCountry.SelectedValue)); 
      ddlState.DataSource = ds; 
      ddlState.DataTextField = "StateName"; 
      ddlState.DataValueField = "State_Id"; 
      ddlState.DataBind(); 

      DataSet ds1 = Data.spGetCountrycode(Convert.ToInt32(ddlCountry.SelectedValue)); 
      ddlCountrycode.DataSource = ds1; 
      ddlCountrycode.DataTextField = "CountryCode"; 
      ddlCountrycode.DataValueField = "Country_Id"; 
      ddlCountrycode.DataBind(); 

      ddlCity.SelectedIndex = 0; 
      ddlCity.Enabled = false; 
     } 
    } 

和我正在填充與此代碼下拉。

private void PopulateContinentsDropDownList() 
    { 
     DataSet ds = Data.spGetCountries(); 
     ddlCountry.DataSource = ds; 
     ddlCountry.DataTextField = "CountryName"; 
     ddlCountry.DataValueField = "Country_Id"; 
     ddlCountry.DataBind(); 

     ListItem liCountry = new ListItem("Select Country"); 
     ddlCountry.Items.Insert(0, liCountry); 

     ListItem liState = new ListItem("Select State"); 
     ddlState.Items.Insert(0, liState); 

     ListItem liCity = new ListItem("Select City"); 
     ddlCity.Items.Insert(0, liCity); 

     ListItem liCountryCode = new ListItem("Country Code"); 
     ddlCountrycode.Items.Insert(0, liCountryCode); 

     ddlState.Enabled = false; 
     ddlCity.Enabled = false; 
    } 

的地方,這一切都是添加的頁面圖像是​​3210

+0

你怎麼能指望某人用這些細節來回答這個問題? – Imad

+0

對不起,我的cs文件代碼爲 –

+0

對不起,我已經編輯了這個問題的詳細信息 –

回答

0

額外的div可能是SQL注入攻擊或其他惡意代碼(尤其是如果所引用該網站是不是你)的結果。嘗試並在乾淨的環境中安裝代碼以查看問題是否存在。

+0

http://stackoverflow.com/a/37027345/6138103。這工作對我來修剪我的代碼,擺脫我額外的div –