Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all 5678 articles
Browse latest View live

Cannot create page method "GetCompletionList"?

$
0
0

Hi,

I am using the link below to try and do an autocomplete textbox:

http://www.asp.net/ajaxlibrary/act_AutoComplete_Simple.ashx

When I try to add an autocompletepagemethod I get the error "Cannot create page method "GetCompletionList"? because no CodeBehind or Codefile was found.

I added the AutoComplete.aspx file from the tool kit to my project. Any ideas?

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><asp:AutoCompleteExtender ID="AutoCompleteExtender" runat="server"
        DelimiterCharacters="" Enabled="True" ServicePath="" TargetControlID="TextBox1"
        UseContextKey="True"></asp:AutoCompleteExtender>


Error: Could not load file or assembly 'AjaxControlToolkit, Version=1.0.11119.20010

$
0
0

Hi,

We have successfully integrated the AjaxControlToolkit into our beta website.  I installed the latest release for .NET Frameowrk 2.0 from here:  http://www.codeplex.com/AtlasControlToolkit/Release/ProjectReleases.aspx?ReleaseId=8513

 Everything was going swimmingly until this morning when our test server started giving us this error when trying to load a page that contains an Ajax control from the toolkit: 

Parser Error

Description:An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load file or assembly 'AjaxControlToolkit, Version=1.0.11119.20010, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Source Error:

Line 1:  <%@ Control Language="vb" AutoEventWireup="false" CodeBehind="KeywordTabbedContainer.ascx.vb" Inherits="Share.KeywordTabbedContainer" %>
Line 2: <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> Line 3: <%@ Register TagPrefix="wv" TagName="Keywords" src="KeywordChooser.ascx" mce_src="KeywordChooser.ascx" %>

Source File: /controls/KeywordTabbedContainer.ascx   Line:1

Assembly Load Trace: The following information can be helpful to determine why the assembly 'AjaxControlToolkit, Version=1.0.11119.20010, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' could not be loaded

I decided to reinstall the toolkit with the .vsi file and, as before, the version on my referenced c:\Program Files\Microsoft Visual Studio 8\Common7\IDE\AjaxControlToolkit\SampleWebSite\Bin\AjaxControlToolkit.dll is 1.0.10618.0.  As far as I can tell, I did not make any changes to the toolkit (I have the code as well).

The project still runs fine on my local machine and we're stumped.  I have two questions:

1.  Firstly - any help with solving the above error is greatly appreciated.

2.  Why is my version still 1.0.10618.0 when I know I installed the latest, which is supposed to be version1.0.11119.0?

Thank you,

Mark

Ajax Autocomplete not working

$
0
0

Hi,

I am using the code below to try and get the ajax autocomplete to work but nothing happens when I start typing? When I start typing "sta" it doesnt show me suggestions?

Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel

' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
<System.Web.Script.Services.ScriptService()> _<System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _<ToolboxItem(False)> _
Public Class AutoComplete
    Inherits System.Web.Services.WebService<WebMethod()> _
    Public Shared Function GetCompletionList(ByVal prefixText As String, ByVal count As Integer, ByVal contextKey As String) As String()
        ' Create array of movies
        Dim movies() As String = {"Star Wars", "Star Trek", "Superman", "Memento", "Shrek", "Shrek II"}

        ' Return matching movies
        Return (
            From m In movies
    Where (m.StartsWith(prefixText, StringComparison.CurrentCultureIgnoreCase))
           Select m).Take(count).ToArray()
    End Function


End Class
<%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %><%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title>Untitled Page</title></head><body><form id="form1" runat="server"><asp:ScriptManager ID="ScriptManager1" runat="server" ><services><asp:ServiceReference Path="~/AutoComplete.asmx" /></services></asp:ScriptManager><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><asp:AutoCompleteExtender ID="TextBox1_AutoCompleteExtender" runat="server" 
        TargetControlID="TextBox1" ServicePath="~/AutoComplete.asmx" ServiceMethod="GetCompletionList" MinimumPrefixLength="3" CompletionSetCount="12" EnableCaching="true"></asp:AutoCompleteExtender></form>   </body></html>



