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

How to use ajax with TreeView in another content in same page

$
0
0

In Contect2(see this control in code below) I fill a TreeView with some nodes. So when event SelectedNodeChanged occurs in TreeView I fill some data in Content3(see Content3 in code below). As it is now a full postback occurs with flickering.

I have added these 
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager>
 <asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
and the end tag for these in Content3 in the code below.
When I do this I get runtime error for this page saying"Could not find a control with ID TreeView1 for the trigger in UpdatePanel UpdatePanel1"

So my trigger looks like this
<Triggers>
            <asp:AsyncPostBackTrigger EventName="SelectedNodeChanged" ControlID="TreeView1" />
</Triggers>

I just wonder what is the best solution if I want to use Ajax for Content3 when event SelectedNodeChanged occurs for control TreeView1
//Tony

Here is the complete aspx page
=====================
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeBehind="BuyFlowers.aspx.cs" Inherits="Assignment_3.BuyFlowers" %>
<asp:Content ID="Content2" ContentPlaceHolderID="LeftColumnContent" Runat="Server">
    <span class="sidebarTitle">Category</span> <br />
    <asp:TreeView ID="TreeView1" runat="server" NodeIndent="10" OnSelectedNodeChanged="TreeView1_SelectedNodeChanged">
    </asp:TreeView>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="RightColumnContent" runat="server">
    <p>Notera: Du måste vara inloggad för att kunna slutföra ordern. En ny order skapas genom att sätta 0 i antal </p>

    <asp:GridView runat="server" ID="GridViewKorg" AutoGenerateColumns="False" Caption="Foo"
            DataKeyNames="Id"  
            BackColor="White" BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px"
            CellPadding="3"
            AutoGenerateSelectButton ="true"
            GridLines="Horizontal"  OnSelectedIndexChanged="GridViewKorg_SelectedIndexChanged">
            <AlternatingRowStyle BackColor="#F7F7F7" />
            <Columns>
                <asp:BoundField DataField="Id" HeaderText="ID" InsertVisible="False" ReadOnly="True" />
                <asp:BoundField DataField="Namn" HeaderText="Namn" ReadOnly="True" />
                <asp:BoundField DataField="Pris" HeaderText="Pris" ReadOnly="True" />
                <asp:BoundField DataField="Antal" HeaderText="Ant">
                    <ItemStyle HorizontalAlign="Center" />
                </asp:BoundField>
            </Columns>
            <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
            <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
            <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
            <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
            <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
            <SortedAscendingCellStyle BackColor="#F4F4FD" />
            <SortedAscendingHeaderStyle BackColor="#5A4C9D" />
            <SortedDescendingCellStyle BackColor="#D8D8F0" />
            <SortedDescendingHeaderStyle BackColor="#3E3277" />
        </asp:GridView>
    <br />

    <asp:DetailsView ID="DetailsView1" runat="server" Height="50px" Width="100%"
         AutoGenerateRows="False" BackColor="White" BorderColor="#E7E7FF" Caption="Change order row"
         BorderStyle="None" BorderWidth="1px" CellPadding="3" DataKeyNames="Id" Font-Size="16px" Font-Bold="True"
          GridLines="Horizontal" AutoGenerateEditButton="True" OnItemUpdating="DetailsView1_ItemUpdating" OnModeChanging="DetailsView1_ModeChanging">
        <AlternatingRowStyle BackColor="#F7F7F7" />
        <EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
        <Fields>
            <asp:BoundField DataField="Id" HeaderText="ID"  ReadOnly="True" />
            <asp:TemplateField HeaderText="Antal">
               <EditItemTemplate>
                  <asp:TextBox ID="txtAntal" Width="40px" runat="server" Text='<%# Bind("Antal") %>' />
                  <asp:RangeValidator id="Range1"
                       ControlToValidate="txtAntal"
                       MinimumValue="0"
                       MaximumValue="2147483647"
                       Type="Integer"
                       Text="Bara heltal"
                       runat="server"/>
               </EditItemTemplate>
            </asp:TemplateField>
        </Fields>
    </asp:DetailsView>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolderMain" runat="server">
    <link href="Styles/StyleSheet.css" rel="stylesheet" />
    <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
    <div>
        <h1 class="center">Översikt</h1>
        <asp:Label ID="info" runat="server" CssClass="info">
             Till vänster har du några olika kategorier av blommor.
             Vi vänder oss speciellt till er som älskar rosor.  
             Under varje kategori av rosor finns varje unik sort.
             När du klickar på en ros sort får du special information om denna ros samt hur många som finns i lager.
            Efter varje ros sort kan du se antal som finns i lager som t.ex [10] som anger att 10 st finns i lager
        </asp:Label>

       <asp:Label ID="lblnamn" CssClass="namn" runat="server" />
        <br />
       <asp:Image ID="Image1" runat="server"    AlternateText="Bild på en blomma" />
       <asp:Label ID="beskrivning" runat="server" />
       
       <br /><br />
       <asp:Panel ID="Panel1" runat="server" Visible="false">
            <asp:Label ID="lblId" runat="server" Visible="false" />
            <br />
            Pris: <asp:Label ID="lblpris" runat="server" />
            <br />
            Kvantitet i lager: <asp:Label ID="lblkvantitet" runat="server" />

            <asp:Button CssClass="btnKop" ID="btnKop" runat="server" Width="100%" Text="Lägg i varukorg" OnClick="btnKop_Click" />
       </asp:Panel>

       <div class="clear"></div>
    </div>

     </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger EventName="SelectedNodeChanged" ControlID="TreeView1" />
        </Triggers>
     </asp:UpdatePanel>
