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

AjaxControlToolkitNet4.5 issue in Visual Studio 2012 Update2 about AutoCompleteExtender

$
0
0

Sorry,my english is not very good,please forgive me!

Code:

<asp:AutoCompleteExtender ID="txtTrainId_AutoCompleteExtender" runat="server" DelimiterCharacters="" Enabled="True" ServicePath="" ServiceMethod="GetTrainId" TargetControlID="txtTrainId"></asp:AutoCompleteExtender>

Warning:

Design interface:

After setting the value of “ServicePath”

Code:

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:AutoCompleteExtender ID="txtTrainId_AutoCompleteExtender" runat="server" DelimiterCharacters="" Enabled="True" ServicePath="AutoComplete.asmx" ServiceMethod="GetTrainId" TargetControlID="txtTrainId"></asp:AutoCompleteExtender>

Design interface:


Browse in IE11

throw new Error("AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts. Ensure the correct version of the scripts are referenced. If you are using an ASP.NET ScriptManager, switch to the ToolkitScriptManager in AjaxControlToolkit.dll.")

I have replaced the ScriptManager with ToolkitScriptManager,I do not know how to solve this problem, please give me some help.

SystemInfo

Development Tools:Visual Studio Ultimate 2012 Update2(Ver.11.0.60315.01)
Ajax Control Toolkit Version:Ajax Control Toolkit Net4.5

Website Project Configuration

Target Frame:dotNet Framework 4.5




error with ajax autocomple json from c#

$
0
0

The program works on local but not works on server.Why??????

[WebMethod]

public List<string> GetAutoCompleteData(string prefixText)

...

here is the error: Internal server error 500

and also this error:

Server Error in '/' Application.


Unknown web method GetAutoCompleteData.
Parameter name: methodName

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.ArgumentException: Unknown web method GetAutoCompleteData.
Parameter name: methodName

Source Error: 

An unhandled exception was generated during the execution of the current web request.Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace: 

[ArgumentException: Unknown web method GetAutoCompleteData.
Parameter name: methodName]
   System.Web.Script.Services.WebServiceData.GetMethodData(String methodName) +539974
   System.Web.Script.Services.RestHandler.CreateHandler(WebServiceData webServiceData, String methodName) +10
   System.Web.Script.Services.RestHandler.CreateHandler(HttpContext context) +159
   System.Web.Script.Services.RestHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) +62
   System.Web.Script.Services.ScriptHandlerFactory.GetHandler(HttpContext context, String requestType, String url, String pathTranslated) +47
   System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +334
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184



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

Please help

A lot of thanks 

Respect.

VS 2012 Update 2 - precompiling ASP.NET 3.5 site problems

$
0
0

Hi, hoping someone has a solution to this one....

I have an ASP.Net 3.5 site that has had no problems with precompiling on VS 2005, 2008 and 2012, however precompiling after Update 2 for 2012 just won't work - VS2012 goes through the motions, files are created, but those files, when copied to the live environment kick up the dreaded 'sys is undefined' error.

A colleague who hasn't installed the update can precompile the exact same solution, without any errors being created.

I realise Update 2 has introduced more control over the publish process, but I'm obviously missing some setting that is automatically included pre-update2.

Help!

auto complete AJAX work different between .asmx and without .asmx file

$
0
0
ServicePath="AutoComplete.asmx"

by using AJAX auto complete, what is the differenct with implement.asmx file and without .asmx file run at server side ? 

Calender Extender inside Modalpopup Delayed display

$
0
0

I have calender extender inside modalpopup works fine in Firefox but in chrome it display after 5 seconds, but its fast when not inside modal popup. I have the latest Ajax, any solution plz....

3 Update Panel Trigger

$
0
0

I have 3 update panel control asp.net which updatePanel1, updatePanel2, updatePanel3. When page load first updatePanel1 will automatically load more buttons ex: button1. When click button1 in updatePanel1, that will show buttons in updatePanel2 ex: button2. When click button2 it will triggerupdatePanel3 and show data in updatePanel3 like gridview. Now, what is my problem is when click button2 all buttons in updatePanel2 lose. can you give me solution why I lose buttons in updatePanel2?

AsyncFileUpload control not showing proper error message

$
0
0

Hello,

I have below code for AsyncFileUpload control in one page.

<asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><cc1:asyncfileupload onclientuploaderror="uploadError" onclientuploadcomplete="uploadComplete"
                        runat="server" id="AsyncFileUpload1" width="242px" completebackcolor="White"
                        uploadingbackcolor="#CCFFFF" throbberid="imgLoader" onuploadedcomplete="FileUploadComplete"
                        uploaderstyle="Modern" clientidmode="AutoID" />&nbsp;<asp:Image ID="imgLoader" runat="server" ImageUrl="~/Images/ColumnProgress.gif" Style="margin-bottom: 0px" /><br /><asp:Label ID="Label1" runat="server" CssClass="Errortext" Text = ""  /></ContentTemplate></asp:UpdatePanel>

Below is the script code to generate the error message.

<script type="text/javascript">
        function uploadComplete(sender) {
            debugger;$get("<%=Label1.ClientID%>").style.color = "green";$get("<%=Label1.ClientID%>").innerHTML = "File Uploaded Successfully";
            document.getElementById("Label1").innerHTML = "error";
           // window.opener.location.href = window.opener.location.href;
           // window.opener.location.reload(true);
            //window.close();
        }
        function uploadError(sender, args) {
            debugger;$get("<%=Label1.ClientID%>").style.color = "red";
          //$get("<%=Label1.ClientID%>").innerHTML = "File upload failed. Please check file format or size.";$get("<%=Label1.ClientID%>").innerHTML = args._errorMessage.replace("Server Response Error: ", "");
        }

Now, I know that whenever we throw an exception from the code behind with proper error message, ajax control will ask for that annoying error popup. 'Do you want to see response page' .. I wanted to skip that. So I wrote below code in Global.ascx file to supress the error response.

  protected void Application_Error()
        {
            Exception ex = Server.GetLastError();
            if (ex.InnerException != null && Request.Url.Query.Contains("AsyncFileUpload1"))
            {
                // This error is generated by a AsyncFileUpload postback.
                Response.Close();   // Close the response
            }
        }

It is not giving me that error pop up, but everytime shows below error message instead of my custom error message which is thrown by exception.

Error Message  :  The requested file uploading problem.

Can anyone please help me to show my custom error message?





VS 2005 Webservice Client side

$
0
0

I have added weservice in client side using:

<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
<Services>
<asp:ServiceReference Path="" />
</Services>
</asp:ScriptManager>

I used in my client side javascript the method of webservice:

service.MyHelloWorl();

I am getting error:

The server method failed with the following error: 'InvalidOpeationException' authentication failed.

Please suggest.


AJAX CollapsiblePanel control help needed?

$
0
0

I am using an AJAX CollapsiblePanel control but there are some problems?

Basically, the panel hides when i click the arrows but doesnt open when I click the arrows again - why is it doing that?

<%@ Page Title="Home Page" Language="VB" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.vb" Inherits="AJAX_Panels._Default" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %><asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent"><br /><asp:Panel ID="pnlHeader" runat="server" Width="300px">
 Product Information<asp:Image ID="imgToggle" runat="server" ImageUrl="~/collapse.jpg" /></asp:Panel><asp:Panel ID="pnlInfo" runat="server" Width="300px" BackColor="#66FFFF">
 This panel will expand and collapse to show and hide text depending on user.</asp:Panel><asp:CollapsiblePanelExtender ID="pnlInfo_CollapsiblePanelExtender" runat="server" Enabled="True" TargetControlID="pnlInfo" CollapseControlID="pnlHeader" ExpandControlID="pnlHeader" CollapsedImage="~/expand.jpg" ExpandedImage="~/collapse.jpg" ImageControlID="imgToggle" SuppressPostBack="True"></asp:CollapsiblePanelExtender><br /></asp:Content>

 

Cannot get result from AJAX

$
0
0

 

I have a file called "index.aspx" and part of the code is as follows:

var ServerTime = {
	        get: function(){
		        var ServerTime = "nothing here";
                $.ajax({
                  type: "POST",
                  url: "Index.aspx.cs/getServerTime",
                  data: "{}",
                  contentType: "application/json; charset=utf-8",
                  dataType: "json",
                  success: function(msg) {
                    ServerTime = msg.d;
                  }
                });
		        return ServerTime;
	        }
        }

 

