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

progress bar showing details of server side function.

$
0
0

Dear All,

I have been looking for progress bar that have to show current status of server side process for the last 5 months.

Im my case , I have 50 employes record..  and my server side longprocess() function iterate through all records and doing a specific task for each iteration. So i need  a progress control  to show processing "name" employee and percentage of total process.

Or only percentage if the above is not easy..

Please help me .. how to do it...

thankss in advance..


IE 8 will not allow download of a pdf file from my SSL site

$
0
0

While google chrome has no issue - ie. it allows the download of a file over SSL fine. IE8 in non SSL mode (http) also allows download but not in SSL mode(https). I read so many articles on this issue and almost all are directing to set IE settings or make the headers not to cache the document but nothing worked! Here is a short list:

http://support.microsoft.com/kb/815313 : I have made sure that the "Do not save encrypted pages to disk" is not checked off. It also has recommendations on not to send "Cache-Control: No Store" or "Cache-Control: No Chache" header from the server - refers to another kb article 812935. I was not setting any explicit headers anyway.

https://support.microsoft.com/kb/323308?wa=wsignin1.0 : Per this article, it says to edit registry..I have not tried this solution yet but at the last resort.

One solution tells me add these three lines to page load :

Response.Cache.SetExpires(DateTime.UtcNow.AddMinutes(-1))

Response.Cache.SetCacheability(HttpCacheability.NoCache)

Response.Cache.SetNoStore()