Error: does not contain a script with hash code "3cf12cf1'".

$
0
0

We are seeing quite a few of these errors on our site.

AjaxControlToolkit

Assembly "AjaxControlToolkit, Version=4.1.7.123, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" does not contain a script with hash code "3cf12cf1'".

DeserializeScriptEntries

   at AjaxControlToolkit.ToolkitScriptManager.DeserializeScriptEntries(String serializedScriptEntries, Boolean loaded)
   at AjaxControlToolkit.ToolkitScriptManager.OutputCombinedScriptFile(HttpContext context)
   at AjaxControlToolkit.ToolkitScriptManager.OnInit(EventArgs e)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)



Loosing focus after autopostback in Listview

$
0
0

I have a listview with 5 textboxes. In the first box I have a javascript that riggers the autopostback after 6 characters are entered. I need it to jump to the next textfield after that or just maintain focus, so that after they hit the tab button they will tab to the next field. I hope this isn't too vague.

Newbie question ... asp.net forms / update panel / back button?

$
0
0

Hi,

I'm developing a shopping cart "like" asp.net site.
I'm storing the shoppers cart and cart items in a sql db.

I've opted to place an update panel on the master page header to display the current shoppers basket summary (x items)
For this I've also placed the Script Manager on the master page.

I've got a Product.aspx page which displays a selected product. From their I have an asp.net button calling a code behind section which is adding the product to the database and calling the UpdatePanel.Update() to refresh the basket summary section.