</asp:Content>

//tony


Update Panel doesn't allow File Upload to complete.

$
0
0

I have a blog application with an Upload File control to upload pictures related to the blog.  After blog is created and a picture loaded,  button1 is clicked to submit blog.

I have a confirmation Label wrapped with an Update Panel to confirm a successful submission and  label then fades away.  The problem is that after I click the submit button, the upload file control doesn't work (it fails to load the picture so everything fails after that)..    The File Upload works fine if I take the Update Panel out.  This may be a case of postback problems.  I'm at a loss.  Below are the xml entries:  Further below is the code behind for Button1:

<asp:ButtonID="Button1"runat="server"Text="Submit"onclick="Button1_Click"Width="195px"></asp:Button>

<br/>

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

<ContentTemplate>

<asp:LabelID="StatusLabel"runat="server"ForeColor="Blue">

</asp:Label>

</ContentTemplate>

<Triggers> <asp:AsyncPostBackTriggerControlID="Button1"EventName="Click"/> </Triggers>

</asp:UpdatePanel>

<ajaxToolkit:UpdatePanelAnimationExtenderID="UpdatePanelAnimationExtender1" runat="server" TargetControlID="UpdatePanel1">

<Animations>

<OnUpdated>

<FadeOutDuration="5.0"Fps="24"/>

</OnUpdated>

</Animations>

</ajaxToolkit:UpdatePanelAnimationExtender>

Code Behind:

protected void Button1_Click(object sender, EventArgs e)

 {

StatusLabel.ForeColor =Color.Red;

if (UploadControl1.HasFile)

 {

try

 {

if ((UploadControl1.PostedFile.ContentType == "image/jpeg" || UploadControl1.PostedFile.ContentType == "image/png")&& (TextBox1.Text != string.Empty&& TextBox2.Text != string.Empty))

{

if (UploadControl1.PostedFile.ContentLength < 102400)

{

string filename = Path.GetFileName(UploadControl1.FileName);

string completePath = "~/blogimages/"+ filename;

UploadControl1.SaveAs(Server.MapPath("~/blogimages/")+ filename);

var blog = newBlog { Name = TextBox1.Text, BlogContent = TextBox2.Text, BlogCategory = DropDownList1.SelectedValue, BlogPicture= completePath };

                            db.Blogs.Add(blog);

                            db.SaveChanges();

                            StatusLabel.ForeColor = Color.Blue;

                            StatusLabel.Text = "Blog was succecsssfully submitted!";

                            TextBox1.Text= string.Empty; TextBox2.Text = string.Empty;

}

else

                   StatusLabel.Text ="The file has to be less than 100 kb!";

}

else

                   StatusLabel.Text = "Make sure blog title and content are filled out. Only JPEG or PNG files are accepted and  !";

}

catch (Exception ex)

{

                    StatusLabel.Text = "The file could not be uploaded. The following error occured: "+ ex.Message;

  }

            }

else

                StatusLabel.Text =  "There is no picture file or content to upload.";  

        }

