Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all,
am facing one issue on my website.
it was developed by Asp.net with c# language
the problem i rise you that,
i cant able to delete my gridview row value by using autogenerate delete button.
its only happen in the IE browser
but i can able to delete other browser like chrome and firefox etc...
please give me a solution for this, its very kind helpful for my future.

my code is:
XML
<asp:GridView ID="gvCLI" runat="server" AutoGenerateColumns="False"
             AllowPaging="True" DataKeyNames="CLI" onrowdeleting="delete" CssClass="text1nowidth"
                      Width="198px" BorderColor="#8D6B09" BorderStyle="Solid" OnPageIndexChanging="gvCLI_PageIndexChanging">
            <Columns>
                <asp:BoundField DataField="CLI" HeaderText="Number" >
                    <HeaderStyle BackColor="#8D6B09" ForeColor="White" />
                </asp:BoundField>
                <asp:CommandField ShowDeleteButton="True" >
                    <ControlStyle CssClass="text1nowidth" />
                    <HeaderStyle BackColor="#8D6B09" />
                </asp:CommandField>
            </Columns>
        </asp:GridView>



my delete code is:
C#
protected void delete(object sender, GridViewDeleteEventArgs e)
{
 
string dgoldcli = gvCLI.DataKeys[e.RowIndex].Value.ToString();
//new cli is zero 'since we want to delete it we send 0
 
string[] result = new string[2];
// we check before allocation at stored procedure
// if CLI is valid or not so no need to check here
 

clsCommon clsobj = new clsCommon();
result = clsobj.fnChangeTalkCLI(Session["talkuser_id"].ToString(), dgoldcli, "0");
 

if (result[0] == "1")
{
//successfully changed
lblStatus.Text = "Number unregistered successfully .";
//msg to display"
string cliresult;
cliresult = clsobj.getTalkCli(Session["talkuser_id"].ToString());
if (cliresult == "1")
{
DataTable dt = clsobj.returnCLI();
gvCLI.DataSource = dt;
gvCLI.DataBind();
}
 
else
{
lblStatus.Text = "Your registered numbers list is empty";

}
 

}
else
{
//error message
lblStatus.Text = result[1];
}
 
string strscript = null;
if (result[0] != "1")
{
//failed to alloc
strscript = "<script language=JavaScript>" + "alert(\"Cannot delete Number\")</script>";
if ((!ClientScript.IsStartupScriptRegistered("clientScript")))
{
ClientScript.RegisterStartupScript(this.GetType(), "clientScript", strscript);
}
}
}

thanks in advance..
Posted
Updated 30-Apr-14 1:03am
v3
Comments
thatraja 30-Apr-14 5:43am    
what's the error? include those details in your question always
stellus 30-Apr-14 6:19am    
am not recieved any errors.
when i click delete button, nothing will happen
thatraja 30-Apr-14 6:34am    
ok, share the code for the delete button
thatraja 30-Apr-14 6:54am    
Include this code in your question. where's try catch block? By that way you could spot & handles issues

See the following linkauto delete in gridview
[^]
 
Share this answer
 
v2
Comments
stellus 30-Apr-14 6:33am    
in my local machine it us working fine in IE browser
but when i hosted at live in IIS7 then it was
not working properly on IE
[no name] 30-Apr-14 6:50am    
ooh this is the problem, Then see it's perfectly hosted to your publish file or not. Or any kind of browser issue.
stellus 30-Apr-14 6:58am    
i have checked my hosting area in IIS
it was stating that perfectly
i thing it was a browser problem
even though i was checked browser compatibility code
then it was no use
[no name] 30-Apr-14 7:02am    
yes hope that. But check it again you may resolve that or post a new topic with new description
Hi,

Here is the solution for your problem, you need set borrower compatibility for your application, just try it out. It might work.

http://browsercompatibility.codeplex.com/[^]

Regards,
Praveen Nelge
 
Share this answer
 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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