This appears to work well however here's the issue.
As the user presses the ADD TO CART button a few times the basket increments as expected. When the user presses the BACK button they are led back through the same product page multiple times (once for each time they pressed ADD TO CART, and the cart summary section counts back as it itterates through the page history. I would prefer if the Add To Cart button incremented the basket but the browser Back button jumped to the page the user was one before visiting this product page... the product page should almost behave like a single page application ....

How do I achieve this?

MultiView Control with UpdatePanel Issue

$
0
0

Hi,

I am using MultiView Control and i am using UserControl in the view.

Here the issue is,  when i click on the button inside usercontrol,it is not firing.

(but when i remove the update panel it works fine),How to accomplish this using update.

Here is the code :

------------------------

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %><%@ Register Src="~/Calculator.ascx" TagName="Calculator" TagPrefix="Cal" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head id="Head1" runat="server"><title>Sample Tabbed Page</title><link href="StyleSheet.css" rel="stylesheet" type="text/css" /></head><body><form id="form1" runat="server"><div><asp:ScriptManager ID="Sc1" runat="server"></asp:ScriptManager><asp:UpdatePanel ID="up1" runat="server"><ContentTemplate><asp:Menu
            ID="Menu1"
            Width="168px"
            runat="server"
            Orientation="Horizontal"
            StaticEnableDefaultPopOutImage="False"
            OnMenuItemClick="Menu1_MenuItemClick"><Items><asp:MenuItem ImageUrl="~/selectedtab.GIF" Text=" " Value="0"></asp:MenuItem><asp:MenuItem ImageUrl="~/unselectedtab.GIF" Text=" " Value="1"></asp:MenuItem><asp:MenuItem ImageUrl="~/unselectedtab.GIF"  Text=" " Value="2"></asp:MenuItem></Items></asp:Menu><asp:MultiView
            ID="MultiView1"
            runat="server"
            ActiveViewIndex="0"  ><asp:View ID="Tab1" runat="server"  ><table width="600" height="400" cellpadding=0 cellspacing=0><tr valign="top"><td class="TabArea" style="width: 600px"><br /><br />
                            TAB VIEW 1
                            INSERT YOUR CONENT IN HERE
                            CHANGE SELECTED IMAGE URL AS NECESSARY</td></tr></table></asp:View><asp:View ID="Tab2" runat="server"><Cal:Calculator ID="Calculator1" runat="server" /></asp:View><asp:View ID="Tab3" runat="server"><table width="600px" height="400px" cellpadding=0 cellspacing=0><tr valign="top"><td class="TabArea" style="width: 600px"><br /><br />
                          TAB VIEW 3
                          INSERT YOUR CONENT IN HERE
                          CHANGE SELECTED IMAGE URL AS NECESSARY</td></tr></table></asp:View></asp:MultiView></div></ContentTemplate><Triggers><%--   <asp:AsyncPostBackTrigger EventName="click" />--%></Triggers></asp:UpdatePanel></form></body></html>

UserControl

--------------------

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="Calculator.ascx.vb" Inherits="Calculator" %><script type="text/javascript" language="JavaScript">
    function get_round(X) { return Math.round(X * 100) / 100 }

    function showpay() {
        if ((document.getElementById('<%=loan.ClientID%>').value == "") || (document.getElementById('<%=months.ClientID%>').value == "") || (document.getElementById('<%=rate.ClientID%>').value == "")) {
            document.getElementById('<%=pay.ClientID%>').value = "Incomplete data";
            document.getElementById('<%=tot_amount.ClientID%>').value = "Incomplete data";
            document.getElementById('<%=tot_interest.ClientID%>').value = "Incomplete data";
            document.getElementById('<%=yearly_interest.ClientID%>').value = "Incomplete data";
            document.getElementById('<%=interest_pa.ClientID%>').value = "Incomplete data";
            document.getElementById('<%=interest_pm.ClientID%>').value = "Incomplete data";

        }
        else {


            var princ = document.getElementById('<%=loan.ClientID%>').value;
            var term = document.getElementById('<%=months.ClientID%>').value;
            var intr = document.getElementById('<%=rate.ClientID%>').value / 1200;
            var yrs = document.getElementById('<%=months.ClientID%>').value / 12;

            document.getElementById('<%=pay.ClientID%>').value = get_round(princ * intr / (1 - (Math.pow(1 / (1 + intr), term))));
            document.getElementById('<%=tot_amount.ClientID%>').value = get_round(document.getElementById('<%=pay.ClientID%>').value * term);
            document.getElementById('<%=tot_interest.ClientID%>').value = get_round(document.getElementById('<%=tot_amount.ClientID%>').value / yrs);
            document.getElementById('<%=yearly_interest.ClientID%>').value = get_round(document.getElementById('<%=tot_interest.ClientID%>').value / yrs);
            document.getElementById('<%=interest_pa.ClientID%>').value = get_round(document.getElementById('<%=yearly_interest.ClientID%>').value / princ * 100);
            document.getElementById('<%=interest_pm.ClientID%>').value = get_round((document.getElementById('<%=yearly_interest.ClientID%>').value / princ * 100) / 12);

        }
    }
</script><div id="Property_form"><div class="EMICALCdiv"><fieldset><h2>
            EMI Calculator</h2><table align="center" class="EMICCALCtblnew"><tbody><tr><td width="20%"><span class="label">Loan Amount<font color="#FF0000">*</font> </span></p></td><td style="margin-left: 5px" width="20%"><asp:TextBox ID="loan" runat="server" Width="200px" CssClass="propertydropdown"></asp:TextBox></td></tr><tr><td><p class="label">
                            Loan Tenure (Months)<font color="#FF0000" face="Verdana" size="2">*</font></p></td><td><asp:TextBox ID="months" runat="server" Width="200px" CssClass="propertydropdown"></asp:TextBox></td></tr><tr><td><p class="label">
                            Interest Rate (Reducing)<font color="#FF0000" face="Verdana" size="2">*</font></p></td><td><asp:TextBox ID="rate" runat="server" Width="200px" CssClass="propertydropdown"></asp:TextBox></td><td>
                        %</td></tr><tr><td><p class="label">
                            Monthly Payment (EMI)</p></td><td><p align="center"><input type="button" id="button" name="button" value="Click" class="normallink" onclick="showpay()" /><%--       <asp:Button ID="button" runat="server" Text="Click" OnClientClick="return showpay();" />--%></p></td></tr><tr><td><span class="label">Calculated Monthly EMI </span></td><td><asp:TextBox ID="pay" runat="server" Width="200px" CssClass="propertydropdown"></asp:TextBox></td></tr><tr><td><span class="label">Total Amount with Interest </span></td><td><asp:TextBox ID="tot_amount" runat="server" Width="200px" CssClass="propertydropdown"></asp:TextBox></td></tr><tr><td><span class="label">Flat Interest Rate PA </span></td><td width="109"><asp:TextBox ID="interest_pa" runat="server" Width="200px" CssClass="propertydropdown"></asp:TextBox></td></tr><tr><td><span class="label">Flat Interest Rate PM </span></td><td><asp:TextBox ID="interest_pm" runat="server" Width="200px" CssClass="propertydropdown"></asp:TextBox></td></tr><tr><td><span class="label">Total Interest Amount </span></td><td width="109"><asp:TextBox ID="tot_interest" runat="server" Width="200px" CssClass="propertydropdown"></asp:TextBox></td></tr><tr><td><span class="label">Yearly Interest Amount </span></td><td><asp:TextBox ID="yearly_interest" runat="server" Width="200px" CssClass="propertydropdown"></asp:TextBox></td></tr></tbody></table></fieldset></div></div>


ModalPopUp Coming at one point and not coming at another

$
0
0

Here is the scenario, I have 3 Modal popextender on my web page, all are for different use, pops up on different buttons click.

Somehow, for a particular type of user, this modal popup extender not working.

we are using basic method of PopUp extender to show-hide it.

We have handled all the exception, but still somehow

its not working. We have a thought that may be because of that particular type of user, somewhere Javascript behind Modalpop extender

is failing...

I am posting first time on this forum... so please forgive me if I am not very clear here...


Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'

$
0
0

Hi
I am working on asp.net framewrok 4.0

I have included scriptmanager in my master page.

But i am getting following error

Server Error in '/MyApp.Web' Application.

Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.

Source Error:

Line 14: <body>
Line 15:     <form id="form1" runat="server">Line 16:      <asp:ScriptManager runat="server" ID="smScriptManager" EnablePageMethods="true" AjaxFrameworkMode="Enabled">Line 17:     </asp:ScriptManager>
Line 18:     

Source File: d:\Applications\test\Default\Presentation\MyApp\MyApp.Web\MainMaster.Master   Line:16

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' could not be loaded.

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Stack Trace:

[FileNotFoundException: Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.]
   System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type) +0
   System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) +525
   System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) +19
   System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments) +315
   System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg) +208
   System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) +1171
   System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType) +146
   System.Web.UI.AssemblyCache.GetAjaxFrameworkAssemblyAttribute(Assembly assembly) +103
   System.Web.UI.ScriptManager.get_DefaultAjaxFrameworkAssembly() +422
   System.Web.UI.ScriptManager..ctor() +30
   ASP.mainmaster_master.__BuildControlsmScriptManager() in d:\Applications\test\Default\Presentation\MyApp\MyAPP.Web\MainMaster.Master:16
   ASP.mainmaster_master.__BuildControlform1() in d:\Applications\test\Default\Presentation\MyApp\MyApp.Web\MainMaster.Master:15
   ASP.mainmaster_master.__BuildControlTree(mainmaster_master __ctrl) in d:\Applications\test\Default\Presentation\MyApp\MyApp.Web\MainMaster.Master:1
   ASP.mainmaster_master.FrameworkInitialize() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\myappsl.web\8c610097\ee4abe5\App_Web_inqqlwfz.1.cs:0
   System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +1349
   System.Web.UI.Page.ApplyMasterPage() +75
   System.Web.UI.Page.PerformPreInit() +210
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1700


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1




