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

How to disable ListBox whch has ListSearchExtender, behind code?

$
0
0

I was trying with regular disabling like

ListBox1.Enabled = False

, but not working.

<asp:ListBox ID="ListBox1" runat="server" Width="125px" Height="110px" style="font-family: calibri; font-size: large; font-weight: 700; text-align: center"></asp:ListBox><ajaxToolkit:ListSearchExtender ID="ListBoxExtender1" runat="server" TargetControlID="ListBox1" IsSorted="True" Enabled="True" PromptCssClass="ListSearchExtenderPrompt" PromptText="Type"></ajaxToolkit:ListSearchExtender>

 

Some has a solution?

 

Thanks in advance for help...


MaskedEditExtender

$
0
0

Hi,

Im using the MaskedEditExtender and TextboxwatermarkExtender for Date format.

My Date Format is Only Month and Year

<abd:MaskedEditExtender ID="creg" runat="server" TargetControlID="tderbox"
InputDirection="LeftToRight" MaskType="Date" Mask="99/9999" >

Textboxwatermark extender is not displayed intially when i set the ClearMaskOnLostFocus="false"

But when I set ClearMaskOnLostFocus="true" watermark text appear but when i enter values and leave the textbox its changes into 192013.

Pls suggest some idea. Thanks

Works on local machine, not on server: Could not load file or assembly 'AjaxControlToolkit'

$
0
0

hi there, i need your help.

In my application I've in the folder bin the AjaxControlToolkit.dll, but when call the page in the browser I've this error, why?
can you help me?

Works on local machine, not on server: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The system cannot find the file specified.

Server Error in '/' Application.
--------------------------------------------------------------------------------

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' or one of its dependencies. The system cannot find the file specified.

Source Error:


Line 1:  <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"
Line 2:      Debug="true" %>
Line 3:  <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
Line 4:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Line 5:  <html xmlns="http://www.w3.org/1999/xhtml">



AJAX CascadingDropDown - Method Error 500

$
0
0

I downlaoded the sample code accompanying the "Cascading Drop Down Control to Access a Database" AJAX Toolkit video, and added the datasets from the sample code to my application running in VS2008 and AJAX 3.5. I think the sample code is in a prior version of AJAX.

When I ran my project I used to get Method Error 500 and after 2 days of searching the web could not get a solution.

Finally by chance I recreated the datasets fresh in my app using the wizard as shown in the video and the error dissapeared and the cascading drop down worked beautifully.

I hope this post would help anyone who is in the same situation I was.

 

Irfan Nizar

Save text and image via html editor

$
0
0

Can anybody please suggest me how to save both text and image using Asp.net Ajax HTML Editor. I careate one. By my it only able to save image but failed to reply.

Please suggest how to save and retrieve both text and image using asp.net ajax html editor.

Thanks in advance

Md. Mojammel Haque

Problem with IE10 and Ajax TabContainer

$
0
0

Hi, I cant change tabs in an Ajax TabContanier with Internet Explorer 10. I must to change in compatbility mode to fix this. Wha can I do???

How to use HTMLEditorExtender in asp.net

$
0
0

I wat to use HTMLEditorExtender in my code but it gives error messege that object is null so please tell me how can i use HTMLEditorExtender.

The script 'Timer.js' referenced multiple times

$
0
0

My company's website uses the AjaxControlToolkit in a few different areas. I was assigned a project that required using an updated version of the toolkit. (the previous version's textbox Calendar extender didn't have the "StartDate" and "EndDate" properties. yeah, it was old.)

So, I upgraded to the latest and greatest by adding the NuGet package, and deleted the old DLL. 

A few (legacy) pages were using the toolkit in UpdatePanels. I have changed the ScriptManagers on those pages to the ToolkitScriptManager. 

The Problem:

The pages with UpdatePanels (UpdateMode="always" ChildrenAsTriggers="true") have an asp:Timer in them. When the page loads, everything is fine. Then, after a seemingly random number of async postbacks (usually the first, and always less than 3), they throw the following JavaScript error:

Uncaught Sys.InvalidOperationException: Sys.InvalidOperationException: The script 'Timer.js' has been referenced multiple times. If referencing Microsoft AJAX scripts explicitly, set the MicrosoftAjaxMode property of the ScriptManager to Explicit.

I haven't been able to reproduce the error in my local version, so far it only happens on our development servers. Unfortunately, the person who wrote the system doesn't work here anymore, and no one has had to touch it until now (lucky me), so I've just been trying things for the last few days...