I get this part of the code while using the update panel "There is no picture file or content to upload. ";  If I take the panel out, then everything works

OK except that I loose the label fading action.

Horizontal scrollbar for asp.net ajax TabContainer

$
0
0

i have working with asp.net ajax tabcontainer in no of tabs that are not fit in our single row

i want scroll mt tabcontainer like below image

http://i.stack.imgur.com/VBmcd.png

 THANKING YOU,

SOMNATH KHARAT

UpdatePanel refreshing the whole form ??

$
0
0

Hi

I have quite a complex (large) form for users to complete.

To speed up the process I have used AJAX updatepanels

But the postback is cuaseing the whole form to refresh not just the Div.

What am I doing wrong please

Here is an example - this also refreshes the whole page (but I want to update just the Div with the DDL)

Thanks

J

Example

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><%@ Page Language="C#" %><script runat="server">
    protected void EnDisMyBox(object sender, EventArgs e)
    {
        var ddl = (DropDownList)sender;
        var digit = ddl.ID.Replace("DDLMyDiv", string.Empty);
        var textBox = (TextBox)Page.FindControl("TxTMyDiv" + digit);
        textBox.Enabled = ddl.SelectedValue == "Enable text box";
    }</script><html dir="ltr" xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><meta content="text/html; charset=utf-8" http-equiv="Content-Type" /><title>Test Page</title><style type="text/css">
input:enabled {
	background-color: #00FF00;
}
input:disabled {
	background-color: #FF0000;
}</style></head><body><form id="Myform" runat="server"><asp:ScriptManager runat="server" id="ScriptManager1"></asp:ScriptManager><asp:UpdatePanel id="UpdatePanel_Div1" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional"><ContentTemplate>	<div id="MyDiv1"><asp:DropDownList runat="server" id="DDLMyDiv1" AutoPostBack="true" OnSelectedIndexChanged="EnDisMyBox"><asp:listitem>Enable text box</asp:listitem><asp:listitem>Disable text box</asp:listitem><asp:listitem Selected="True">Select</asp:listitem></asp:DropDownList><asp:TextBox id="TxTMyDiv1" runat="server"></asp:TextBox></div></ContentTemplate></asp:UpdatePanel><asp:UpdatePanel id="UpdatePanel_Div2" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional"><ContentTemplate>	<div id="MyDiv2"><asp:DropDownList runat="server" id="DDLMyDiv2"  AutoPostBack="true" OnSelectedIndexChanged="EnDisMyBox"><asp:listitem>Enable text box</asp:listitem><asp:listitem>Disable text box</asp:listitem><asp:listitem Selected="True">Select</asp:listitem></asp:DropDownList><asp:TextBox id="TxTMyDiv2" runat="server"></asp:TextBox></div></ContentTemplate></asp:UpdatePanel><asp:UpdatePanel id="UpdatePanel_Div3" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional"><ContentTemplate>	<div id="MyDiv3"><asp:DropDownList runat="server" id="DDLMyDiv3"  AutoPostBack="true" OnSelectedIndexChanged="EnDisMyBox"><asp:listitem>Enable text box</asp:listitem><asp:listitem>Disable text box</asp:listitem><asp:listitem Selected="True">Select</asp:listitem></asp:DropDownList><asp:TextBox id="TxTMyDiv3" runat="server"></asp:TextBox></div></ContentTemplate></asp:UpdatePanel></form></body></html>

AjaxFileUpload dialog box - cant select multiple files

$
0
0

vs express 2012

targetFramework="4.0"

IE10

install ajax toolkit via manage nuGet packages for solution - and tried to reinstall it...

the prob: 

on dialog box - cant select multiple files... just one at the time.

i would like to have the same behavior like in the ajax control tool kit oficial page..

add in web.config:

<system.webServer><validation validateIntegratedModeConfiguration="false"/><handlers><add name="AjaxFileUploadHandler" verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler,            AjaxControlToolkit"/></handlers></system.webServer>

<form id="form1" runat="server"><asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager><div><asp:Label runat="server" ID="myThrobber" Style="display: none;"><img align="absmiddle" alt="" src="images/uploading.gif"/></asp:Label><asp:AjaxFileUpload ID="AjaxFileUpload1" runat="server"
                OnUploadComplete="AjaxFileUpload1_UploadComplete" 
                ThrobberID="myThrobber" MaximumNumberOfFiles="10" AllowedFileTypes="jpg,jpeg,gif" /></div></form>
protected void AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
    {
        //string filePath = "~/upload/" + e.FileName;
        //AjaxFileUpload1.SaveAs(filePath);

    }




 

Duplicate TabPanels

$
0
0

Platform: C#, VS2010, .Net Framework 4.0, AjaxToolkit v4.1.7.1213, using HTML5

At random I keep getting duplicate TAB panels generated on my aspx page, not all the time but it happens after configuring a textbox, label, and or validation control inside a tab panel; I'll change some property on a control inside a tabpanel and all of a sudden errors start appearing in the debug window saying that I have TabPanel ID(xxx) already inuse.

Attempts to fix this include removing the AjaxToolkit from the project, download a new one and reinstall; this works for awhile then starts up again.

This is on a new ASPX page with nothing more than a div header with a few labels and text boxes with and an image, then a body div tag with a scriptmanager and a 6panel ajax tab control - many thanks for any help with this.

Two Select Boxes with Ajax

$
0
0

Please I have two select boxes. One retrieves Faculties from database and the other Department.

I have a one to many relationship of faculty (one part) and department (many part).

What I want to do is when a faculty is selected all department having the faculty's primary key as their foreign key is retrieved. Thanks

Is that possible to delay content load when using asp.net update panel

$
0
0

Alright i will try to explain my question as much as possible.

Here an asp.net update panel full page postback

enter image description here

As you can see it took 215 ms to complete.

However i want new content to be updated only when total 400 ms time passed. Is this possible ? So the request will be completed however it will wait 185 ms more to display postback result.

Thank you

additional info

As you can know there is no certain time when will postback completed. However i want to set a certain threshold. For example 400 ms. So if postback get completed before 400 ms, it will wait total time 400 ms before updating update panel. If it gets completed more than 400 ms there is no problem.

There must be some javascript function etc that replaces current content of update panel once it is done. Now this is the tricky part.

Once postback started i need to start a time. After postback finished i need to check how much time passed. If it reached my threshold i should let javascript to replace inside of update panel. However if the timer is not reached the threshold yet, it should wait until timer reaches threshold then allow new content updating inside update panel.

asp.net 4.5 c#


Why is not this added

$
0
0

I use VS 2010 Professional

I save my web project by selecting File ->save all
Then I have download the AjaxControlToolkit.
Then I use Nuget to install AjaxControlToolKit. When I do this the bin directory is created in the solution  it looks like this

Bin
   ar
   cs
   de
   es

and so on

Now as the third step I add a tab in the Toolbox and select the AjacControlToolkit.dll so about 40 contols is added to the new tab named AjaxControlToolkit.
If I now for example drag the extender control CalendarExtender from the toolbox to a new aspx page the
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
is now added so when I run the page I get this error
Could not findany resourcesfor the specifiedcultureorthe neutralkultureCheck that AjaxControlToolkit.Properties.Resources.NET4.resourcesembedded inorlinkedto the compositionAjaxControlToolkitcorrect at compilation time,or that all necessarysatelliteassemblies canbe loadedand isfullysigned.

So what is it that I have missed when this
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
is not added

//Tony

Line Chart

$
0
0

I can't get the ajax line chart to render in the browser. 

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><asp:LineChart ID="LineChart1" runat="server" ChartHeight="250" ChartTitle="Chart Title" ChartWidth="400" CategoriesAxis="1,2,3,4,5,6"><Series><asp:LineChartSeries Data="3,7,2,7,5,1" LineColor="Blue" Name="Series#1" /></Series></asp:LineChart>

Open a new tab in the Tab Container

$
0
0

I have one tab in asp.net ajax tab container with web-based application with textbox, button search, and gridview with hyperlink navigateURL : http://www.abc.org/AllNames/PersonalNames?By=Names=john

When I clicked the hyperlink, I would like  to open the second tab in same tab container with title name and results of numbers of records count.

 ___________________________   _______________________________________________________________

|__Tab one________________| |_Tab Two with title name & number of records found_|

No a new window, just open the second tab.

 

 

 

AjaxFileUpload preview missing

$
0
0

Hi,

I am using the following pieces of code to upload images

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager><asp:ajaxfileupload ID="Ajaxfileupload1" runat="server" OnUploadComplete="FileUploadComplete"></asp:ajaxfileupload>
protected void FileUploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e)
{
  string filePath = @"C:\Test\" + e.FileName;
  Ajaxfileupload1.SaveAs(filePath);
}



http://imgur.com/KJWA7U4

If you look at the image, there is no preview of the image unlike what the demo shows here http://www.asp.net/AjaxLibrary/AjaxControlToolkitSampleSite/AjaxFileUpload/AjaxFileUpload.aspx

Two things here

a) Can you please let me know how can I get the preview of the image?

b) If I want to upload pdf, is there a way to put a URL next to the uploaded pdf pointing to its location. Since this is all handled by ajaxfileupload internally, I am not sure how to add a link to access the pdf.

Thanks

CalendarExtender Popup location

$
0
0

I have a Master/Detail Grid that uses two GridViews. I have a TextBox with an attached CalendarExtender in the last cell of the Details GridView. The problem is that the CalendarExtender popup is mostly hidden, if not completely hidden, by the GridView rows above or below the row where the attached TextBox click occurred.  I need a way to either:

1. Specify a location to show the CalendarExtender that is outside the GridView or

2. Find a way to automatically increase the Row height when the CalendarExtender is shown.

ASP.NET (VB.NET) Autocomplete AJAX problems.

$
0
0

I am trying to implement an Autocomplete but having problems. Please help.

i have added the toolkit. I have added these controls

<asp:ToolkitScriptManager runat="server" ID="SM" /><asp:AutoCompleteExtender runat="server" ID="autoComplete" ServiceMethod="GetCompletionList" TargetControlID="TextBox1" CompletionInterval="1000" CompletionSetCount="2" MinimumPrefixLength="1" /><asp:TextBox runat="server" ID="TextBox1" />

Firsty, if I click on the control in DESIGN view and click on Add Autocomplete page method. I get an error

Unexpected Error (TargetInvocationException):Exception has been thrown by the target of the invocation......

It however lets me carry on and created the following code

Public Function GetCompletionList() As System.String[]

End Function

So i replace this code with

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

I then run the website, but when I star typing Star Wars in the txt box, nothing happens. I put a debug break at the Dim in the above code but the debugger does not stop thus meaning that this code is not even being run. I thought that if I could at least get it run this code then I could have a good go at debugging myself but the fact that it does not even hit this code means that is a problem way before this.

Anyone shed any light on this to what the problem may be.....

Thanks in advance.

ValidatorCalloutExtender does not work in this very simple aspx file

$
0
0

When I leave the textbox txtFirstName empty and click the button only the text "Enter a name" from RequiredFieldValidator is displayed.So the ValidatorCalloutExtender does not have any effect on the displayed error message.

I use the AjaxControlToolkit for .NET 4.5 and I use VS 2013 Ultimate

In this some kind of bug it's a very basic page.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Modul_3.WebForm1" %>
<%@ 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">
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>

        <asp:Label ID="Label1" runat="server" Text="FirstName" />
        <asp:TextBox ID="txtFirstName" runat="server" />
          
        <asp:RequiredFieldValidator ID="rfvFirstName" runat="server" ControlToValidate="txtFirstName" ErrorMessage="Enter a name" Display="Dynamic">
        </asp:RequiredFieldValidator>

        <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" Width="350px"
            TargetControlID="rfvFirstName">
        </asp:ValidatorCalloutExtender>

        <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />
    </form>
</body>
</html>

//Tony


Why is not ValidatorCalloutExtender working in VS 2013 web application

$
0
0

I have two machine.
The first one has VS professional 2010I create a web application project and install AjaxControlToolKit 4.0 in the Toolbox and ValidatorCalloutExtender work as it should in this small snippet that is listed below.

Now I do the same on another machine. I create a web application project where I have VS 2013 Ultimate and I install AjaxControlToolKit 4.5 in the Toolbox and now the ValidatorCalloutExtender doesn't work in spite having the identical program that is listed below.
The bin directory is there and when I drag this control
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
this
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
is added

When I run the page code listed below the ValidatorCalloutExtender doesn't do anything with the error message.
It's only the ErrorMessage from RequiredFieldValidator that is displayed.
I tried to add FilteredTextBoxExtender and this worked fine.