I dont know from where to load that assembly 'System.Windows, Version=2.0.5.0'
Or where I am missing any settings

I am working on visual studio 2010 and .net framwork 4.0


Any help is appreciated.

Thanks in advance.



Ajax Modal popup Extender - Infinite Scroll bar Issue in IE 8

$
0
0

I am using Ajax Modal popup Extender(version4.0.30319) in my application.After Modal popup extender comes up, an infinte scroll bar is appearing in IE browser.

when i use scroll bars to see the popup the pagekeep on incrementing and I am ending up with unable to view the popup.

how to resolve it?

IDE: VS 2010.

This happens only in IE. Whereas firefox does not have any issues.


AJAX AutoComplete Extender Not Working

$
0
0

Hello Guys,

To Start with I want to implement suggestion dropdown in my textbox based upon the records stored in my sql server database..

I googled and found out that Ajax autocomplete extender will be my best bet..

So I started with this article:

http://www.aspsnippets.com/Articles/AJAX-AutoCompleteExtender-Example-in-ASPNet.aspx

It uses Northwind Database and when I downloaded the sample.. It was working good as well..

The problem started when I tried to implement the same concept in a separate project..

To My horrors It was not working.. I tried to figure out and found that I was using ajax toolkit version 1.0.x in my project while in the downloaded sample it was 3.0.x