I've tried moving the timer outside the update panel and setting it as an asyncpostback trigger on the update panel, but that causes other strangeness on the page. I've replaced ScriptManager with ToolkitScriptManager. I've set CombineScripts to false. I've removed calls to ScriptManager and ClientScript, and replaced them with ToolkitScriptManager. None of this has helped.

Any helpful thoughts are greatly appreciated.

Thanks.


PARTIAL POSTBACK

$
0
0

I am a newbie and uptill now i have learned a lot from google however i've now stuck. I've constructed a dropdown list which includes three different selected items which display / hides the textboxes by selecting one of them. When the 'Branch Name' is selected, Textbox5 and 6 must be dissapeared with a partial postback. The code attached yet dissapears Textbox5 only, which doesn't fulfill my need.

When I tried to write the below mentioned lines in my code after the Last line. , it throws an error for closing the tag. I made another update panel 2 but i recieved an error i.e ""An extender can't be in a various UpdatePanel than the control it extends" . Will appreciate your help. Actual Code can be seen below.

</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTriggerControlID="DropDownList2"EventName="SelectedIndexChanged"/>
</Triggers>
</asp:UpdatePanel>

CODE

<asp:UpdatePanelID="UpdatePanel1"runat="server"UpdateMode="Conditional"ChildrenAsTriggers="False">
<ContentTemplate>
<asp:TextBoxID="TextBox5"runat="server"Height="17px"Width="104px"BackColor="#FFFF99"Font-Names="Calibri"></asp:TextBox>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTriggerControlID="DropDownList2"EventName="SelectedIndexChanged"/>
</Triggers>
</asp:UpdatePanel>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<tdclass="auto-style9"><asp:LabelID="Label7"runat="server"Font-Bold="True"Font-Size="Medium"Text="Complain Date"style="font-size:small"></asp:Label>
</td>
<tdclass="auto-style8">
<asp:TextBoxID="TextBox4"runat="server"Height="17px"Width="104px"OnTextChanged="TextBox2_TextChanged"BackColor="#FFFF99"Font-Names="Calibri"></asp:TextBox>

    

                    

 

      

      

 

AutoCompleteExtender in ascx doesn't works..

$
0
0

I've this set:

AutoCompleteExtender (4.1.4.0) in update panel in user control (ascx) and webservice under his ascx.vb and doesn't works.

So I've tested the same markup and webservice method in a simple aspx page and works, so I've some doubt:

- AutoCompleteExtender works in ascx file with webservice function under his code?

- AutoCompleteExtender works in an update panel?

I've always problem to create webservice method using wizard on the control, it return always: Cannot create page method GetCompletionList because no CodeBehind or CodeFile was found! - but I've CodeBehind file..sure!

Thanks!

Gio

ModalPopupExtender did not call with accordion panel

$
0
0

Hi,

I am using Modal Popup Extender in one of my web page. I am using Modal popup extender  to display message in attractive way.  My Web page use accordion panel.  When i press the save button my modal popup extender is not display. If remove Accordion panel then its working fine. 

Here is ASPX

<%@ Page Title="Ny Bokning" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="bk.aspx.cs" Inherits="NewBooking" Culture="sv-SE" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %><asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server"><style type="text/css">
        .style1
        {
            width: 100%;
        }</style></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server"><asp:ScriptManager ID="ScriptManager1" runat="server" EnableScriptGlobalization="True"></asp:ScriptManager><center><asp:Panel ID="Panel2" runat="server" Width="95%" CssClass="Panelbg"><center><h3 style="color: #993300;">New Page</h3><asp:Button ID="btnSpara" runat="server" Text="Spara" ValidationGroup="Booking" OnClick="btnSpara_Click"/></center><asp:Label ID="StaticErrorMessage" runat="server" Text="" Visible="false" ForeColor="Red"></asp:Label><br /><asp:Accordion ID="Accordion1" runat="server" SelectedIndex="0" FramesPerSecond="30"
                TransitionDuration="200" FadeTransitions="true" AutoSize="None" HeaderCssClass="accHeading"
                Width="95%"><Panes><asp:AccordionPane ID="BookingHanlder" runat="server"><Header>Övrig info Schema
                        </Header><Content><asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></Content></asp:AccordionPane></Panes></asp:Accordion></asp:Panel><asp:DropShadowExtender ID="Panel2_DropShadowExtender" runat="server" Enabled="True"
            TargetControlID="Panel2" Opacity=".8" Radius="8" Rounded="True"></asp:DropShadowExtender><asp:RoundedCornersExtender ID="Panel2_RoundedCornersExtender" runat="server" Enabled="True"
            TargetControlID="Panel2" Radius="7"></asp:RoundedCornersExtender><!---
Show Message Div
--><div style="min-height: 700px;"><asp:ModalPopupExtender ID="ModalPopupExtender1" BackgroundCssClass="ModalPopupBG"
                runat="server" OkControlID="btnOkay" TargetControlID="lbmsgError" PopupControlID="Panel1"
                Drag="true" PopupDragHandleControlID="PopupHeader"></asp:ModalPopupExtender><div id="Panel1" style="display: none;" class="popupConfirmation"><div class="popup_Container"><div class="popup_Titlebar" id="PopupHeader"><asp:Label ID="lbmsgHeader" runat="server" Text="Error"></asp:Label></div><div class="popup_Body"><p><asp:Label ID="lbmsgError" runat="server" Text=""></asp:Label></p></div><div class="popup_Buttons"><input id="btnOkay" value="Stänga" type="button" /></div></div></div></div></center></asp:Content>

Here is Code Behind

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Collections;
public partial class NewBooking : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.Session["UserName"] == null)
        {
            Response.Redirect("~/Account/Login.aspx", true);
        }
        else{
            if (!this.Session["Permission"].ToString().Contains("Booking"))
            {
                Response.Redirect("~/MessageBoard.aspx?Msg=NotPermit&Url=Default.aspx", true);
            }
        }
    }

    //Save Button Click Event
    protected void btnSpara_Click(object sender, EventArgs e) {
        try {
            ShowMessage("Header", "Message");
        }
        catch (Exception exc) {
            ShowMessage("Error Message", exc.Message);
        }
    }

    private void ShowMessage(string MessageHeader, string Message)
    {
        StaticErrorMessage.Text = Message;
        StaticErrorMessage.Visible = true;
        lbmsgHeader.Text = MessageHeader;
        lbmsgError.Text = Message;
        ModalPopupExtender1.Enabled = true;
        ModalPopupExtender1.Show();
    }
}



ScriptResource.axd file error

$
0
0

My application keeps giving me an error i in the ScriptReource.axd file.  Could someone tell me what this is?  Furthermore, how do I fix it?  It keeps saying "

b._onsubmit=b._form.onsubmit" returns a null reference.  I've been trying to fix this bug for days. Can anyone help?

How to hide drop box from AjaxFileUpload control

$
0
0

Folk,

How can i hide drop box from AjaxFileUpload ?

thanks is advance.

updating a gridview

$
0
0

I'm able to populate a gridview using stored proc from code behind. But can't seem to figure out how to update it. In my rowupdating, I'm trying to get the value of a text box but it always picks up the old value. Please help. Here's my code:

protected void GridView2_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {

                
            
                string labeltable = "Columns";
                int KeyIn;
                KeyIn = Convert.ToInt16(GridView2.DataKeys[e.RowIndex].Value.ToString());

                GridViewRow row = (GridViewRow)GridView2.Rows[e.RowIndex];

                TextBox notestxt = (TextBox)row.FindControl("unotesTextbox") as TextBox;

                string n = string.Empty;

                if (notestxt != null)
                {
                    n = notestxt.Text;
                }



                SqlConnection sqlcon = new SqlConnection(ConfigurationManager.ConnectionStrings["xxxConnectionString"].ConnectionString);
                SqlCommand cmd = new SqlCommand();

                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "UpdateNotes";
                cmd.Connection = sqlcon;
                sqlcon.Open();

                try
                {

                    cmd.Parameters.Add("@TableNmIn", SqlDbType.NVarChar).Value = labeltable;
                    cmd.Parameters.Add("@KeyIn", SqlDbType.Int).Value = KeyIn;
                    cmd.Parameters.Add("@NotesIn", SqlDbType.NVarChar).Value = n;

                    GridView2.EditIndex = -1;
                    GridView2.DataBind();
                    cmd.ExecuteNonQuery();
                   
            
                }

                catch (Exception ex)
                {
                    throw ex;
                }

         
        
        }
       
        protected void GridView2_RowEditing(object sender, GridViewEditEventArgs e)
        {

            GridView2.SelectedIndex = -1;
            GridView2.EditIndex = e.NewEditIndex;
          
            GridView2.DataBind();
           
        }

AJAX Control Toolkit Collapsible Extender Issue

$
0
0

I am using an asp checkbox control to enable/disable a panel and the "_doClose()" method to collapse the panel.  After doing so it renders the checkbox unusable and visually keeps the box checked although the properties indicate that its either checked or unchecked?


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?


 

 

 

 

 

 

IE 10 Issue: SCRIPT5022: Sys.ArgumentOutOfRangeException: Value must be an integer. Parameter name: x

$
0
0

My asp.net site is running well on IE6, IE7, IE8, IE9, Chrome, Safari, Firefox and Opera. But it is not working in IE10.

If I click on the Grid in the site it returns the following error:

SCRIPT5022: Sys.ArgumentOutOfRangeException: Value must be an integer.
Parameter name: x
Actual value was 956.5.
ScriptResource.axd, line 2810 character 12

Followed all the possible solutions found on the google but sill problem exists. Followed solutions are

http://stackoverflow.com/questions/14046857/javascript-error-in-every-page-on-ie-10
http://social.msdn.microsoft.com/Forums/en/netfxjscript/thread/e8cb8041-2e23-4a20-9c2e-825832b8f3f0


Can anyone please help me to resolve this?

Thanks in advance!

What's Sys.WebForms.PageRequestManager?

$
0
0

Hi everyone,

I meet a question——At my server-side codes, I put a button and a textbox inside the UpdatePanel.

And at the beginning, I wrote the codes like this following in jQuery to assign values:

<head runat="server"><title>Test</title><script src="Scripts/jquery-2.0.0.js"></script><script>
        $(function ()
        {
            $('#<%=TextBox1.ClientID%>').val("I'm Bill Gates!");
        });</script></head>

It works when first running, but when I click the button inside the update panel, it doesn't work anymore!
After searching for the web, I know to use Sys.WebForms.PageRequestManager:
But my question:

1) Why use this?
2) What's that? Is that devoted for UpdatePanel or anything related to AJAX refreshing(even if I'm not using UpdatePanel but I just customized a page that will submit the data contents asychronizedly……), will it work properly?

Many thanks for good explaination!

Reguards!!!!!!!!!!!!

HTML Editor Update in Database

$
0
0

I am using html editor to insert data into the database and its working fine , as im able to retrieve data from the database into the editor, but when i change the data in the editor and click on the update button , the data is not changed , the page refreshed and the old data (before i modify it) is displayed again , below is the code for getting the data and updating it ...

help please !!!

protected void Page_Load(object sender, EventArgs e)
    {
        con.Open();
        cmd = new SqlCommand("select Subject from dbo.Table2 where sid=" + Request.QueryString["sid"], con);
        read = cmd.ExecuteReader();

        if (!read.Read())
        {

            Response.Write("Can not read from the Data Source !!!");

        }

        else

        {

         
            Editor1.Content = (string)read["Subject"];
        }
        read.Close();
        cmd.Dispose();
    }
    protected void upd_Click(object sender, EventArgs e)
    {
        cmdupdate = new SqlCommand("UPDATE Table2 set Subject='"+Editor1.Content+"' WHERE sid="+Request.QueryString["sid"], con);
        cmdupdate.ExecuteNonQuery();
        cmdupdate.Dispose();
        con.Close();

    }

UpdatePanelAnimationExtender ScriptAction Running on Postback

$
0
0

I have an UpdatePanel which includes some buttons which trigger callbacks and others that trigger postbacks.  The buttons that trigger postbacks are added to the <Triggers> collection. 

<asp:UpdatePanel runat="server" ID="upUpdatePanel"><Triggers><asp:PostBackTrigger ControlID="butStage4Save" /><asp:PostBackTrigger ControlID="butLoadMap" /></Triggers><ContentTemplate>
     ....

I also have an UpdatePanelAnimationExtender which executes a JavaScript function via ScriptAction:

<%--This is what causes the 'updating' animination to run when the specified Update Panel is updating or has updated
The javascript functions that are called are at the top of this page--%><act:UpdatePanelAnimationExtender ID="upae" BehaviorID="animation" runat="server" TargetControlID="upUpdatePanel"><Animations><OnUpdating><Parallel duration="0"><ScriptAction Script="onUpdating();" />  <FadeOut minimumOpacity=".5" /></Parallel></OnUpdating><OnUpdated><Parallel duration="0"><FadeIn minimumOpacity=".5" /><ScriptAction Script="onUpdated();" /> </Parallel> </OnUpdated></Animations></act:UpdatePanelAnimationExtender>

The onUpdating() function runs an animation.  The animation works great during an AJAX request, but my problem is that it also runs when issue a Postback via the Buttons in my <Triggers> collection.  I don't want the user to see the animation during a Postback.

Is there any way to only call the ScriptAction function during a callback, but not a postback?  Or to check some variable in the onUpdating() function to ignore the postbacks?

Thanks.

 

 

 

 

 

Viewing all 5678 articles
Browse latest View live


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