Showing posts with label examples. Show all posts
Showing posts with label examples. Show all posts

Monday, March 26, 2012

CaseAnimation example?

Hey,

I'm looking to use the CaseAnimation, but don't find any examples of them used (including a same for each under the animation reference document would assist people) ..


Thanks,

Hi ,

I have an example of the caseAnimation posted up here.

http://blogs.msdn.com/phaniraj/archive/2007/03/21/how-to-using-ms-ajax-caseanimation-in-your-applications.aspx

Including an example for each type is a good idea .

Hope this helps.

If it resolves the issue , be sure to mark my reply as the answer

Saturday, March 24, 2012

CascadingDropDown with a DB causing stack overflow

I've struggled for days through examples and self discovery to get to where I am, and now I get a stack overflow error from my cascadingdropdown object which is attempting to retrieve data from a tableadapter. When the page loads I get a msgbox pop-up error which says: "Stack overflow at line: 116". I've tried commenting out most every line in the webservice function and that seems to have no discernible effect. Perhaps it's something in the aspx page? Any help greatly appreciated.

Here's my aspx:

-------------------------------------------

<%@dotnet.itags.org. Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %
<%@dotnet.itags.org. Register
Assembly="AjaxControlToolkit"
Namespace="AjaxControlToolkit"
TagPrefix="ajaxToolKit" %
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<br />
<br />
<div>
<asp:DropDownList ID="ddl_GetService" runat="server">
</asp:DropDownList> <br />

<asp:DropDownList ID="DropDownList2" runat="server">
</asp:DropDownList><br />
<br />
<asp:DropDownList ID="DropDownList3" runat="server">
</asp:DropDownList><br />
<br />
<br />

<ajaxToolKit:cascadingdropdown id="CascadingDropDown1" runat="server" TargetControlID="ddl_GetService" Category="Service" PromptText="Select a Service Code" ServicePath="wsGetServices.asmx" ServiceMethod="GetAllServices" ParentControlID="ddl_GetService" >
</ajaxToolKit:cascadingdropdown>
<br />
</div>
<br />
<br />
<br />

</form>
</body>
</html>


-------------------------------------------

Here's my asmx file:

-------------------------------------------

<%@dotnet.itags.org. WebService Language="VB" Class="wsGetServices" %
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports AjaxControlToolkit
Imports Facilities_WizardTableAdapters
Imports System.Collections
Imports System.Collections.Generic
Imports System.Collections.Specialized

<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<System.Web.Script.Services.ScriptService()> _
Public Class wsGetServices
Inherits System.Web.Services.WebService

<WebMethod()> _
Public Function GetAllServices(ByVal sServRsn As String, ByVal sCode As String) As AjaxControlToolkit.CascadingDropDownNameValue()
Dim ServiceTableAdapter As TBL_WZ_SERVICETableAdapter = Nothing
ServiceTableAdapter = New TBL_WZ_SERVICETableAdapter()
Dim Services As Facilities_Wizard.TBL_WZ_SERVICEDataTable = ServiceTableAdapter.GetServices()
Dim values As List(Of CascadingDropDownNameValue) = New List(Of CascadingDropDownNameValue)
Dim dr As Facilities_Wizard.TBL_WZ_SERVICERow

For Each dr In Services
sServRsn = dr.SERV_RSN.ToString()
sCode = dr.CODE.ToString()
values.Add(New CascadingDropDownNameValue(sServRsn, sCode))
Next dr

Return values.ToArray()

End Function

End Class

I discovered that it's a stack overflow because it's working! And the number of rows returned is rather large. So does anyone know how I can accomodate for that? I mean a drop down with say around 300 entries?

Thanks!


It's not clear to me why returning lots of entries should cause a stack overflow. Maybe run this page under the VS debugger and have a look at what's on the stack at the time - that should help narrow the problem down.

I am having a similar issue today. I know my webservice is working and it only returns 27 records. here is my ASMX file if anyone has any advice:

<%

@.WebServiceLanguage="VB"Class="LHMCSearchDD" %>

Imports

System.Web

Imports

System.Web.Services

Imports

System.Web.Services.Protocols

Imports

System.Collections.Generic

Imports

System.Data

Imports

System.Data.SqlClient

Imports

System.Configuration

Imports

AjaxControlToolkit

<WebService(Namespace:=

"http://tempuri.org/")> _

<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _

<System.Web.Script.Services.ScriptService()> _

Public

Class LHMCSearchDDInherits System.Web.Services.WebService

<WebMethod()> _

PublicFunction GetProducts(ByVal knownCategoryValuesAsString,ByVal categoryAsString)As AjaxControlToolkit.CascadingDropDownNameValue()Dim cadapterAsNew dsSearchTableAdapters._PRODUCTTableAdapter' Dim cadapter As New dsSearch.DSTablesTableAdapters.countryTableAdapterDim ctableAsNew dsSearch._PRODUCTDataTable' Dim ctable As New ltcodebehind.DSTables.countryDataTable

cadapter.FillBrands(ctable)

Dim valuesAsNew List(Of AjaxControlToolkit.CascadingDropDownNameValue)For iAsInteger = 0To ctable.Count - 1

values.Add(

New CascadingDropDownNameValue(ctable(i).B_NAME, ctable(i).B_NAME))NextReturn values.ToArrayEndFunction

End

Class
I'm having the similar problem. Any new ideas on how to solve it?

There is nothing to do with the number of rows returning from the service. The problem is with your cascadingDropdown declaration.The value for TargetControlID and ParentControlID are given as same, which is causing a recursive call and there by stack overflow.

<ajaxToolKit:cascadingdropdown id="CascadingDropDown1" runat="server"TargetControlID="ddl_GetService" Category="Service" PromptText="Select a Service Code" ServicePath="wsGetServices.asmx" ServiceMethod="GetAllServices"ParentControlID="ddl_GetService" >

-Sajid T.K

CascadingDropDown using SQL in VB example anyone?

I'm new to using the AjaxControlToolkit, and I'm finding lots of variations in the examples out there. I would like to use the CascadingDropDown control to populate a State, and Country drop down. I am using ASP 2.0, and I'm developing code using Visual Web Developer 2005 Express. The data files reside on a separate SQL 2000 server.

Does anyone have a good example out there? All of the tutorial videos either use an XML file for the data, or have tags that are no longer supported in the latest tool kit (like CascadingDropDownProperties).

I had the same problem with the Ajax Tab controls (lots of different versions), but figured that one out. Not finding much on the web.

Any help would be greatly appreciated.

Hi and welcome to the forums.

Have you checked this tutorial.http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Walkthrough/CCDWithDB.aspx. Though this is in C#, it is very simple. Try to convert it yourself or else try this tool to convert from C# code to VBhttp://labs.developerfusion.co.uk/convert/csharp-to-vb.aspx. If you still have problems, then post it here and we will convert it.

All the best.


Yes, I've viewed that video. What would I have to change to make the example in this video point to SQL tables? Or, If I convert my Country table, and State table to one XML file, how would I handle countries with no states?

I would really like to find an example that uses the current Ajax Control Toolkit for ASP.Net 2.0 that uses SQL tables. In the meantime, I'll try and make the example work with my own XML Country/State data.

Thanks.