Nothing helped. Every single change in my code on server side made no change and every time I got the following error message with red-cross (I couldn't paste error message): but it said :

"Unable to download <filename> from <server name>

Unable to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later."

Here is the short code I am using on button click event:

ProtectedSub btnNASEquipUserManualOpen_Click(ByVal sender AsObject,ByVal e AsEventArgs)

Dim fPath AsString = "full path to .pdf"

Dim myDoc As IO.FileInfo = NewFileInfo(fPath)

Response.Clear()

'Response.AppendHeader("Pragma", "no-cache")

Response.ContentType ="Application/pdf"

Response.AddHeader("content-disposition","attachment;filename="+ myDoc.Name)

Response.AddHeader("Content-Length", myDoc.Length.ToString())

'Response.AddHeader("Cache-Control", "private")

'Response.AddHeader("Cache-Control", "max-age=15")

'If Request.Browser.Browser = "IE" Then

'Response.Cache.SetCacheability(HttpCacheability.NoCache)

'Response.AppendHeader("Pragma", "no-cache")

'End If

Response.ContentType ="application/octet-stream"

Response.WriteFile(myDoc.FullName)

Response.End()

End

Sub

----

The commented green lines are all my wasted efforts! href solution would be the ultimate one..I will try registry edition solution first but I will wait till I exhausted takeing suggestions! Thanks in advance!

----

One thing I like to mention that I am looking for a solution which can be implemented on server side..since even registry solution sounds like has to be on client side..but I have no control on client side. Thanks and looking forward to hear from you!

 

----

It gets weird even more..On the same webserver, in the same solution, I have two projects, each with a page with identical button click event and each one is allowing end user to downaload user manual. Weird part is: one allows download in https but not the other!!! Again no issue with Google Chrome and also when IE is running in http (and not https) but problem to download under https. I have confirmed that for testing, I have unchecked the checkbox of "Do not save encrypted pages to disk" in IT security settings (tools->Advanced Tab -> scroll down to Security) but still no go!

----

NEVER MIND!!! I HAVE CHANGED MY PAGE TO USE HREF instead which works like charm!!! 

Autocomplete Textchanged event is not firing

$
0
0

ajax auto complete textchanged event is not firing , when selecting same item second time. 

plz help...

ReorderList and IE11

Update Panels and Tab Container

$
0
0

I have tab container that has a custom user control in each of its Tab Panels.  The user control has a button.  When the button is clicked some validates are performed on the the contents on the panel.  If it fails validations an alert popup box is displayed.  The problem I am running into is the entire Tab Container disappears while the popup box is displayed.  once the user selects OK the Tab container is visible again. 

I have added update panels on the around the page, tabcontainer, user control, button etc. to no avail.

Does anyone have any idea what is going on here.

Note: The code that registers the alert script is in the page code behind that contains the user control.  The page registers with the custom control for the button click event.

Any help is greatly appreciated.

James

HoverMenuExtender mouseout to hide panel even if mouseover panel

$
0
0

I have a hovemenuextender on an image button to pop up a larger view of the image. I would like to hide that image when the user moves the mouse away from the image button. It works unless you move your mouse over the panel that pops up with the image. I would like to still hide the popup panel even if the users moves the mouse over the large image popup panel. Is that possible? I only want the image button to popup and hide the panel. As soon as the user moves the mouse away from the image button (even if it is over the popup image) I would like to hide the popup panel.

autopostback of textchange inside gridview

$
0
0

I have textboxes within a gridview that need to post back with changes for recalculation. What handles the post back? The gridview rowcommand? How do I setup the triggers?

Below is a sample of my code.

<asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><asp:GridView ID="materialGridView" runat="server"
                    AutoGenerateColumns="false" ><Columns><asp:BoundField DataField="MaterialTypeName" HeaderText="Material Type" /><asp:TemplateField><HeaderTemplate>
                                Quantity</HeaderTemplate><ItemTemplate><asp:TextBox ID="quantityTextBox" runat="server" Width ="50"
                                             OnTextChanged="recalculateMaterialCost" AutoPostBack="true"></asp:TextBox></ItemTemplate></asp:TemplateField><asp:TemplateField><HeaderTemplate>
                                Material</HeaderTemplate><ItemTemplate><asp:DropDownList ID="materialDropDownList" runat="server" Width="200"></asp:DropDownList></ItemTemplate></asp:TemplateField><asp:TemplateField><HeaderTemplate>
                                Color</HeaderTemplate><ItemTemplate><asp:TextBox ID="colorTextBox" runat="server" Width="100" Enabled="false" ></asp:TextBox></ItemTemplate></asp:TemplateField><asp:TemplateField><HeaderTemplate>
                                RBK</HeaderTemplate><ItemTemplate><asp:RadioButton id="rbkRadioButton" runat="server" AutoPostBack="true" /><asp:TextBox ID="rbkPriceTextBox" runat="server" Width="50"
                                             OnTextChanged="recalculateMaterialCost" AutoPostBack="true"></asp:TextBox></ItemTemplate></asp:TemplateField><asp:TemplateField><HeaderTemplate>
                                Wimsatt</HeaderTemplate><ItemTemplate><asp:TextBox ID="wimsattPriceTextBox" runat="server" Width="50"
                                             OnTextChanged="recalculateMaterialCost" AutoPostBack="true"></asp:TextBox><asp:RadioButton id="wimsattRadioButton" runat="server" AutoPostBack="true" /></ItemTemplate></asp:TemplateField></Columns></asp:GridView></ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID ="quantityTextBox" EventName ="TextChanged" /><asp:AsyncPostBackTrigger ControlID ="rbkPriceTextBox" EventName ="TextChanged" /><asp:AsyncPostBackTrigger ControlID ="wimsattPriceTextBox" EventName ="TextChanged" /><asp:AsyncPostBackTrigger ControlID ="rbkRadioButton" EventName ="CheckedChanged" /><asp:AsyncPostBackTrigger ControlID ="wimsattRadioButton" EventName ="CheckedChanged" /></Triggers></asp:UpdatePanel>

ajaxfileupload

$
0
0

hi everyone.. am having problem saving the data from dropdownlist..it always store the first data of the dropdown list.. am using ajaxfileuploadd..plzz help

protected void AjaxFileUploadEvent(object sender, AjaxFileUploadEventArgs e)
    {
        if (!IsPostBack)
        {
            SqlConnection con = new SqlConnection();

            string filepath = (Server.MapPath("~/property_images/") + Guid.NewGuid() + System.IO.Path.GetFileName(e.FileName));
            AjaxFileUpload1.SaveAs(filepath);
            string fl = filepath.Substring(filepath.LastIndexOf("\\"));
            string[] split = fl.Split('\\');
            string newpath = split[1];
            string imagepath = "~/property_images/" + newpath;
            string name = ddlPname.SelectedItem.Text;


            

            con.Open();
            SqlCommand cmd = new SqlCommand("INSERT INTO tbl_pro_img(member_id, property_name, path) VALUES (@member_id, @pn, @IMAGE_PATH)", con);
            cmd.Parameters.AddWithValue("@member_id", lblMember_id.Text);
            cmd.Parameters.AddWithValue("@pn", name);
            cmd.Parameters.AddWithValue("@IMAGE_PATH", newpath);

            cmd.ExecuteNonQuery();
            con.Close();
        }
       




    }


Sys.Net.WebServiceProxy.invoke doesn't work

$
0
0

Hi,
I have create o javascript file which will communicate with webservice with Sys.Net.WebServiceProxy.invoke.

I have a exemple like this and it works fine, but when I tried to create another application, even I using the code from the first exeample, does'nt work.

My HTML:

<%@ Page Title="Home Page" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"
    CodeBehind="Default.aspx.vb" Inherits="Testinando_2010._Default" %><asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"></asp:Content><asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"><script type="text/javascript" src="Scripts/scripts.js"></script><asp:ScriptManager ID="manager1" runat="server" EnablePageMethods="true"></asp:ScriptManager><h2>
        Welcome to ASP.NET!</h2><p>
        To learn more about ASP.NET visit <a href="http://www.asp.net" title="ASP.NET Website">www.asp.net</a>.</p><p>
        You can also find <a href="http://go.microsoft.com/fwlink/?LinkID=152368&amp;clcid=0x409"
            title="MSDN ASP.NET Docs">documentation on ASP.NET at MSDN</a>.</p><input type="button" value="clique" onclick="pegar()"/></asp:Content>

My javascript:

function pegar() {
    Sys.Net.WebServiceProxy.invoke('../servico/servico.asmx', "HelloWorld", false, "", mostra);
    alert('');
}

function mostra(t){
    alert(t);
}

My WebService:

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 servico
    Inherits WebService<WebMethod()> _
    Public Function HelloWorld() As String
       Return "Hello World"
    End Function

End Class

Like I said, I already have an application that works fine, but even if I copy and paste the code in another application, the web service doesn't work.

Ajax Auto Extender and Custom Validator

$
0
0

I am using asp.net Grid view which has Text box mapped to autoextender. I am unable to trigger custom validator. Though script is called , it doesnot display the error messgae. Following is the code used.

<script type="text/javascript">
var isItemSelected = false;
function onItemSelected() {
isItemSelected = true;
}

function checkItemSelected(sender,args) {
alert(sender.id);


if (!isItemSelected) {
// alert('inside if');
// txtInput.focus();

args.isValid = false;
alert(args.Value + isItemSelected);
return args.isValid;
}
else {
//reset isItemSelected
isItemSelected = false;
}
}

</script>

<asp:TemplateField >
<ItemTemplate>
<asp:TextBox ID="txtEmp" runat="server" ></asp:TextBox>

<asp:AutoCompleteExtender ServiceMethod="GetEmpList"
MinimumPrefixLength="1"
CompletionInterval="10"
EnableCaching="false"
CompletionSetCount="1"
TargetControlID="txtEmp"
ID="AutoCompleteExtender4"
runat="server"
OnClientItemSelected="onItemSelected"
FirstRowSelected="false"
>
</asp:AutoCompleteExtender>


<asp:CustomValidator id="DisValidator"
runat="server" ControlToValidate="txtEmp" ValidateEmptyText="false" ClientValidationFunction="checkItemSelected"
Display="Dynamic" ErrorMessage="Please select item" ForeColor ="Red" Enabled="true">*</asp:CustomValidator>
</ItemTemplate>

open the modal open for errors asp: ValidationSummary

$
0
0

Good afternoon,
I am building a form of e-mailing.
I create the part of asp: ValidationSummary and want only opens the modal form is open to errors in the asp: ValidationSummary.

<ajaxToolkit:ModalPopupExtender 
    ID="MPErros" 
    runat="server" 
    TargetControlID="btEnviar"
    PopupControlID="ModalErros" 
    DropShadow="false" 
    CancelControlID="BotaoCancelar"/><asp:Panel ID="ModalErros" runat="server" Style="display:none;" CssClass="modal"><asp:ValidationSummary
        ShowMessageBox="False"
        ID="VS_Consultas"
        runat="server"
        DisplayMode="List"
        ValidationGroup="Erro" />                    <asp:LinkButton 
            ID="BotaoCancelar" 
            runat="server"
            CssClass="close"
            CausesValidation="false"><img src="Imagens/fechar.png" runat="server" title="Fechar" style="text-align:center;" /></asp:LinkButton></asp:Panel>


When there is no error in the ValidationSummary it opens the modal open but without the errors but I do not want that to happen

preventing multiple clicks on image buttons inside a gridview in an update panel

$
0
0

I have posted this in Web Forms Data Controls section, but it wasn't solved. And since this is related to partial postbacks, I am requesting here.

I appreciate if someone can please help me with, preventing multiple clicks on image button that is in template field in a gridview that is inside an update panel. Do I need to add some code to any of the methods like add_initializeRequest, add_beginRequest?

I have an update panel.

<asp:UpdatePanelID="UpdatePanel1"runat="server">

In this update panel I have a gridview. 

<asp:GridViewID="GridView1"AutoGenerateColumns="False"Width="100%"runat="server"GridLines="None"OnRowDataBound="GridView1_RowDataBound"OnRowCommand="GridView1_RowCommand">

In this gridview I have a Templatefield with Image button.

<asp:TemplateFieldHeaderText=""><ItemTemplate><asp:ImageButtonID="btnDelete"runat="server"CausesValidation="False"CommandName="DeleteSomething"ImageUrl="delete.png"/></ItemTemplate></asp:TemplateField>

The update panel has trigger.

<asp:AsyncPostBackTriggerControlID="GridView1"/>

So when page loads and data is loaded in grid view, there will be one image button for each row. And on each of these buttons I need to prevent multiple clicks. If btnDelete on Row2 is clicked it should delete the row2, and while the server is still processing the row deletion, it should prevent the user from clicking that button on row2 again. Or in other words clicking the same image button multiple times should not cause multiple partial postbacks.

thank you in advance

Why aren't my BOX PLOT charts updating on postback?

$
0
0

I have 4 box plot charts inside an update panel.  I have sliders that trigger the charts to update the charts when the sliders' values change.

But they are not changing.  They still display the initial default values.

I'm using C#, Visual Studio 2013 Ultimate.  The sliders are from AjaxControlToolkit and the Charts are from Microsoft DataVisualization.Charting library.

Does anyone have any suggestion?  Really appreciate it.

Getting control from popup window to called window.

$
0
0

I have  created a Progress bar  by   calling  my long server side process in a new thread and call a popup progress.aspx page to  shows the progress..

progress value is stored in  static class file called CProgressArg

code in the progress.aspx  file is like this

int state = CProgressArg.percn;

protected void Page_Load(object sender, EventArgs e)

{

if (state > 0 && state <= 100)
{

this.panelProgress.Width = (400 * state) / 100;
this.lblPercent.Text = state + "%";
Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "", "<script>window.setTimeout('window.form1.submit()',1000);</script>");

else
{

this.lblMessages.Text = "Error Ocoured!";
Page.RegisterStartupScript("", "<script>window.close();</script>");
return;

}

}

I called new thread like this in the button click in main page.

new Thread(delegate()
{
ProcessModule(dtemp, ref errmsg);
}).Start();

below code will open the progress.aspx page.

ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "", "OpenProgess('../Payroll/Progress.aspx', 0,420,150);", true);

 