The above code will call the method "getServerTime" in my "Index.aspx.cs" file.

        [System.Web.Services.WebMethod]
        public static string getServerTime(string DateTimeFormat)
        {
            if (DateTimeFormat == null)
            {
                DateTimeFormat = "HHmm";
            }


            String message = "nothing";

            try
            {

                message = DateTime.Now.ToString(DateTimeFormat);


            }
            catch (Exception err)
            {
                message = "Exception found: " + err;
            }


            return message;
        }

The strange things is that when I called the following code:

onsole.log(" Time Server: " + ServerTime.get());

I get the following result, which is not what I expected

Time Server: nothing here 

Is there something wrong with my code?


 

 

 

 

 

 

Filter EntityDataSource throw DateTime.Now In Code Behind Not in Aspx file

$
0
0

i want t make entity data source that bring data from table in db which have startDate and endDate Columns... i want to get data that have the condition the startDate<datetime.now and endDate>datetime.now
how can i make it programmatically  ???????????????????????????
 

AJAX Extensions undefined on open aspx page after upgrade to VS2012 on Win 7 64bit

$
0
0

Hi:

We recently upgraded our development boxes from VS2010 on Win 7 32 bit to VS2012 Win 7 64bit. On every legacy Net 4.0 webform solution since the upgrade, we now have the exact same problem on every box. If we open any aspx page, and modify the aspx code, every Asp.net extension (scriptmanager, updatepanel, timer etc.) becomes undefined in the designer page - however only on the open page - all other pages that are unmodified and closed are OK.

Example: Type 'System.Web.UI.WebControls.UpdatePanel' is not defined.

If we remove 'System.Web.UI.WebControls' from the control in the designer page, the error goes away. However, if we drag and drop a new UpdatePanel or other AJAX extension control onto the page, it is still shown as System.Web.UI.WebControls.XXXXX and an error appears in the designer.aspx file.

1. System.Web.Extensions is referenced, and it is the 4.0 dll.

2. targetFramework="4.0" is set in the web.config.

3. The compile target is 4.0.

4. Net 4.0 is installed and so is the 4.0 AjaxToolkit and the Extensions.

We have tried;

1. Dragging and dropping a new extension control, such as an update panel on the page and clean and recompile. Does not change the error.

2. Changing the build target to 3.5 and then changing back to 4.0.

3. Getting a stronger coffee.

Nothing works and we are at a standstill. Can anyone suggest a cure?

Thanks in advance,

Bill




Checking for duplicates with Ajax, disallowing form to post