So I copy pasted the ajax toolkit files from the downloaded sample and and pasted over in the bin folder of my project..

also I added reference to .dll file with my project and removed the older ajax toolkit toolbars..

I tried to make the project similar to downloaded sample.. But still its not working.. It is simply opening and showing no suggestions while typing,,,

Please HELP how to overcome this problem.. I HAVE to implement this on large scale,, So what could be the possible reasons..

What I am missing..

Note: I have not used ajax much.. Not have indepth knowledge of it as well..

Frown

AutoCompleteExtender nested in GridView not working in Chrome -- UPDATED

$
0
0

UPDATE 6/24/13:

Hello,

I have determined that the dropdown is working in Chrome after all, but Chrome's interpretation of the CSS styling is FUBAR. Here's my CSS for the autocomplete list itself. I'm using "!important" so much because the autocomplete extender has lots of inline styles that I can't track down:

.handlerAutoComplete
{
    max-height: 150px;
    width: 180px !important;
    overflow: auto;
    position: relative !important;
    display:block !important;
    position: relative !important;
    visibility: visible !important;
    width: 161px;
    z-index: 1000 !important;
    left: 0px !important;
    top: 5px !important;
}

Instead of making my autocomplete list appear relative to the textbox that called it, as it should, Chrome is making the list appear relative to the GridView in general, which means it gets shoved to the very bottom of the screen. Does know of a way to fix this?

ORIGINAL POST:

Hello,

I have an AutoCompleteExtender connected to an editable textbox, nested inside a GridView. In Firefox and IE, the code works as it should: the user types a few characters, and a list of suggestions appears. However, this does not happen in Chrome 27.

I created the AutoCompleteExtender following the directions given here: http://www.asp.net/ajaxlibrary/act_AutoComplete_Simple.ashx, and if I use the extender by itself (outside of a GridView) in Chrome, it works fine. Unfortunately, I need it to work within a GridView for this project, so if anyone has a solution, it would be much appreciated. My code is below. FYI, I am coding in C#, using Ajax Control Toolkit 4.1.7.429, in Visual Studio 2010 (if that last matters at all.)

In my markup:

<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager><asp:GridView ...><asp:TemplateField ...><ItemTemplate><asp:TextBox ID="dogHandlerEdit" runat="server"></asp:TextBox><ajaxToolkit:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server"
TargetControlID="dogHandlerEdit" ServiceMethod="GetCompletionList" UseContextKey="True"
CompletionListCssClass="handlerAutoComplete"></ajaxToolkit:AutoCompleteExtender></ItemTemplate></asp:TemplateField></asp:GridView>

And then in my code-behind:

[System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]
    public static string[] GetCompletionList(string prefixText, int count, string contextKey)
    {
        List<string> lstList = new List<string>();

        // Create data context
        DataContext dc = new DataContext( ... );

        // Get dog info
        var people = (from p in dc.PPL_Peoples
                      //where (p.PPL_FirstName.Contains(prefixText) == true || p.PPL_LastName.Contains(prefixText) == true) && p.PPL_Active == true
                      where (p.PPL_FirstName.StartsWith(prefixText) == true || p.PPL_LastName.StartsWith(prefixText) == true) && p.PPL_Active == true
                      orderby p.PPL_LastName ascending, p.PPL_FirstName ascending
                      select new
                      {
                          p.PPL_FirstName,
                          p.PPL_LastName

                      }).Take(30);

        // Add names to the list
        foreach (var person in people)
        {
            lstList.Add(person.PPL_FirstName + " " + person.PPL_LastName);
        }

        return lstList.ToArray();
    }