If I use the whole solution project folder that I used on VS 2010 on VS 2013 it works fine because everying is inluded then.


So is it anyone that have some suggestion to this problem ?
The program looks like this
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="WebForm1.aspx.cs" Inherits="WebForm1" %>
<%@ 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">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>
 
     <label class="label" for="<%=txtOrderLev.ClientID%>">När vill du få dem levererade</label><br />
        <asp:TextBox ID="txtOrderLev" runat="server" />
        <asp:RequiredFieldValidator ID="RequiredFieldtxtOrderLev" runat="server"
            ErrorMessage="Ange datum enligt format (YYYY-MM-DD)" ControlToValidate="txtOrderLev"
            ForeColor="#FF3300" Display="Dynamic" />
        <asp:ValidatorCalloutExtender ID="ValidatorCalloutExtender2" runat="server" Width="350px"
            TargetControlID="RequiredFieldtxtOrderLev" />
    <asp:Button ID="Button1" runat="server" Text="Button" />
    </form>
</body>
</html>

//tony

modal Popup

$
0
0

actually, I don't know if this is a problem with the ajax or something else. I have a panel holding a formview tha uses modal popup to display it. I have an image button the uses it's click event to  Show () the popup and it worked fine for a    day or so. Now clicking  the image button does nothing. It does not error but when debugging it just does not trigger the click event. I also noticed that when i look at the smart tab for the panel, it never asks if you want to remove the extender, even though there is one there.

The sourse for he image button , the panel (curtailed) and the modal popup are as follows:

<asp:ImageButton ID="imgaddlog" runat="server" ImageUrl="~/Images/Icons/addride.png" ToolTip="Add Log" Width="16px" OnClick="imgaddlog_Click" /><asp:Panel ID="pnlAdd" runat="server" CssClass="modalPanel" Width="700px" style="margin-top:10px; display:none"><asp:FormView ID="FormView1" runat="server" DataKeyNames="rideid" DataSourceID="SqlDataSource3" OnDataBound="FormView1_DataBound" OnModeChanged="FormView1_ModeChanged" Width="680px" DefaultMode="Insert"><ajaxToolkit:ModalPopupExtender ID="pnlAdd_ModalPopupExtender" runat="server" DynamicServicePath="" Enabled="True" OkControlID="InsertButton" TargetControlID="Button4" PopupControlID="pnlAdd" CancelControlID="InsertCancelButton"></ajaxToolkit:ModalPopupExtender><asp:Button ID="Button4" runat="server" Text="Button" style="display:none" />

and the click event this used to retreive the data and display it properly - now it does not fire.

:

protected void imgaddlog_Click(object sender, ImageClickEventArgs e)
    {
        rider rd = new rider();
        FormView1.DefaultMode = FormViewMode.Insert;
        FormView1.Caption = "Enter Ride Data for: " + DateTime.Today.ToShortDateString() + " for " + rd.getdisplayname(rid);
        DropDownList ddlts = (DropDownList)FormView1.FindControl("ddltscale");
        Char degree = (Char)176;
        string degreef = degree + "F";
        string degreec = degree + "C";
        ddlts.Items.Add(new ListItem(degreef, "I"));
        ddlts.Items.Add(new ListItem(degreec, "M"));


        pnlAdd_ModalPopupExtender.Show();
    }

Ajax static method in master page

$
0
0

I have below coding to show a slideshow in MasterPage

<asp:Panel ID="Panel5" runat="server" Width="700px" Height="150px"><asp:Image runat="server" ID="img" Width="700px" Height="150px" /><asp:SlideShowExtender ID="SlideShowExtender5" runat="server" SlideShowServiceMethod="GetSlides" TargetControlID="img" UseContextKey="True"></asp:SlideShowExtender></asp:Panel>

To where I can add this GetSlides() static method in master page? Because it gives an runtime error always method is not available.

Ajax Pie Chart

$
0
0

i  use Ajax Pie Chart in Asp.net application,it's works fine but when numerical data becames increases then chart not fill properly...

Error : javascript unable to set value of the property object is null or undefined

$
0
0

Hi all,

  Do anyone facing an error on IE when using javascript or updatepanel in asp.net ? the error message as below :

javascript unable to set value of the property object is null or undefined

Hope someone can share the solution with me.

Thank You.

Viewing all 5678 articles
Browse latest View live


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