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

ScriptManager.RegisterStartupScript some time not calling javasscript

$
0
0

I m calling ScriptManager.RegisterStartupScript inside a selectedeventcahnged event   but i hv observed that some time it do not calls the

 Below is  code .   

ScriptManager.RegisterStartupScript(ddlTemplateType, this.GetType(), "callScriptFunction1", " fillData('" + myvalue + "');", true);  do not calls javascript function 

protected void ddlInvoice_SelectedIndexChanged(object sender, EventArgs e)
{
try
{




ScriptManager.RegisterStartupScript(ddlTemplateType, this.GetType(), "callScriptFunction", "LoadCustomerDetailsINdiv('" + Imgsbuilder + "');", true);


if (ddlCorporation.SelectedIndex > 0 && ddlClient.SelectedIndex > 0)
{
ds.Reset();
ds = myDB.GetInvoice(clientVal, InvType);
if (ds == null)
{
ScriptManager.RegisterStartupScript(ddlTemplateType, this.GetType(), "callScriptFunction3", "fillInvoice('" +""+ "');", true);
}
else if(ds.Tables[0].Rows.Count == 0)
{
ScriptManager.RegisterStartupScript(ddlTemplateType, this.GetType(), "callScriptFunction3", "fillInvoice('" + "" + "');", true);
}
else if (ds.Tables[0].Rows.Count > 0)
{

 string Invoice = Convert.ToInt32(ds.Tables[0].Rows[0]["TM_TemplateID"]); // This will be use in updating the Texteditorcontent

ScriptManager.RegisterStartupScript(ddlTemplateType, this.GetType(), "callScriptFunction1", "fillInvoice('" + Invoice + "');", true);
}


}

}
catch (Exception exp)
{

;
}
}

Also i hv observed tht some time if i debugg then it will hit javascript function .

Pls suggest 


Send html form data to a class file

$
0
0

I have to send my html form data to a class file. Is there any way we could do this. Any suggestions are appreciated.

ComboBox in Ajax ControlToolkit

Font and Size selection in ASP.NET HTMLEditorExtender changes any selected text outside the editor.

$
0
0

When I select the text outside the editor like headers and select the Font and Size from the HTMLEditorExtender dropdowns, it modifies the selected text's font and size.

For example in http://www.asp.net/AjaxLibrary/AjaxControlToolkitSampleSite/HTMLEditorExtender/HTMLEditorExtender.aspx page, if I select the header "HTMLEditorExtender Demonstration" and then choose the font 'WingDings' from dropdown it changes the heading font, same applies to the font size.

Even the labels 'Font' and 'Size' before these dropdowns can be changed using these dropdowns, which mess up the entire page.

Someone please help me how to resolve this problem.

Thanks.

Why is it not possible to edit Combobox in ajax control toolkit as in this example

$
0
0

Here is a simple example from Ajax Control Toolkit. I can't edit anything in this control.
What is it that I have missed ?

<asp:ComboBox ID="ComboBox1"  AutoCompleteMode="Append"  DropDownStyle="Simple" runat="server">
        <asp:ListItem>test1</asp:ListItem>
        <asp:ListItem>test2</asp:ListItem>
        <asp:ListItem>test3</asp:ListItem>
    </asp:ComboBox>

//Tony

Get behaviour id of the ajax calender extender

$
0
0
<div>

PLease can some one tell me how can i get the behaviour id of a calender extender when i handle its Onshown event on the client side

Please Help

</div>

The NoBot control

$
0
0

I'm very unsure about the code for NoBot that I have. Is this code reasonable that it could work or has a missed something

<asp:NoBot ID="NoBot1" runat="server" CutoffMaximumInstances="3"
           CutoffWindowSeconds="10"  ResponseMinimumDelaySeconds="10"
            OnGenerateChallengeAndResponse="NoBot1_GenerateChallengeAndResponse" />

 protected void NoBot1_GenerateChallengeAndResponse(object sender, AjaxControlToolkit.NoBotEventArgs e)
        {
            NoBotState state;
            NoBot1.IsValid(out state);

            if (state.ToString().ToLower() != "valid")
               lblError.Text = state.ToString();
        }