Thanks in advance for your help.

Dynamic ConfirmButtonExtender?

$
0
0

Is it possible to have a single generic ConfirmButtonExtender (and ModalPopupExtender)?

I have a page with variuos goodies (Accordion, GridViews, FormViews, etc) and want to be able to invoke the ConfirmButtonExtender from linkbuttons that may be located anywhere on the page. In theory this should work by changing the TargetControlID of both the ConfirmButtonExtender and ModalPopupExtender in code behind when I click one of the linkbuttons.

However, I have a LinkButton ("myLB") that is located in the EmptyDataTemplate of one of my GridViews. When I click on it, I get an error because the TargetControlID cannot be found (presumably because the Confirm and Modal are not located inside the EmptyDataTemplate).

I believe that the TargetControlID property is of String type, and when I pass the LinkButton's ID, I get the error.

I have tried various ways of doing this, but am really struggling. The code sample below is not perfectly dynamic (because I am referencing the specific [linkbutton] control in the code, but even this doesn't work)

protected void GetConfirmation(object sender, EventArgs e)
        {
            LinkButton myLinkButton = (LinkButton)sender;
            ConfirmButtonExtender1.TargetControlID = ((LinkButton)gv_PH.Controls[0].Controls[0].FindControl(myLinkButton.ID)).ToString();
            ModalPopupExtender1.TargetControlID = ((LinkButton)gv_PH.Controls[0].Controls[0].FindControl(myLinkButton.ID)).ToString();

        }

Any ideas?

Thanks

 

How to use ajax show a gridvew

$
0
0

Hi:

    I have a gridview with many data, I want to use ajax , anyone  can give me some suggesting ,thank you!

Ajax Autocomplete not firing when context key is set?

$
0
0

Hi,

I am trying to pass an additional parameter so that when the user selects a state from the drop down, the textbox with autocomplete will only show results where it = the selected state. For some reason the function getcompletionlist is not firing when this is added?

Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel
Imports System.Data.SqlClient

' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the            following   line.
<System.Web.Script.Services.ScriptService()> _<System.Web.Services.WebService(Namespace:="http://tempuri.org/")> _<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _<ToolboxItem(False)> _
Public Class AutoComplete1
Inherits System.Web.Services.WebService<WebMethod()> _
Public Function GetCompletionList(prefixText As String, count As Integer, Contextkey As String) As String()
    Try
        Dim Con As SqlConnection
        Dim cmd As SqlCommand
        Con = New SqlConnection
        'Dim test As String
        'test = Contextkey
        Con.ConnectionString = ""
        Con.Open()

        cmd = New SqlCommand
        cmd.Connection = Con
        cmd.CommandText = "SELECT NPI, [Entity Type Code], [Provider Last Name (Legal Name)], [Provider First Name], [Provider Business Mailing Address City Name] FROM NPIData WHERE [Provider Last Name (Legal Name)] LIKE @Provider + '%'"
        cmd.Parameters.AddWithValue("@Provider", prefixText)
        Dim customers As List(Of String) = New List(Of String)
        Dim reader As SqlDataReader = cmd.ExecuteReader()

        While reader.Read
            customers.Add(reader("Provider Last Name (Legal Name)").ToString + ", " + reader("Provider First Name").ToString + ", " + reader("Provider Business Mailing Address City Name").ToString)

        End While
        Con.Close()

        Return customers.ToArray
    Catch ex As Exception

    End Try

End Function

End Class

 

<asp:TextBox ID="TextBox1" runat="server" Height="27px" Width="375px"></asp:TextBox><asp:AutoCompleteExtender ID="AutoCompleteExtender" runat="server" 
    DelimiterCharacters="" Enabled="True" ServicePath="AutoComplete.asmx"  
    ServiceMethod="GetCompletionList" TargetControlID="TextBox1" 
    MinimumPrefixLength="2" UseContextKey="true" ContextKey="State"></asp:AutoCompleteExtender>

Protected Sub StateDropDown_SelectedIndexChanged(sender As Object, e As EventArgs) Handles        StateDropDown.SelectedIndexChanged
    AutoCompleteExtender.ContextKey = StateDropDown.Text
End Sub




AsyncFileUpload getting Unresponsive Script on FireFox 22.0

$
0
0

On FireFox 21.0 it works fine.
Last night, version 22.0 was released, and now all pages with a AsyncFileUpload control gets the "Unresponsive Script" popup.
I'm trying to recompile with the new June release, but having a hard time getting the new events/properties of the control to show up in the IDE (like StoreToAzure, and UploadStart event)
I have customers complaining about the our site while using FireFox.
If I can't get this to work, I guess I'll have to rewrite the pages and use another File Upload.

If you go to the Sample Site: http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AsyncFileUpload/AsyncFileUpload.aspx using FireFox version 22.0, it gets the Unresonsive Script error, too.

Does anyone have any ideas??

-Scott

Autocomplete populate textbox based on selection

$
0
0

Hi,

Is there a way that on the autocomplete extender I can know when a user has selected an item?

AjaxFileUpload: how to customize blob name when uploading to Azure?

$
0
0

The update of AjaxFileUpload to support uploading directly to Azure blob storage is very cool.  However, it looks like the uploaded blob name is always the client file name, relative to the container name specified in the AzureContainerName property.  It would be nice if we could set the blob name to something else, so that we could use the virtual blob directory feature or rename to avoid collisions with duplicate names.  Azure doesn't support renaming of an existing blob, so this would have to be done before the upload starts.  Short of building a custom version of the Toolkit, I can't tell if this can be accomplished using the existing server-side or client-side event callbacks.  Any suggestions?

Upgrading from vs2005 to 2012 ,Getting

$
0
0

Hi All.

I am upgrading my application from VS2005 to VS2012

when i select Target Framework = Farmework 4.0

I am getting below error. 

0x800a139e - JavaScript runtime error: Sys.InvalidOperationException: A control is already associated with the element.

In VS2005 , i am using ajax extensions 1.0 and telerik controls.

i don't know which is causing the above error.

when i select Target Framework = Farmework 2.0 it is working fine.

Could yout please help to resove the error?

Thank You,

Naga Varma

Unable to get the ID of the selected item in an autocomplete textbox

$
0
0

Hi,

I am using the following code to populate textbox2 with the selection from textbox1. Is there a way that I can just populate it with the row/record ID? The code below just copies the text from textbox1 to textbox2.

<script language="javascript" type="text/javascript">
      function getSelected(source, eventArgs) {
          document.getElementById('<%=TextBox2.ClientID %>').value = eventArgs.get_value();
      }</script>
cmd.CommandText = "SELECT NPI, [Entity Type Code], [Provider Last Name (Legal Name)], [Provider First Name], [Provider Business Mailing Address City Name], [Provider Business Mailing Address State Name], [Provider Business Mailing Address Postal Code] FROM NPIData WHERE     ([Provider Business Mailing Address State Name] = @State) AND ([Provider Last Name (Legal Name)] LIKE N'%' + @Provider + N'%') ORDER BY [Provider First Name]"
            cmd.Parameters.AddWithValue("@Provider", prefixText)
            cmd.Parameters.AddWithValue("@State", contextKey)
            Dim customers As List(Of String) = New List(Of String)
            Dim reader As SqlDataReader = cmd.ExecuteReader()


            While reader.Read
                customers.Add(reader("Provider Last Name (Legal Name)").ToString + ", " + reader("Provider First Name").ToString + "          " + reader("Provider Business Mailing Address City Name").ToString + ", " + reader("Provider Business Mailing Address State Name").ToString + "  " + reader("Provider Business Mailing Address Postal Code").ToString)


                'Dim entry As String
                'String to Add'
                ' Dim entry = String.Format("{0,24} | {1,24} | {2,24} | {3,24} | {4, 24}", reader("Provider Last Name (Legal Name)").ToString(), reader("Provider First Name").ToString(), reader("Provider Business Mailing Address City Name").ToString(), reader("Provider Business Mailing Address State Name").ToString(), reader("Provider Business Mailing Address Postal Code").ToString())
                'Add the entry'
                'customers.Add(entry)

            End While


            Con.Close()



 

Viewing all 5678 articles
Browse latest View live




Latest Images