$
0
0
I have a small registration script where a user enters an email address, and on the fly will check to see if the email is already in the database (whereas a prompt will display below the textbox is the email/username is or not available.
But when hitting submit , the form just remains static, it doesnt render an error or post to the database:
 
 
////////Ajax objects on ASPX page<asp:ScriptManager ID="scriptmanager1" runat="server"></asp:ScriptManager><script type="text/javascript">
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
function BeginRequestHandler(sender, args) {
var state = document.getElementById('loadingdiv').style.display;
			if (state == 'block') {
				document.getElementById('loadingdiv').style.display = 'none';
			} else {
				document.getElementById('loadingdiv').style.display = 'block';
			}
args.get_postBackElement().disabled = true;
}</script>

/////////////email textbox encapsulated with asp.net control coding
<asp:UpdatePanel ID="PnlUsrDetails" runat="server"><ContentTemplate><asp:Label ID="LabelEmail" runat="server" Text="Email:" CssClass="BlackText" Width="200px"></asp:Label><asp:TextBox ID="TextBoxEmail" runat="server" Width="250px" AutoPostBack="true" ontextchanged="txtEmail_TextChanged"/></asp:TextBox><asp:RequiredFieldValidator ID="RFVUserEMail" runat="server" ForeColor="Red" Display="None"
                    ControlToValidate="TextBoxEmail" ErrorMessage="Enter a valid Email address.">Email</asp:RequiredFieldValidator><asp:RegularExpressionValidator
                        ID="REVUserEMail" runat="server" ForeColor="Red" Display="None" ControlToValidate="TextBoxEmail"
                        ErrorMessage="Enter Correct E-Mail" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">Email</asp:RegularExpressionValidator><!--placeholder to give status of email taken or not --><div id="checkusername" runat="server"  Visible="false"><asp:Image ID="imgstatus" runat="server" Width="17px" Height="17px"/><asp:Label ID="lblStatus" runat="server"></asp:Label></div><!--loading gif --><div class="waitingdiv" id="loadingdiv" style="display:none; margin-left:5.3em"><img src="LoadingImage.gif" alt="Loading" />Please wait...</div></ContentTemplate></asp:UpdatePanel></div>
/////////////

////////////
/// code behind method to process the check for duplicate emails

protected void txtEmail_TextChanged(object sender, EventArgs e)
{
if(!string.IsNullOrEmpty(TextBoxEmail.Text))
{
SqlConnection con = new SqlConnection("Data Source=dbaseserver.com; Initial Catalog=mydb; User ID=mydb; Password=1234;");
con.Open();
SqlCommand cmd = new SqlCommand("select * from Users where Email=@Email", con);
cmd.Parameters.AddWithValue("@Email", TextBoxEmail.Text);
SqlDataReader dr = cmd.ExecuteReader();
 if (dr.HasRows)
 {
checkusername.Visible = true;
imgstatus.ImageUrl = "NotAvailable.jpg";
lblStatus.Text = "UserName Already Taken";
System.Threading.Thread.Sleep(2000);
 }
 else
 {
checkusername.Visible = true;
imgstatus.ImageUrl = "Icon_Available.gif"; 
lblStatus.Text = "UserName Available";
System.Threading.Thread.Sleep(2000);
 }
}
else
{
checkusername.Visible = false;
}
}//need this extra brace?
///end checkdupe


Wondering if there is a page_load, ispostback thing I am overlooking of not taking into account.

thakns in advance
chumley

sorting grid view by date

$
0
0

hi ,

 

i have a gridview with date column and some other columns and i want to order it by date,

how i can do it, i searched in google but nothing is clear to me

please i need it step by step as i am new in ajax control

 

ModalPopupExtender with panel visible and called programmatically

$
0
0

Hi!

I am wondering if there is a way that I can have the panel that I am using in the modal popup extender be visible in the natural order of the page.

Basically I have a simple email signup form, at the bottom of a fairly long page, in a panel, I want that panel to be there at the bottom, visible and be accessible to the user. Then when they submit, I do validation with a ReCaptcha as well as asp.net regex validation (confirm an email asd@asd.asd). But if there is an error, rather than reloading the page and the user being clueless as to why the page just loaded, I want to call that same panel in a modal popup and let them correct their errors, rinse and repeat until the email is good and the recaptcha is good. Then after success the panel should be in place in the page again without the modal popup

From what I can see as soon as you associate a panel with a modal popup extender, it makes it invisible and I dont see any options in the control to force it to be visible. Any thoughts? Do I need to make 2 seperate panels and turn up the spaghetti?

Also another small issue: I tried using an imagebutton to load the panel in the popup, which works fine, but it is forcing my validation to fire off before the input elements have been filled out by the user. Is there something I need to change to make that popup not push validation? Currently I use in the C# code if (Page.IsValid) {} to check the ReCaptcha, so do I need to make this OnPostBack or something?

Thanks a ton!


HTMLEditorExtender HTML View

$
0
0

Sorry for such a simple question but I'm desperate for a quick answer.

With the HTMLEditor you could include toolbar buttons to work in Design Mode or view the HTML text. How do you get the same functionality with the HTMLEditorExtender?

TIA

David Loosley

Ajax slider control able to fill up?

$
0
0

Hey all!

I need a slider that filles with a different color when you slide with the handle. I have added a custom handle and a custom "empty" rail. Can i somehow add a "filled" rail somewhere?

Kind of like this. I already made this filled track, now i just need to add it

Thanks in advance

Making a trackbar with 2 railcolors( slider control)

$
0
0

Hey all!

Im trying to make a trackbar using the ajax slidercontol. I currenty have it working with a custom handle and 1 rail. However i want 2 different colored rails, one black at the right of the trackbar, and one yellow on the left

Kind of like this, but with different colors. Is that possible?

Thanks in advance!

Tabcontainer not visible after AppPool recycling

$
0
0

I have a strange problem that a Tabcontainer suddenly become unvisible.

I have now found out that this happens after the AppPool is recycled. Then I have to restart IIS to make it work again.

Any ideas is very welcome.

/Peo

using ajax to display popupwindow

$
0
0

Hi

How to display a popupwindow when clicking link button 

Thanks

Yok

Viewing all 5678 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>