Hi ,
I have got a textbox and Ajax autocompleteextender in my web page.I have no problem at local Dev Machine.When i upload this page to remote host getting "Authentication failed. ExceptionType":"System.InvalidOperationException" this error.
Here is my codes ;
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="~/WebService.asmx" />
</Services>
</asp:ScriptManager>
<div>
<asp:TextBox ID="txtAra" runat="server"></asp:TextBox>
<cc1:autocompleteextender id="AutoCompleteExtender1" runat="server" servicepath="~/WebService.asmx"
servicemethod="IsmeGoreGetir" minimumprefixlength="1" targetcontrolid="txtAra"
>
</cc1:autocompleteextender>
</div>
</form>
And then web service side ;
OleDbConnection con;
OleDbCommand cmd;
OleDbDataReader dr;
[WebMethod(EnableSession = true)]
public string[] IsmeGoreGetir(string prefixText, int count)
{
con = new OleDbConnection("Provider=Microsoft.Jet.OleDb.4.0;Data Source=" + Server.MapPath("~/App_Data/nobetRehber.mdb"));
cmd = new OleDbCommand( "Select * from Rehber Where AD like '" + prefixText.ToUpper() + "%'",con);
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
if (con.State != ConnectionState.Open)
con.Open();
DataTable dt = new DataTable();
da.Fill(dt);
string[] items = new string[dt.Rows.Count];
int i = 0;
foreach (DataRow dr in dt.Rows)
{
items.SetValue(dr["AD"].ToString(), i);
i++;
}
con.Close();
return items;
}