ajaxcontroltoolkit BarChart, gap between the column
AjaxFileUpload "OnClientUploadError" event not firing
Hi,
I have used "AjaxFileUpload" control.
<asp:AjaxFileUpload ID="AjaxFileUpload" MaximumNumberOfFiles="1" ContextKeys="KeyHiddenField" OnUploadComplete="AjaxFileUpload_OnUploadComplete" OnClientUploadComplete="OnClientUploadComplete" OnClientUploadError="OnClientUploadErrorTest" runat="server" />
In code behind
protected void AjaxFileUpload_OnUploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { // want to fire "OnClientUploadError" javascript event here explicitely. throw new NullReferenceException(); }
Javascript :
function OnClientUploadErrorTest(sender, args) { }
OnClientUploadComplete is firing properly.
For testing i want to fire OnClientUploadError event in JavaScript for that I have explicitly thrown exception in code behind.
But it’s not firing at all.
NumericUpDownExtender and js
I am using the NumericUpDownExtender for the first time in an asp.net page. I have a TextBox that is inside a GridView and I want to do a calculation in javascript whenever the value is changed by user typing OR using the extender. I am adding the attribute in the RowDatabound event of the GridView as shown below. Also, I have included the event code I have created. The problem I am having is that the "onchange" event is running for each row on the GridView during databound, I think. How can I make this work without having the onchange event fire except when the TextBox is changed or the NumericUpDownExtender is clicked? Thanks.
<asp:TemplateField HeaderText="Grams"><ItemTemplate><asp:TextBox ID="txtActGrams" runat="server" Text='<%# Bind("ActGrams") %>' CssClass="txtright" Width="40"></asp:TextBox><asp:NumericUpDownExtender ID="NumericUpDownExtender1" runat="server" TargetControlID="txtActGrams" Width="60" Minimum="0"></asp:NumericUpDownExtender><asp:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" TargetControlID="txtActGrams" ValidChars="0123456789."></asp:FilteredTextBoxExtender></ItemTemplate><FooterTemplate><asp:Label ID="LblActual" runat="server" Text="Actual" BackColor="White"></asp:Label><br /><asp:Label ID="LblGoal" runat="server" Text="GOAL" Font-Bold="True"></asp:Label></FooterTemplate></asp:TemplateField> Protected Sub gvActualFoods_RowDataBound(sender As Object, e As System.Web.UI.WebControls.GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then If e.Row.RowState = DataControlRowState.Normal Or e.Row.RowState = DataControlRowState.Alternate Then Dim tx As TextBox = e.Row.FindControl("txtActGrams") tx.Attributes.Add("onchange", "confirmDel('test');") End If End If End Sub
modalPopupextender exception
Hi, I keep getting the error message below and have run out of options at this point. Basically, I need to use the modalPopupextender for displaying a message but for some reason, this is not working as supposed to and I keep getting the exception message below. Anyone know how I can fix this? Thanks in Advance
Object reference not set to an instance of an object.
Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.] AjaxControlToolkit.ModalPopupExtender.ChangeVisibility(Boolean show) in d:\E\AjaxControlToolkit_AjaxTk\Release\AjaxControlToolkit\ModalPopup\ModalPopupExtender.cs:231 AjaxControlToolkit.ModalPopupExtender.OnPreRender(EventArgs e) in d:\E\AjaxControlToolkit_AjaxTk\Release\AjaxControlToolkit\ModalPopup\ModalPopupExtender.cs:209 System.Web.UI.Control.PreRenderRecursiveInternal() +86 System.Web.UI.Control.PreRenderRecursiveInternal() +170 System.Web.UI.Control.PreRenderRecursiveInternal() +170 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041 |
AJAX cascading dropdown not populating - 500 error
NOTE: I asked this question on social.msdn.microsoft.com and was instructed to ask the question here instead.
I have two dropdown controls in a web form and I would like for the results of the second to be dependent upon the value chosen in the first, hence CascadingDropDown AJAX control.
When the page loads I click the first dropdown and get a [Method Error 500]. I have looked at every forum and article I can find and nothing suggested seems to resolve my problem. I can't even get data into the first dropdown, much less a cascading effect.
If I attempt to debug and go directly to the ASMX in my browser the GetClients method returns all clients if I enter blank values for both knownCategoryValues and category.
If I attempt to debug and go directly to the ASMX in my browser the GetFileTypesForClient method returns an XML string ArrayOfCascadingDropDownNameValue with no child nodes.
The AJAX controls are registered in web.config.
When I debug the ASMX method CascadingDropDownNameValue the kv variable contains no items so I have commented it out and figured that I would play with that later. It does throw the ArgumentException.
Please have a look and see if you can find any stupid mistakes I may have made.
Thanks!
EnterTransaction.aspx
<asp:SqlDataSource runat="server" ID="dsClients" ConnectionString="<%$ ConnectionStrings:INTP1 %>" SelectCommand="SELECT DisplayName, DBName, DisplayName + ' (' + DBName + ')' AS DisplayText, ID FROM DataOperations.dbo.vwClientDatabases ORDER BY DisplayName + ' (' + DBName + ')'" /><asp:SqlDataSource runat="server" ID="dsClientFiles" ConnectionString="<%$ ConnectionStrings:INTP1 %>" SelectCommand="SELECT cf.ClientFileID, cf.DBLIstID, db.DisplayName + ' - ' + clft.LocalFileTypeName AS DisplayText FROM DataOperations.DET.ClientFile AS cf JOIN DataOperations.DET.ClientLocalFileType AS clft ON cf.DBListID = clft.DBListID AND cf.ClientLocalFileTypeID = clft.LocalFileTypeID join DataOperations.dbo.vwClientDatabases db on db.ID = cf.DBListID ORDER BY db.DisplayName + ' (' + db.DBName + ')', LocalFileTypeName" /><asp:SqlDataSource runat="server" ID="dsTransactions" ConnectionString="<%$ ConnectionStrings:INTP1 %>" SelectCommand="SELECT * FROM DataOperations.DET.FileTransaction" /><asp:Table runat="server" ID="tblForm"><asp:TableRow runat="server"><asp:TableCell runat="server" >Client</asp:TableCell><asp:TableCell runat="server" ><asp:DropDownList runat="server" ID="ddlClients" /> <%-- DataSourceID="dsClients" DataValueField="ID" DataTextField="DisplayText" --%><ajaxToolkit:CascadingDropDown ID="cddClients" runat="server" ServicePath="~/ClientFileTypes.cs.asmx" ServiceMethod="GetClients" TargetControlID="ddlClients" Category="Client" PromptText="Select Client..." /></asp:TableCell></asp:TableRow><asp:TableRow runat="server"><asp:TableCell runat="server" >Client File</asp:TableCell><asp:TableCell runat="server" ><asp:DropDownList runat="server" ID="ddlClientFiles" /> <%-- DataSourceID="dsClientFiles" DataValueField="ClientFileID" DataTextField="DisplayText" --%><ajaxToolkit:CascadingDropDown ID="cddClientFiles" runat="server" ServicePath="ClientFileTypes.cs.asmx" ServiceMethod="GetFileTypesForClient" TargetControlID="ddlClientFiles" ParentControlID="ddlClients" LoadingText="Loading..." Category="Client" PromptText="Select File Type..." /></asp:TableCell></asp:TableRow><asp:TableRow runat="server"><asp:TableCell runat="server" >Load Date</asp:TableCell><asp:TableCell runat="server" ><asp:Button runat="server" ID="btnSubmit" Text="Add File Transaction" OnClick="btnSubmit_Click" /></asp:TableCell></asp:TableRow></asp:Table>
ClientFileTypes.asmx.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Services; using System.Configuration; using System.Web.Script.Services; using AjaxControlToolkit; using System.Web.Services.Protocols; using System.Collections.Specialized; using System.Data.SqlClient; namespace DETTracker { /// <summary> /// Summary description for ClientFileTypes /// </summary> [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] [System.ComponentModel.ToolboxItem(false)] // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. [System.Web.Script.Services.ScriptService] public class ClientFileTypes : System.Web.Services.WebService { [WebMethod] public CascadingDropDownNameValue[] GetClients(string knownCategoryValues, string category) { SqlConnection sqlConn = new SqlConnection(ConfigurationManager.ConnectionStrings["INTP1"].ConnectionString); sqlConn.Open(); SqlCommand sqlCmd = new SqlCommand("SELECT DisplayName, DBName, DisplayName + ' (' + DBName + ')' AS DisplayText, ID FROM DataOperations.dbo.vwClientDatabases ORDER BY DisplayName + ' (' + DBName + ')'", sqlConn); SqlDataReader dr = sqlCmd.ExecuteReader(); List<CascadingDropDownNameValue> l = new List<CascadingDropDownNameValue>(); while (dr.Read()) { l.Add(new CascadingDropDownNameValue(dr["DisplayText"].ToString(), dr["ID"].ToString())); } sqlConn.Close(); return l.ToArray(); } [WebMethod] public CascadingDropDownNameValue[] GetFileTypesForClient(string knownCategoryValues, string category) { int nDBListID = -1; //StringDictionary kv = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues); //if (!kv.ContainsKey("Client") || !Int32.TryParse(kv["Client"], out nDBListID)) //{ // throw new ArgumentException("Couldn't find vendor."); //}; bool bReturn = Int32.TryParse(knownCategoryValues, out nDBListID); SqlConnection sqlConn = new SqlConnection(ConfigurationManager.ConnectionStrings["INTP1"].ConnectionString); sqlConn.Open(); SqlCommand sqlCmd = new SqlCommand("SELECT cf.ClientFileID, cf.DBLIstID, db.DisplayName + ' - ' + clft.LocalFileTypeName AS DisplayText FROM DataOperations.DET.ClientFile AS cf JOIN DataOperations.DET.ClientLocalFileType AS clft ON cf.DBListID = clft.DBListID AND cf.ClientLocalFileTypeID = clft.LocalFileTypeID JOIN DataOperations.dbo.vwClientDatabases db on db.ID = cf.DBListID WHERE db.ID = @DBListID ORDER BY db.DisplayName + ' (' + db.DBName + ')', LocalFileTypeName", sqlConn); sqlCmd.Parameters.AddWithValue("@DBListID", nDBListID); SqlDataReader dr = sqlCmd.ExecuteReader(); List<CascadingDropDownNameValue> l = new List<CascadingDropDownNameValue>(); while (dr.Read()) { l.Add(new CascadingDropDownNameValue(dr["DisplayText"].ToString(), dr["ClientFileID"].ToString())); } sqlConn.Close(); return l.ToArray(); } } }
AjaxFileUpload and AllowedFileTypes
I just downloaded the latest update of the toolkit, and I'm attempting to use the AjaxFileUpload control. I really like how easy it is to use, and in Chrome 18 the drag-drop functionality works great.
I'm struggling, however, to get the property "AllowedFileTypes" to work correctly. If it's blank, then the control allows files to be uploaded. However if I set it to "zip" (or any value), then it doesn't accept any files at all; even those with the extension"zip". I've tried setting it to "zip,jpg" in case there was a parsing issue with the control, but that doesn't work either.
Has anyone else had the same issue?
Cheers, Jon
Moveable ModalPopupExtender recentering after window scroll
Hi, I have a large VS 2010 form with a moveable ModalPopupExtender hooked to a 'comments' panel to allow the user to drag the panel to reveal information on the form for reference when entering the comments. When the user moves the panel and scrolls the form, the panel recenters. Is there a way to avoid this behaviour?
Thanks
updatepanel.update is not updating
I am using one updatepanel to do the partial update. This works well when I call the method UpdatePanel.Update and the Update mode is "Conditional". This panel is not updating when there any required field validators are included in the page and they have some error. Can I update the updatepanel even there are some validation errors on the page.
I have hidden field filed in the form and on a button click event of updatepanel, I will open a popup and call the __dopostback() method. This causes the post back of the page and hit the HiddenfieldforCallTax_ValueChanged event, where I am trying to update the update panel
protected void HiddenfieldforCallTax_ValueChanged(object sender, EventArgs e) { UpdatePanel updatePanelItems = panelTaxCaller.FindControl("UpdatePanelForItem") as UpdatePanel; BindItems(); // Rebinds the items in the Repeater which is in updatepanel which in turn contains table and gridview inside updatePanelItems.Update(); }
My Accordian control is not firing the ItemDataBound event
Hi,
I'm trying to get this accordian to get my data to display with a gridview in it, it renders fine, my datatable is being filled and it seem to bind but then there it no data and it skips my itemdatabound event in my code behind... Nothing loads!
Can anyone tell me if there is a bug with the databound event in vb.net or for this ajax control?
Partial Public Class WebForm1 Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then getCategories() End If End Sub Public Sub getCategories() Dim dt As DataTable = processTask.getAllIntranetTasks(134) Accordion1.DataSource = dt Accordion1.DataBind() End Sub Protected Sub Accordion1_ItemDataBound(ByVal sender As Object, ByVal e As AjaxControlToolkit.AccordionItemEventArgs) Handles Accordion1.ItemDataBound If e.ItemType = AjaxControlToolkit.AccordionItemType.Content Then Dim dt As DataTable = processTask.getTaskDescription((CType(e.AccordionItem.FindControl("txt_ID"), HiddenField).Value)) Dim grd As New GridView() grd = CType((e.AccordionItem.FindControl("GridView1")), GridView) grd.DataSource = dt grd.DataBind() End If End Sub End Class
<div><ajaxToolkit:Accordion ID="Accordion1" runat="server" TransitionDuration="100" FramesPerSecond="200" FadeTransitions="true" RequireOpenedPane="false" ContentCssClass="acc-content" HeaderCssClass="acc-header" HeaderSelectedCssClass="acc-selected"><Panes></Panes><HeaderTemplate><%#DataBinder.Eval(Container.DataItem, "FORENAME")%></HeaderTemplate><ContentTemplate><asp:HiddenField ID="txt_ID" runat="server" Value='<%#DataBinder.Eval(Container.DataItem,"ID") %>' /><asp:GridView ID="GridView1" runat="server" RowStyle-BackColor="#ededed" RowStyle-HorizontalAlign="Left" AutoGenerateColumns="false" GridLines="None" CellPadding="2" CellSpacing="2" Width="300px"><Columns><asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="Product Name" HeaderStyle-BackColor="#d1d1d1" HeaderStyle-ForeColor="#777777"><ItemTemplate><%#DataBinder.Eval(Container.DataItem, "FORENAME")%></ItemTemplate></asp:TemplateField></Columns></asp:GridView></ContentTemplate></ajaxToolkit:Accordion></div>
AJAX calendar extrender control event to initiate javascript
I have an AJAX calendar extender on a textbox. I am trying to bold certain dates based on an array that is sent to javascript using a script manager from VB code behind. The process is working great for the current month only.
I am updating the style to BOLD on the calendar when AJAX onClientShown event fires.
My issue is when the month is changed, it appears I need to again process my date array for the new month that the user may have advanced the calendar to.
I can not figure out how to fire the javascript function again when the AJAX calendar extender control advances months.
ASPX....
<asp:CalendarExtender ID="TextBox2_CalendarExtender" BehaviorID = "_Calendar1" runat="server" Enabled="True" TargetControlID="TextBox2" OnClientShown="boldCalDTS" >
The javascript just searches for the title tags which are the dates in the array and changes the style.
"Method error 500" with CascadingDropDown
I have a web service that I'm binding to the CascadingDropDown. The service runs perfectly fine. However, I'm receiving a "Method error 500." Again, I'm sure I'm missing something small like a reference or something, but I can't seem to find it.
HTML Editor not working in iPad
Hi All,
I am using HTMLEditorExtender in simple asp web project. While accessing that in iPad (iOS 7) its not allow me to type at all. Only the control is visible in screen.
ajax tool kit
Implementing Line/Bar Charts with/without Ajax
Hi All,
I am looking for references to implement Line /Bar Chart in my project and I found implementation with and w/o Ajax like below:
<asp:ChartID="Chart1"runat="server">
or
<ajaxToolkit:LineChart ID="LineChart1" runat="server">
I tried an example w/o Ajax and works fine. However, I want to understand which approach should be used and what are the advantages?
Also the other issue is in my AjaxToolkit, I dont see any chart controls like LineChart, PieChart,BarChart.(PS: Ajax is successfuly installed and registered as I am already using ajaxTabContainer and its working fine, so no issues with AjaxToolkit registrtaion)
I tried this:
<ajaxtoolkit:LineChartID="LineChart1"runat="server"></ajaxtoolkit:LineChart>
Warning 1 Element 'LineChart' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing. D:\WebApp_14Nov\AssessmentSummary.aspx 27 18 D:\WebApp_14Nov\
Error 3 Unknown server tag 'ajaxtoolkit:LineChart'. D:\WebApp_14Nov\AssessmentSummary.aspx 27
Any inputs will be really helpful!!
AjaxFileUpload causes javascript error with authorization
Using AjaxFileUpload in WebForms targetting .NET 4.5.1, I get a javascript error only under a certain condition. This is the error:
throw "error raising upload complete event and start new upload"
And the condition:
Error only occurs when I include a web.config authorization element somewhere in the page's directory tree: deny users="?"
If I comment out the condition to restrict to authenticated users, AjaxFileUpload works successfully. If I apply this as a single condition in the authorization element (deny users), then the error is thrown.
how to do Pagination in ajax
Hi,
i am appending html table into div tag using ajax,in that how do pagination
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "MasterService.asmx/LoadClaim",
dataType: "json",
success: function (data) {
var div = $("#test").empty();
$(data.d).each(function (index, item) {
div.append(data.d
);--am appending html table inside div tag ,give me solution do pagination in that
});
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
debugger;
}
});
});
Thanks
0x800a1391 - JavaScript runtime error: 'XPathEvaluator' is undefined
Any help with this error would be great
Unhandled exception at line 1, column 88 in http://ml-webapp-dev/wv/App_Scripts/Compat.js?bn=90694609
0x800a1391 - JavaScript runtime error: 'XPathEvaluator' is undefined
get table row value using ajax
hi,
i want to get table row value
this is my coding but cant get table value
<table>
<tr>
<td class="editable"> <a class="query" href="#"> <input type='text' name='postcode' id='txt_Address1' value=''/> </a> </td>
<td class="editable"> <a class="text" href="#"><input type='text' name='postcode' id='txt_Address2' value=''/> </a> </td>
</tr>
</table>
<input type="button" id="detect_rel" value="detect"/>
$('#detect_rel').click(function() {
$('tr').each(function(i, el) {
var query = $(el).children('td').children('.query').text();--How to get textbox value
var text = $(el).children('td').children('.text').text();
alert(query + " " + text);
//$.ajax (do your AJAX call here using values of query and text
});
});
thanks
thanks
Asp:Timer & ajax Update panel not working on server.
Hello ,
I just take a timer control to refresh update panel on timed interval . Its working fine on local system but when i published code on server, its not working . I am not getting any error on page but update panel is not refreshing on timed interval . and when i open browser error console window i see the follwing error many times
com is undefined
chrome://vidbar/content/downloader.js
Thanks & Regards
Shwetamber
How to hide row in table
hi
<tr id="tempTR">
<td><span class="required">*</span> State:</td>
<td><input type="text" name="lastname" id="txt_State" runat="server" value=""/>
</td>
$(document).ready(function ($) {
$('#tempTR').hide();--here hiding table row
}
how to unhide that row
function handleClick1(obj) {
$('#tempTR').style.display = 'block';--this coding doesnot work for me
}
give me solution visible that row
thanks