After executing full function  in new thread I need to show another popup that "Want to procees  next activity " . this msg has to be in main aspx page from where i create thread....

How can i get back to main page from  progress.aspx  if all process finishe.???

Or can i Popup window as ajax modal popup  instead of another aspx page (like progress.aspx)..

If we can then How to show the progress in modal popup window ??

No ajax toolkit control is working after some code cleanup and reorganizing

$
0
0

So we were looking to clean up and reorganize some of our code. Nothing was removed as far as references, we are NOT getting any errors, but after we published the site something as simple as the calendar control doesn't popup the calendar when you focus/click within the textbox. Now like I said nothing was removed as far as the references.

Ajax does work, if we revert back to previous project structure, server is configured correctly and working once we revert back. So its not a server configuration issue.

What id like to know is what can I look at to see how or why this is occurring? Since we are not getting any compilation errors or any errors at all, how can we determine what was broken or missing after moving things around?


Please answer quickly my question coz lating my timeline

$
0
0

I copy three folder including AjaxControlToolkit 4.0 version of Visual Studio 2013 to  my new project Using Visual Studio 2013.
(1)I done add to Reference,bin.Ajax control can't work.Why?.
(2)I run the code after finish the Developing.ModelPopup show beginning the Page instead of Popup show when click button.I don't want show beginning the page.I want to show ModelPopup on Clicking the button.
Please solve me two facts.Please....