//Tony

Masked Edit Extender

$
0
0

Hi Folks,

Hoping someone can help me on this:

I am using a maskededit extender on a textbox

I want a user to be able to input a decimal value up with no more than 2 decimal places
In a standard scenario this is fine as I can set the mask="9.99"

But,
I would like the digits before the decimal to be any number of digits, not specific to the mask
Is there a way to make the mask just for the digits after the decimal?

So effectively the mask would be mask="anynumber.99"

Javascript is not really a runner becuase I need to be able to set the mask from code-behind also

Thanks

Paullyie


Losing focus after AutoPostBack in UpdatePanel (solution)

$
0
0

ref: http://forums.asp.net/t/1077882.aspx?Losing+focus+after+AutoPostBack+in+UpdatePanel

solution

you can call this function

function RestoreFocus_For_AutoPostBack() {
    var oldId;

    var page = Sys.WebForms.PageRequestManager.getInstance();
    page.add_beginRequest(SaveOldId);
    page.add_endRequest(SetNewFocus);

    function SetNewFocus(source, args) {
        $("#" + oldId).next().focus();
    }
    function SaveOldId(source, args) {
        oldId = args.get_postBackElement().id;$("#" + oldId).next().blur();
    }
}

Ajax call

$
0
0

Hi,

I use ajax call to upload file, during the upload I want to show a progress bar or ajax-loader image.

The ajax call code follows -

$.ajax({                                url: "fileHandler.ashx",                                dataType: 'script',                                cache: false,                                async: false,                                contentType: false,                                processData: false,                                data: form_data,                         // Setting the data attribute of ajax with file_data                                type: 'post',                                progress: function (e) {                                    if (e.lengthComputable) {                                        $('#stam').html('Uploading...' + Math.round(e.loaded / e.total * 100));                                    }                                },                                complete: function () {                                    $('#waitDIV').hide();                                    alert('Done');                                }                            });

How can I show a progress bar to the user ?

Thanks

Why does htmlextender reject some html?

$
0
0

I attached a textbox to an htmlextender, and it works, but certain html tags are rejected.

For instance, I went into source view, and put the following equation:

<p style="text-align:center"><strong>P<sub>12</sub> = P<sub>1</sub> + P<sub>2</sub></strong></p>

Submitting the textbox (via a submit button in a form) give me text minus that section (the equation).

Is this a bug?

Thanks,

Create User with AJAX

Ajax.resquest Language text is not handling in IE

$
0
0

Hi,

 this is my code 

function Answer_Selected(queryString, questionID, formName, columnName) {
var FormElements = getFormElements1($('form1'));
FormElements += "SourceQuestionID|" + questionID;
var baseUrl = 'SetFormValue.aspx';
var url = baseUrl + "?SourceQuestionID=" + questionID + "&" + FormElements;
new Ajax.Request( url,{
type: 'GET',
cache: false,
contentType: "application/xml; charset=utf-8",
dataType: "xml",
onSuccess: function (transport) {
var Totalresult = transport.responseText;
var resultList = Totalresult.split('^');
for (i = 0; i < resultList.length; i++) {
var result = resultList[i];
var qid = result.substring(0, result.indexOf("|"));
var Value = result.substring(result.indexOf("|") + 1, result.length);
$(qid).value = Value;
}
}
});
}

..bellow is my c# code 

string Params = Request.QueryString["Params"];

.From Ui a dropdown value is comming as Kyllä but in c# i am getting that as Kyll�

So please help me what to do?????????????

Its urgent

Ajax Tookit controls behaviors not working

$
0
0

Hai,

Recenly i installed ajax tool kit 4.5 on 2012 visual studio.

and i try to test sample textbox watermark extender.

Register dll

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

Inside Form

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><asp:TextBox ID="txtPhone" runat="server"></asp:TextBox><asp:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" TargetControlID="txtPhone" WatermarkText="000-00000" runat="server"></asp:TextBoxWatermarkExtender>
<asp:TextBox ID="txtCal" runat="server"></asp:TextBox><asp:CalendarExtender TargetControlID="txtCal" runat="server"></asp:CalendarExtender>

while compile i'm not getting any errors, and i'm net getting even water mark  effects or calender effects on browser. any  tool kit controls not working

Please Help.

AsyncFileUpload with UpdatePanel and UpdateProgress not working

$
0
0

I'm trying to use the AsyncFileUpload control along with an UpdatePanel and UpdateProgress but can't seem to get it to work correctly.

What I want to do is use the AsyncFileUpload to select a file to process, click a button, have the UpdateProgress control display an animated gif and message "Processing file...", when the processing is complete some text like "Processing complete" is written to a Label.

Right now with my current code, before the page loads I get an unresponsive script warning.  I click "Stop script" in the window displaying the script warning to close the window.  I can click the AsyncFileUpload button and upload a file for processing, but then when I click the button to process the file, the UpdateProgress does not display.  When the file is finished "processing" the message is displayed in the Label correctly.

Below is my code:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="WebApplication2.WebForm2" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title></title></head><body><form id="form1" runat="server"><div><asp:ToolkitScriptManager ID="ScriptManager1" runat="server"></asp:ToolkitScriptManager><asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"><Triggers><asp:PostBackTrigger ControlID="ProcessButton" /></Triggers><ContentTemplate><div><asp:AsyncFileUpload ID="AsyncFileUpload" runat="server" Width="480px" UploaderStyle="Modern" /></div><div><asp:Button ID="ProcessButton" runat="server" TabIndex="2" Text="Process" OnClick="ProcessButton_Click" /></div><div><asp:Label ID="MessageLabel" runat="server" /></div></ContentTemplate></asp:UpdatePanel><asp:UpdateProgress ID="UpdateProgress1" runat="Server" AssociatedUpdatePanelID="UpdatePanel1" DisplayAfter="1"><ProgressTemplate><div><img src="loading.gif" />&nbsp;Please wait ...</div></ProgressTemplate></asp:UpdateProgress></div></form></body></html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication2
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        protected void ProcessButton_Click(object sender, EventArgs e)
        {
            string fileName = this.AsyncFileUpload.FileName;

            // Simulate processing the file.
            Thread.Sleep(5000);

            this.MessageLabel.Text = String.Format("The file '{0}' was processed on {1} at {2}", fileName, DateTime.Now.ToLongDateString(), DateTime.Now.ToLongTimeString());
            this.MessageLabel.Visible = true;
        }
    }

}



Any good off-the-shelf chat that can be integrated into asp.net?

$
0
0

I have an asp-net website that lets people view dialogue.  One way to obtain dialogue is via chat programs like skype. . You just paste the transcript from your skype into the website.  The problem that my co-worker raised is that people might not want to use Skype, because they have their main, known identity, and if they are practicing conversation, they might want to use an anonymous identity.  Skype can allow two identities in one computer, but its a pain to learn how to do this for our users..

So we looked at google chat, which is also quite complicated for users.

So we finally decided to integrate chat into our system.   One advantage is that this would also give our users knowledge of who-ever else was using our system and was willing to chat with them for the purpose of our website.

I went to codeplex, and found an out-dated chat with a database that made no sense - a field that was string was a foreign key of a field that was integer.  'nuget' also was disappointing.   Does anyone know of a good chat for the above purpose?  That doesn't require much programming?  That uses ajax and asp.net?

Validation Summary from Modal Popup

$
0
0

I ave a modal popup that opoens wheni  user wants to log a ride.  The ride date cannot be in the future or more than 2 weeks past. I use a range validator for this. owever, when i click on the insert button it does not display the error in the validation summary. I have the DiIsplay property set to None and associated with the validation group. If Ichange it to Dynamic it is displayed correctly within the form, but not in the summary. I changed the validation to check if the Page is valid and Show the popup if it is not, but the error is not displayed.

The HTML:

<InsertItemTemplate><table class="auto-style4"><tr><td class="tdlt_50" colspan="5"><asp:ValidationSummary ID="vgrpadd" runat="server" ShowSummary="true" DisplayMode="BulletList" /></td><td>&nbsp;</td></tr><tr><td class="tdlt_50">&nbsp;</td><td class="tdrt_100">Date:</td><td class="tdlt_100"><asp:TextBox ID="tbdate" runat="server" CssClass="tdlt_75"
                                        Text='<%# Bind("ridedate") %>' Width="65px" /><ajaxToolkit:CalendarExtender ID="TextBox2_CalendarExtender"
                                        runat="server" Enabled="True" PopupButtonID="imgcal" TargetControlID="tbdate" />&nbsp;<asp:ImageButton ID="imgcal" runat="server" ImageUrl="~/Images/Icons/calendar_1.png" /><asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="tbdate"
                                        ErrorMessage="You cannot future date a ride or enter one more than 2 Months old" Display="None" ValidationGroup="vgrpadd" /></td>

The code:

 protected void InsertButton_Click(object sender, EventArgs e)
   {
        Page.Validate();
        if (!IsValid)
        {
            RangeValidator Range = (RangeValidator)FormView1.FindControl("RangeValidator1");
            DateTime dtnowdt = DateTime.Today;
            TextBox tbrdate = (TextBox)FormView1.FindControl("tbdate");

            string dtnow = dtnowdt.ToShortDateString();
            //tbrdate.Text = dtnow;
            string dtmin = DateTime.Today.AddDays(-14).ToShortDateString();

            ValidationSummary vs = (ValidationSummary)FormView1.FindControl("vgrpadd");

            tbrdate.Text = dtnow;

            Range.MaximumValue = dtnow;
            Range.MinimumValue = dtmin;

            Range.Type = ValidationDataType.Date;
            Range.Display = ValidatorDisplay.None;
            Range.ValidationGroup = "vs";
            Range.ErrorMessage = "You cannot future date a ride or enter one more than 2 Weeks old";
            mpe_detail.Show();
        }
           if (IsValid)
           {
               mpe_detail.Hide();
           }
   }



how to create a WYSIWYG web application

$
0
0

I need to create WYSIWYG web application in asp.net . Are there any free ajax controls which i can use for performing drag and drop functionality and also work well with postbacks.

Any Suggestions???

HTMLEditorExtender -Clicking on Font size dropdown resets selected text font size

$
0
0

After changing the font size of selected text, if we reselect the text and click on font size dropdown it resets the font size of the selected sext. For example, in the site http://www.asp.net/AjaxLibrary/AjaxControlToolkitSampleSite/HTMLEditorExtender/HTMLEditorExtender.aspx, select hello and change the font size to 7. Now clicking on the font size dropdown again will reset the selection. Same thing happens anytime we select the text with a different font size from default and click on the font size dropdown it resets the size.

Similar behavior happens while selecting Font dropdown also.

Please help me how to resolve this issue.

Thanks.

Unable to use Ajax Control Toolkit HTML Editor

$
0
0

[VS Version: VS Pro 2013]

[.NET 4.5]

[Browser: IE 11.0.7]

Hi, 

I am trying to use the Ajax Control Toolkit to implement the HTML Editor control for an application backoffice. 

<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title></title></head><body><form id="form1" runat="server"><div><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><cc1:Editor ID="Editor1" runat="server" /></div></form></body></html>

I am getting an error as described:

"Unhandled exception at line 168, column 5 in http://localhost/53984/WebForm1.aspx. 0x800a138f - JavaScript runtime error: Unable to get property 'UI' of undefined or null reference"

The error is at the line:

"$create(Sys.Extended.UI.HTMLEditor.ToolbarButton.Undo, {"activeModesIds":"0",downSrc":"/WebResource.axd?d=HaeI...."

I have tried to change the ScriptManager to the ToolkitScriptManager but it doesn't recognize the control 

<ajaxToolkit:ToolkitScriptManagerrunat="server"ID="sm1"/>

Any tips, or work arounds?

Thanks, 

Bruno

Viewing all 5678 articles
Browse latest View live


Latest Images

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