AJAX :: Parameters In WebMethod Of Cascading DropDownExtender?

Aug 2, 2010

Using cascading dropdown extender we have to define web method. In that web method does the parameters that we declare should match names like "knownCategoryValues","category" etc ? Suppose if we write "knownCategoryValues1" insteed of "knownCategoryValues" then why my webmethod is not called ?

And if i give "knownCategoryValues" then it is called ?For the First time i have seen parameters name matters in Method parameters list. But why in this case different naming causes problem ?

View 1 Replies


Similar Messages:

AJAX :: Pass Some More Parameters In WebMethod While Using Cascading DropDown Extender?

Jul 28, 2010

I am using AJAX Cascading dropdown extender,and i have made a running dummy example.Using web service second dropdown is filled based on the selection of first drop down. But actual query that should fill second drop down have some more constraints in 'where' clause of the sql query, and that's value is too dynamic that (i cannot assume its value to be static). So i need that that variable's value in my web method too.

View 2 Replies

Getting JSON As Parameters In Webmethod From JQuery AJAX

Mar 13, 2012

I'm doing an jQuery AJAX POST call to a webmethod, which is working fine. If I'm passing data from the AJAX call, I normally get the data in the webmethod via webmethod parameters.

JavaScript Code:
$.ajax({"dataType": "json","contentType": "application/json","type": "POST","url": "Default.aspx/GetStuff","data": JSON.stringify({"a":"data1","b":2}),"success": function (msg) {    console.log(msg.d);}});
C# Code:
[WebMethod]public static object GetStuff(string a, int b){ }

Is there any way I can get the data as a Dictionary or some other object, instead of having to put in individual parameters to the GetStuff() web method for each data param? It's a POST request so nothing is in Request.QueryString, and Request.Params/Request.Form doesn't contain it either.

View 2 Replies

AJAX :: How To Use Context Key To Pass Additional Parameters With Cascading DropDownList

May 7, 2015

I have 3 Dropdownlist 

1-DDlcity   2-DDlRegion    3-DDlDistrict

and below is House_info table

district region city Id can
1 Canada
1 Lon
1 London
2 Ita
2 Canada
3

Now when I select city from DDlcity after that select region from DDlregion according to my selected item from DDlcity and DDlregion it bind DDlDistrict... before I used OnselectedIndexChange below is SP...

ALTER procedure [dbo].[SelectِDistrict]
@Region NVARCHAR(30),
@city NVARCHAR(40)

[Code] ....

It worked correctly but now I use cascadingdropdown list 

[WebMethod]
public CascadingDropDownNameValue[] GetDistrict(string knownCategoryValues)
{
string region = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues)["Region"];
string query = string.Format("SELECT District FROM District WHERE Region = N'{0}'", region);

[Code] ....

problem is that when I select city=canada  then region=1 I want it bind in DDldistrict =can  but here it show in DDLdistrict can and Lon

here it just select district that region=1 it doesn't attention to city selected Item I want it do  like SP that I used...

View 1 Replies

How To Get The Individual Parameters From The List Of Dynamic Parameters In A Webmethod

May 12, 2010

I am using jquery ajax method on my aspx page,which will invoke the webmethod in the code behind.Currently the webmethod takes a couple of parameters like firstname,lastname,address etc which I am passing from jquery ajax method using

data:JSON.stringify({fname:firstname,lname:lastname,city:city})

now my requirement has been changed such that,the number and type of parameters that are going to be passed is not fixed for ex.parameter combination can be something like fname,city or fname,city or city,lname or fname,lname,city or something else.So the webmethod should be such that it should accept any number parameters.I thought of using arrays to do so, as described here.

But I do not understand how can I identify which and how many parameters have been passedto the webmethod to insert/update the data to the DB.

View 4 Replies

AJAX :: ASPX WebMethod Not Running The WebService Webmethod Returning The Page?

May 19, 2010

I have a service that works great on my development box. It uses JQuery to hit my web service, and then the JSON results are sent back.

The web service is located on our basePage.cs. We didn't want to put out an external WebService for this. Our on beta box something different is happening.

The web page seems to be trying to call the web method correctly - the JSON data is being sent... but the server doesn't seem to know it's a webmethod. here's my service function (it's in our basepage.cs which inherits from Page).

[Code]....