Auto complete extender not working on production server

$
0
0

I am using auto complete extender to get the cities based on countries which is working fine in the development environment as well in staging. But, same build throwing exception while working on production server.

Where the production server has

  1. https enabled
  2. referring to the live URLs, like 
    https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js 
    https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js
  3. CDN enabled and referring the https:/CDNPath/ajaxlib.js

We have even one test space on production before we place into live, which is not having above three things(Not https enabled, referring to physical paths of JQuery and AjaxLib.js).  In this production test the build is working fine without any issues, but in the live environment we are getting following javascript exception

A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue. 

Script: https://www.ebizlink.biz/ScriptResource.axd?d=Tz1ZHcFw3b_BfaG6l55SD3gHTBKEiAHxJoN5Q608zY5xEOX6_0tGKvJl_skP0d2-tjxQ438qzR1rvYCif8ovbIZ09yIuNizzM9aGOxT4F6HnstOASzI6kLyXe67gl8oyz5Pt6Q2&t=23c9c237:2

My development environment is MS Visual Web Developer 2010 Express

Can any one suggest on this issue?

Thanks in advance

Ajax contorl toolkit is not working on framework 4.5

$
0
0

Hi,

I have installed ajaxtoolkit for framework 4.5 and it is not working.

I have already configured in web.config. I use vs 2013 and framework 4.5.

This is my code as below

 <ajaxToolkit:Accordion ID="AccTab" runat="Server"
                                    SelectedIndex="0"
                                    HeaderCssClass="accordionHeader"
                                    HeaderSelectedCssClass="accordionHeaderSelected"
                                    ContentCssClass="accordionContent"
                                    AutoSize="None"
                                    FadeTransitions="true"
                                    TransitionDuration="250"
                                    FramesPerSecond="40"
                                    RequireOpenedPane="false"
                                    SuppressHeaderPostbacks="true">
                                    <Panes>
                                        <ajaxToolkit:AccordionPane runat="server" ID="AccordionPane1">
                                            <Header>Number 1</Header>
                                            <Content> I am Number 1</Content>
                                        </ajaxToolkit:AccordionPane>
                                        <ajaxToolkit:AccordionPane runat="server" ID="AccordionPane2">
                                            <Header>Number 2</Header>
                                            <Content> I am Number 2</Content>
                                        </ajaxToolkit:AccordionPane>
                                         <ajaxToolkit:AccordionPane runat="server" ID="AccordionPane3">
                                            <Header>Number 3</Header>
                                            <Content> I am Number 3</Content>
                                        </ajaxToolkit:AccordionPane>
                                    </Panes>
                                    <HeaderTemplate>...</HeaderTemplate>
                                    <ContentTemplate>...</ContentTemplate>
            </ajaxToolkit:Accordion>

above the page

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

in web config

 <httpRuntime targetFramework="4.5" />
    <pages>
      <namespaces>
        <add namespace="System.Web.Optimization" />
        <add namespace="Microsoft.AspNet.Identity" />
      </namespaces>
      <controls>
        <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" />
        <add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" /></controls>
    </pages>

Please kindly advice

about oData consumption

$
0
0

Hi all,

I have a question about oData service consuming.

Does odata was called by frond-end language (javascript) or back-end language (C#)? or both?

Slideshow not working with Master/content page

$
0
0

I am having difficulty getting the Slideshow to work.  Here's my situation: -

I have a master page and content page.  On the content page I have the ToolkitScriptManager, an AnimationExtender which works perfectly, and a SlideShowExtender that doesn't.

The SlideShowExtender is defined: -
    <ajaxToolkit:SlideShowExtender ID="SlideShowExtender1" runat="server" TargetControlID="imgSlideshow"
        SlideShowServiceMethod="GetImages" AutoPlay="true" ImageTitleLabelID="lblClick"
        Loop="true" PlayInterval="1000" ImageDescriptionLabelID="lblImageDescription">
    </ajaxToolkit:SlideShowExtender>

In the CodeBehind: GetImages is defined: -
    <WebMethod()> _
    <ScriptMethod()> _
    Public Shared Function GetImages() As Slide()
        Dim slides As New List(Of Slide)()
        Dim sPath As String = HttpContext.Current.Server.MapPath("~/gdbmstr/Slideshow")
        If sPath.EndsWith("\") Then
            sPath = sPath.Remove(sPath.Length - 1)
        End If
        Dim pathUri As New Uri(sPath, UriKind.Absolute)
        Dim files As String() = Directory.GetFiles(sPath)
        For Each file As String In files
            Dim filePathUri As New Uri(file, UriKind.Absolute)
            slides.Add(New Slide() With { _
              .Name = Path.GetFileNameWithoutExtension(file), _
              .Description = Path.GetFileNameWithoutExtension(file) + " Description.", _
              .ImagePath = pathUri.MakeRelativeUri(filePathUri).ToString() _
            })
        Next
        Return slides.ToArray()
    End Function

If I put a checkpoint on the statement Return slides.ToArray() then I can see that slides contains exactly what I expect.   Continuing to step through the code with F10, immediately on exiting from the function an error is thrown:    Call Stack location: AjaxControlToolkit.DLL!AjaxControlToolkit.Slide.ImagePath.get() line 49
(No source available, so the rest of the debugger output isn't worth copying).

I've tried this, but it didn't make any difference: -
1.  Adding buttons etc so that my code exactly matches the sample
2.  Refreshing my Ajax toolkit by downloading a later version for VS2010 ASP.NET V4.0 (which is what I use)
3.  I've searched this forum for SlideShow and tried any likely looking fix to reported problems

Thank you, Robert Barnes.

Viewing all 5678 articles
Browse latest View live


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