Click here to Skip to main content
15,894,955 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: inherit page in asp.net Pin
N a v a n e e t h4-May-07 2:29
N a v a n e e t h4-May-07 2:29 
AnswerRe: inherit page in asp.net Pin
kashasd4-May-07 2:29
kashasd4-May-07 2:29 
AnswerRe: inherit page in asp.net Pin
Sandeep Akhare4-May-07 2:36
Sandeep Akhare4-May-07 2:36 
GeneralRe: inherit page in asp.net Pin
badgrs4-May-07 3:15
badgrs4-May-07 3:15 
GeneralRe: inherit page in asp.net Pin
Sandeep Akhare4-May-07 3:21
Sandeep Akhare4-May-07 3:21 
AnswerRe: inherit page in asp.net Pin
Sherin Iranimose8-May-07 1:10
Sherin Iranimose8-May-07 1:10 
QuestionEnter key press and the CheckBoxList Pin
ToddHileHoffer4-May-07 1:52
ToddHileHoffer4-May-07 1:52 
Questionautocomplete extender [modified] Pin
Sandeep_Kumbhar4-May-07 1:52
Sandeep_Kumbhar4-May-07 1:52 
I am using ajax autocompleteextender. I have declared the service method in the user control itself instead of declaring it in aspx page. But the extender does not work .How can i do it? I want to declare it in ascx page,as i will be reusing the component. i am developing in vs 2005

my master page script
=====================
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" EnablePartialRendering="true"/asp:ScriptManager>

my aspx page where i am inheriting masterpage
==============================================

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="frmTestAuto.aspx.cs" Inherits="frmTestAuto" Title="Untitled Page" %>
<%@ Register Src="ctlAutoExtender.ascx" TagName="ctlAutoExtender" TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

&lt;asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"&gt;
&lt;asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server" /asp:ScriptManagerProxy&gt;
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td>TEST AUTO PAGE</td>
</tr>
<tr>
<td>uc1:ctlAutoExtender ID="CtlAutoExtender1" runat="server" /</td>
</tr>
<tr>
<td>Footer</td>
</tr>
</table>
</asp:Content>

my ascx page
=============
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ctlAutoExtender.ascx.cs" Inherits="ctlAutoExtender" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
&lt;asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server"></asp:ScriptManagerProxy&gt;
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td>
&lt;asp:TextBox runat="server" ID="myTextBox" Width="300" /&gt;

&lt;ajaxToolkit:AutoCompleteExtender runat="server" ID="autoComplete1" TargetControlID="myTextBox" Enabled="true"
ServiceMethod="GetCompletionList" ServicePath="ctlAutoExtender.ascx.cs" MinimumPrefixLength="3"
CompletionInterval="1000" EnableCaching="true"
CompletionSetCount="12"/&gt;
</td>
</tr>
</table>


my ascx.cs page
===============

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Web.Services;
using System.Web.Script.Services;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ScriptService]

public partial class ctlAutoExtender : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{

}

[WebMethod]
[ScriptMethod]
public static string[] GetCompletionList(string prefixText, int count)
{
string sql = String.Format("select clt_tVLongNm from mclient where clt_tVLongNm like @companyname + '%'");

List<string> companyList = new List<string>();

using (SqlConnection connection = new SqlConnection("server=192.168.2.57;uid=sa;pwd=d28rg6yp;database=fnocash_report"))

using (SqlCommand command = new SqlCommand(sql, connection))
{
connection.Open();
command.Parameters.AddWithValue("@companyname", prefixText);
using (SqlDataReader reader = command.ExecuteReader())
{
while (reader.Read())
{
companyList.Add(reader.GetString(0));
}
}
}
return companyList.ToArray();
}
}


please help me out, i am trying this since 2 weeks.
-- modified at 8:02 Friday 4th May, 2007


-- modified at 8:06 Friday 4th May, 2007


-- modified at 8:08 Friday 4th May, 2007


-- modified at 8:08 Friday 4th May, 2007


-- modified at 2:23 Saturday 5th May, 2007

Sandeep Kumbhar
AnswerRe: autocomplete extender Pin
Ibuprofen4-May-07 4:31
Ibuprofen4-May-07 4:31 
QuestionImage in a DataGrid Pin
Paul McGann4-May-07 0:26
professionalPaul McGann4-May-07 0:26 
AnswerRe: Image in a DataGrid Pin
Chetan Ranpariya4-May-07 0:29
Chetan Ranpariya4-May-07 0:29 
GeneralRe: Image in a DataGrid Pin
Paul McGann4-May-07 2:18
professionalPaul McGann4-May-07 2:18 
GeneralRe: Image in a DataGrid Pin
Arun.Immanuel4-May-07 2:43
Arun.Immanuel4-May-07 2:43 
GeneralRe: Image in a DataGrid Pin
Chetan Ranpariya6-May-07 21:59
Chetan Ranpariya6-May-07 21:59 
Questionhow to refresh the data Pin
Kissy163-May-07 23:50
Kissy163-May-07 23:50 
AnswerRe: how to refresh the data Pin
Paddy Boyd3-May-07 23:51
Paddy Boyd3-May-07 23:51 
GeneralRe: how to refresh the data Pin
Kissy164-May-07 0:48
Kissy164-May-07 0:48 
GeneralRe: how to refresh the data Pin
marky7774-May-07 2:52
marky7774-May-07 2:52 
QuestionGridview Questions Pin
kallileo3-May-07 23:40
kallileo3-May-07 23:40 
AnswerRe: Gridview Questions Pin
Spunky Coder4-May-07 0:18
Spunky Coder4-May-07 0:18 
AnswerRe: Gridview Questions Pin
Chetan Ranpariya4-May-07 0:27
Chetan Ranpariya4-May-07 0:27 
GeneralRe: Gridview Questions Pin
kallileo4-May-07 1:20
kallileo4-May-07 1:20 
Questiondatalist control and navigation panel Pin
tradakad3-May-07 22:22
tradakad3-May-07 22:22 
AnswerRe: datalist control and navigation panel Pin
Spunky Coder3-May-07 22:30
Spunky Coder3-May-07 22:30 
GeneralRe: datalist control and navigation panel Pin
tradakad3-May-07 22:46
tradakad3-May-07 22:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.