View 2 Replies

Pass Optional Parameters Into A WebMethod Via JSON?

Feb 15, 2010

I have the following JSON class I am intending to use to perform management calls on my database asynchronously:

<script type="text/javascript">
var CalendarManager = {
defaultOptions: {
staffcode: 0, // required
date: 0, // required

[Code]....

Basically, my question is: how do I specify optional parameters to a WebMethod when providing JSON data?

I know I can reduce the parameters down to just the required values, and then use HttpContext.Request.Params to read the values of optional paramaters, but I would have thought the way I have tried here should have worked.

EDIT

The XMLHttpRequest.responseText value for the error is:

Invalid JSON primitive: staffcode.

This is throwing me even more off the scent of the problem :(

View 2 Replies

AJAX :: UI With DropArrowImageUrl Of AjaxToolkit:DropDownExtender

Jan 22, 2011

This is what I see when I click on arrow which is an image in DropArrowImageUrl - UI is weird. Changing image does not help. I am sure that it should be a common problem. Code is very simple:

<asp:Image ID="_targetImage" runat="server" ImageUrl="../Images/Actions.png" />
<ajaxToolkit:DropDownExtender ID="_dropDownExtender" runat="server" DynamicServicePath=""
Enabled="True" DropDownControlID="_panelItems" DropArrowImageUrl="../Images/DropArrow.png"
TargetControlID="_targetImage">
</ajaxToolkit:DropDownExtender>

View 2 Replies

AJAX :: Make All DropDownExtender Visible?

Aug 31, 2010

I use DropDownExtenders everywhere in my project, but it bothers me that it's not visible all the time. It looks like an usual TextBox :-(

<script
type="text/javascript">

View 3 Replies

AJAX :: Dropdownextender Hidden By Other Control?

Jan 28, 2010

I have a label with a dropdownextender, and below it I have a gridview. When it drops down, it should go on top the gridview , but instead half of it is hidden because it goes behind the gridview. how can that be taken care of?

View 5 Replies

AJAX :: DropDownExtender - Menu Disappears?

Aug 20, 2010

So I got 2 updatepanels on my page. In one there is a Timer which updates for example a label. In the other one there is a dropdownextender. Everytime the timer ticks while the dropdown menu is displayed the menu disapears. I attached the sample code below....any insights on this? And yes, the dropdown and the label need to be in two seperate updatepanels....

[Code]....

View 3 Replies

AJAX :: DropDownExtender - Show Options When Mouse Is Over?

Oct 7, 2010

Currently, when you click mouse on a control, you see all options. However, I need to be able to see all options when mouse is just over the control.

View 9 Replies

AJAX :: DropDownExtender Drop Down Hidden Event?

Jan 27, 2011

I would like to Post back an update panel after the drop down is hidden.

I found some javascript that will keep the panel open wile the user interacts with the CheckBoxList i have inside. Currently I am updating the panel when the function stops blocking the closing event. This is not firing every time. So i am wondering if there is a java script event i can catch to fire the post back after the drop down is hidden and if someone can provide a simple example of doing so. The code inside the event i got covered, binding to the event is ware i am lacking.

View 1 Replies

AJAX :: Change The Style Of TargetControlID Of DropDownExtender?

May 27, 2010

<br/>
<br/>
in my aspx page i have this code:
<br/>
<br/>
<asp:DropDownExtender DropArrowBackColor="White"

View 1 Replies

AJAX :: Perform Actions When Clicking On The Dropdownextender?

Jan 5, 2010

I need to perform actions (e.g. hide panels) when clicking on the dropdownextender arrow - before the dropdown panel is being displayed.

How should I perform this? should I use onclientpopulated?

View 5 Replies

AJAX :: Setting DropArrowWidth For AjaxToolkit:DropDownExtender?

Oct 7, 2010

I am using the following code:

<ajaxToolkit:DropDownExtender ID="TextBox1_DropDownExtender" runat="server" DynamicServicePath=""
Enabled="True" DropDownControlID="panelItems" DropArrowImageUrl="~/Images/DropArrow.png"
DropArrowWidth='26' TargetControlID="Image1">
</ajaxToolkit:DropDownExtender>

However, it does not set the width of DropArrowImage correctly.

I found the following post http://ajaxcontroltoolkit.codeplex.com/workitem/24194 but I am not sure of where to find DropDownBehavior.js to implement proposed solution.

Is it possble somehow to set the widht of DropArrow?

View 2 Replies

SQL Reporting :: Passing Two Different Parameters In One Cascading Parameter In SSRS 2005?

Aug 12, 2010

I have 3 parameters say A,B,C. I want that when I select values in A and B only then C comes alive. I am using cascading parameter in SSRS 2005.

I know that in cascading parameters, one parameters passes a value to other one and it comes alive. But I want that 2 parameters pass the value to a single one.

dont say to use multi select as multi select is used only when we have to multi select from one parameter.

Also one thing how can I use radio buttons in SSRS 2005 and how to hide null checkbox when allowing null values in calender control.

View 1 Replies

AJAX :: DropDownExtender's Position Is Incorrect When The Page Has A Scroll Bar?

Jun 13, 2010

the dropdownextender works fine until I scroll down the page, see the following screenshots.

View 2 Replies

How To Prevent Ajax Toolkit DropDownExtender From Closing On Click

May 25, 2010

I have the code below to implement a dropdownlist with checkboxes. My problem is that every time i click a checkbox the dropdownlist closes and i need to reopen it to select more checkboxes. How do i make it so the dropdownlist dosn't close until i click off of it?

[code]....

View 3 Replies

AJAX :: DropDownExtender With CheckBoxList, Close Drop Down On Mouse Out?

Jan 25, 2011

I am trying to keep the drop down open till mouse out.

I have found a hand full of sample scripts that are all trying to do this. I did manage to keep the drop down open while the user clicks on the check boxes.

[Code]....

I would like to instead of just removing the event handler also trigger the "close" event for the drop down list on mouse out. Not the JS expert so i dont know ware to start.

View 1 Replies

AJAX :: Multiple Column With Dropdownextender Error: Sys.InvalidOperationException

Oct 18, 2010

[Code]....

C# code:

[Code]....

View 2 Replies

AJAX :: DropDownExtender,Additional Information:The Controls Collection Cannot Be Modified?

Nov 8, 2010

i always get this error when ever i use DropdownExtender,Additional information:The Controls collection cannot be modified because the control contains code blocks
i.e. <% ... %>).this is my ASPX Code

[Code]...

View 5 Replies

AJAX :: DropDownExtender Inside List View Throws A JavaScript Exception

Apr 23, 2010

The following code listed on the bottom is a dropdown extender contained with a listview insert template. The code works fine however int VS 2008 Debug mode, its throwing the exception:Microsoft JScript runtime error: Sys.InvalidOperationException: Handler was not added through the Sys.UI.DomEvent.addHandler method.If I click ignore or continue, the taret label is properly populated with the appropriate value. Has anybody encountered this and is

<td>
<asp:Label ID="lblTest" style="height:25px;border: solid 1px black" runat="server" Text='<%#Bind("TestCode") %>' Width="90%"></asp:Label>
<asp:DropDownExtender ID="ddExtTestCode" runat="server" TargetControlID="lblTest" DropDownControlID="pnlTestCode"></asp:DropDownExtender>
<asp:Panel ID="pnlTestCode" runat="server" style="display : none; visibility: hidden;">
<asp:LinkButton runat="server" ID="Option1" Text="12345-New York" CommandArgument="12345" OnClick="OnTestCodeSelect"></asp:LinkButton>
<asp:LinkButton runat="server" ID="Option2" Text="45678-New Jersey" CommandArgument="45678" OnClick="OnTestCodeSelect"></asp:LinkButton>
</asp:Panel>
</td>

View 1 Replies

WCF / ASMX :: [WebMethod] Alternative / Use AJAX, Primarily With JQuery .ajax Function?

Feb 22, 2011

HWhen I want to use AJAX, primarily with JQuery .ajax function, I use functions within the .aspx.cs of the same page with [WebMethod].

I dont like this method very much because everyone can tell which function I use, and with no problem they can use it too.

My guess is that theres a better way to do this, Am I right?

View 3 Replies

AJAX :: Ajax Cascading Dropdown Control Not Working On IIS After Deploying?

Jan 12, 2011

I am new to Ajax Control Toolkit, with the help of online tutorials I had created a cascading dropdown list in asp.net and tested it on my local machine. For this dropdown list data source would be an xml file (which is saved on my local machine c drive). I haven't encountered any issues until I deploy the precompiled web site on to IIS 7. When I open the web site from IIS I would see the two dropdown boxes on the web page with an error "Method error 500". I believe this error occured due to incorrect xml file
path provided on IIS. I had copied xml and xsd files into IIS server C drive but it did not help out and then I created a network map and placed the xml and xsd files in that shared folder tried to access that path from web service, it's working on local machine but not on IIS. It would be great, if any one could explain me the solution.

Following is the .aspx and .asmx code:

.aspx code:

<form id="form1" runat="server"> <div> <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </asp:ToolkitScriptManager> <br /> <table> <tr> <td> <asp:DropDownList ID="DropDownList1" runat="server"
Height="20px" Width="257px"> </asp:DropDownList> <asp:CascadingDropDown ID="CascadingDropDown1" runat="server" Category="Category" TargetControlID="DropDownList1" PromptText="[select category]" ServicePath="~/WebService.asmx" ServiceMethod="GetCategory"> </asp:CascadingDropDown>
<br /> </td> </tr> <tr> <td> <asp:DropDownList ID="DropDownList2" runat="server" Height="20px" Width="257px"> </asp:DropDownList> <asp:CascadingDropDown ID="CascadingDropDown2" runat="server" Category="Type" TargetControlID="DropDownList2" PromptText="Select
Type]" LoadingText="Loading Type.." ParentControlID="DropDownList1" ServicePath="~/WebService.asmx" ServiceMethod="GetType"> </asp:CascadingDropDown> <br /> </td> </tr> </table> </div> </form>

.asmx code(.cs code):

[WebMethod]
public AjaxControlToolkit.CascadingDropDownNameValue[] GetCategory(string knownCategoryValues, string category)
{
XmlDocument _doc = new XmlDocument();
_doc.Load(HttpContext.Current.Server.MapPath("~/C:/ItSupportCategory.xml"));
XmlNodeList list = _doc.SelectNodes("/CategoryList/Category");
List<CascadingDropDownNameValue> categorylist = new List<CascadingDropDownNameValue>();
foreach (XmlNode node in list)
{
string catid = node.Attributes["value"].Value.ToString();
string catname = node.Attributes["name"].Value.ToString();
categorylist.Add( new CascadingDropDownNameValue(catname,catid));
}
return categorylist.ToArray();
}
[WebMethod]
public AjaxControlToolkit.CascadingDropDownNameValue[] GetType(string knownCategoryValues, string category)
{
int catID;
StringDictionary selectedvalue = AjaxControlToolkit.CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);
catID = Convert.ToInt32(selectedvalue["category"]);
List<AjaxControlToolkit.CascadingDropDownNameValue> cascadingValues = new List<AjaxControlToolkit.CascadingDropDownNameValue>();
XmlDocument _doc = new XmlDocument();
_doc.Load(HttpContext.Current.Server.MapPath("~/C:/ItSupportCategory.xml"));
XmlElement root = (XmlElement)_doc.SelectSingleNode("/CategoryList/Category[@value='" + catID + "']");
for (int i = 0; i < root.ChildNodes.Count; i++)
{
string typeid = root.ChildNodes[i].Attributes["value"].Value.ToString();
string typename = root.ChildNodes[i].Attributes["name"].Value.ToString();
cascadingValues.Add(new CascadingDropDownNameValue(typename, typeid));
}
return cascadingValues.ToArray();
}
Xml File:
<?xml version="1.0"?>
<CategoryList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="test.xsd">
<Category value ="1" name="SYSTEM WIDE">
<Type value ="1" name="Email"/>
<Type value="2" name="SAP Locked"/>
<Type value="3" name="Job Archive Full" />
</Category>
<Category value="2" name="SAP">
<Type value="3" name="Pricing Incorrect"/>
<Type value="5" name="New Item #"/>
<Type value="6" name="Reports"/>
<Type value="7" name="New User Setup"/>
</Category>
<Category value="3" name="OTHER">
<Type value="8" name="Production"/>
<Type value="9" name="Office"/>
<Type value="10" name="Toner for Printer"/>
<Type value="11" name="Security Camre Lookup"/>
</Category>
</CategoryList>

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved