Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Wednesday, March 28, 2012

Difficulty in calling web service

Hi all,

The web service which am trying to call takes two string and three array as parameters.am able to call the web service through ajaxpro.dll, but through ajax framework1.0 its not coming. the service returns response class object..pls help me out.

In .aspx page

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

<asp:ScriptManagerID="ScriptManager1"runat="server">

<Services>

<asp:ServiceReferencePath="http://localhost/progressTrack21/ManageProgressTracking.asmx"/>

</Services>

<Scripts>

<asp:ScriptReferencePath="trackingScript.js"/>

</Scripts>

</asp:ScriptManager>

<inputid="Button1"type="button"value="Click here"onclick="funProgress();return false;"/>

In trackingscript.js file

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

function funProgress()

{

debugger;

Sys.Net.WebServiceProxy.invoke("http://localhost/progressTrack21/ManageProgressTracking.asmx","Update",false,{"UserId1":"1","PlanId1":"1","SCOId1":scoid,"ElementName1":EleName,"Value1":EleName},SucceededCallback);

}

function SucceededCallback(result, eventArgs)

{

var RsltElem = document.getElementById("Results1");

alert(result);

}

Are you getting any javascript error ??, because in your function you are directly accessing the results elements

function SucceededCallback(result, eventArgs)

{

var RsltElem = document.getElementById('<%=Results1.ClientID%>');

alert(result);

}


Hi, You do not have to call the WebServiceProxy.invoke. Instead the Ajax Framework generates a JavaScript Proxy class which represents the Server Side Web Service.

For Example if Your WebService Name is DataService and if it contains a method FetchData(), then the JavaScript class will also contain a DataService class with the FetchData Method. You can find the more info from the following links:

http://ajax.asp.net/docs/tutorials/ConsumingWebServicesWithAJAXTutorial.aspx
http://ajax.asp.net/docs/tutorials/ExposingWebServicesToAJAXTutorial.aspx


It is giving internal server error(500)....I tried in all possible ways...


Thank u Kazi,,,,

Monday, March 26, 2012

Desktop-like Grid

There's some nice web applications like http://docs.google.com where we have some desktop-like grid. By desktop-like grid I mean one where the user could navigate using the arrows, page up/down, edit values simple by typing in the corrent cell and so on.

I'm looking for some sample of that using Ajax but I found only samples of commercial components (wich more resources than I need).

Any advice?

I wrote an application (component) like this for a client of mine. I used a GridView with lots of Javascript and AJAX Web Service calls. I'm not sure that there is a "boxed" component out there that would provide all the functionality that I needed (e.g. comments, field history, etc). It wasn't a small effort, but it is do-able...

-Damien


Check this grid

http://www.divelements.com/net/controls/sandgrid/


The team of the Toolkit is working in a GridView check this: http://forums.asp.net/t/1127281.aspx Don't really know the status of the project, you could check CodePlex.

Saturday, March 24, 2012

Deployment Question- iframe executor failed ?

Just moved to a new server and Debug output is giving me.. "A web request made using the iframe executor failed. Make sure that the app's web.config registers iframecall.axd"

Of course this doesn't happen in dev/test. The server file from the root up are exactly the same (after I switched it to debug).. Is there something else to configure?

It appears that all atlas/ajax calls back to the server are failing in the new environment. There are basic service calls registered in the script manager and some toolkit controls as well.

Where to start?

Other important things I neglected to mention.. I have already added the iframecall in the http handler & theWebOperationAttribute(true,ResponseFormatMode.Json,true) setting to each of the web methods declorations.


Other important things I neglected to mention.. I have already added the iframecall in the http handler & theWebOperationAttribute(true,ResponseFormatMode.Json,true) setting to each of the web methods declorations.


I use fiddler to make sure the script manager was registering the services and everything looks good. If I point the services back at the dev server they work great?

Fiddler namespace registrations.

HTTP/1.1 200 OK
Date: Mon, 21 Aug 2006 12:32:33 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Length: 582

Type.registerNamespace('NU.Web.ECatalog.Services');
NU.Web.ECatalog.Services.PassortUsers=new function() {
this.appPath = "http://nunettst3:8040/apps/ecatalog/";
var cm=Sys.Net.ServiceMethod.createProxyMethod;
cm(this,"SearchInvoiceApproversByName","prefixText","returnCount");
cm(this,"SearchMaterialRequestApproversByName","prefixText","returnCount");
cm(this,"SearchByName","prefixText","returnCount");
cm(this,"SearchByNameNoLimit","prefixText");
cm(this,"GetInvoiceApproverId","name");
cm(this,"GetMaterialRequestApproverId","name");
cm(this,"GetUserId","name");
}

Deployment of AJAX-enabled web page on production server trouble

VS 2005 sp2, vb.net, sql 2005 enterprise sp2, IE7 & IE6, AJAX 1.0 toolkit and extensions.

The specific problem I am having is that I can't get the tabcontrol/tabpanels ("tab controls") to show up properly on the production server. I have a tabcontrol with 3 tabpanels. Inside each panel, I have a gridview and/or detailsview. When I load the page, I see the center gridlines (without the outer borders) of the gridview and detailsview and no tabs and no data. I also notice the "Done. Page loaded with errors" message on the bottom left status bar.

As with most of you, I have a dev machine and a production server. The tab controls show up just fine on the dev machine but when I move it to the production server, the same tab controls do not completely show up. The following is the watered-down version of what I am using:

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<cc1:TabContainer ID="Tabs" runat="server">
<cc1:TabPanel runat="server" ID="tab1" HeaderText="Tab1">
<ContentTemplate>
<asp:GridView ID="GridView1" runat="server" meta:resourcekey="GridView1" AutoGenerateColumns="False">
<Columns>
<asp:BoundField DataField="Column1" HeaderText="Column1" meta:resourcekey="BoundFieldResource1"></asp:BoundField>
<asp:BoundField DataField="Column2" HeaderText="Column2" meta:resourcekey="BoundFieldResource2"></asp:BoundField>
</Columns>
</asp:GridView>
</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel runat="server" ID="tab2" HeaderText="Tab2">
<ContentTemplate>
...
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>

I have installed the extensions on the production server (to fix another problem) and I have also confirmed that the dll's are in the bin folder. Any assistance as to why the tab controls not showing up is appreciated.

Thanks in advance to all. I am able to provide further information upon request.

anyone?

Just in case this may help someone else,

I found out the root of my problem was that I was using an AJAX enabled web-site instead of using the AJAX control toolkit template when I first made my website. I have mixed and matched some lines from my orginial "AJAX enabled" web-site and my new "toolkit template" web-site and found that the difference is only a few lines in the web.config file.

However, being exhausted in the search for an answer and not wanting to debug any further..., I decided to just move over all of my pages and worked it up in the "toolkit template" style.


I am having some of the same problems with my website and using the Tab Control. However, my website is pre-AJAX so I incorporated the new web.config and converted the existing web to use AJAX. Everything works fine on my development machine, but not when I deploy to the production server (which is running IIS 5.1). Do you think I should create a new website by using the new "toolkit template" and then copy pages to it?

I think installing the lastest versions of the toolkit and using the AJAX template is a good idea, perhaps not the only idea but the only one I have run across so far. Try to stay away from the AJAX enabled website since that was what I was using. I had also tried installing the AJAX toolkit extensions on the production server, which helped fix another problem I had with accordionpanes. This may have been related or not but since the toolkit is very new, it looks like there are still a lot of kinks they need to go over and for us to go around for now. But I would do the upgrade first before going and installing things on the production server.

If you can/have figure(d) out the difference in the web.config file, that should be enough but if it would give you peace of mind, upgrading it might not be a bad idea as it seems to have fixed additional minor bugs that I have run across.

When upgrading, the major difference I noticed was that I had to delete the two <cc1> references on each page (first the reference at the top of each page and the second in the page itself) and replaced it with <ajaxtoolkit> only inside the page. The reference was not needed at the top of each page for <ajaxtoolkit>, maybe something to do with the new web.config.

deployment

hi

is it possible to deploy a asp.net ajax web site on a server that does not support asp.net ajax ?

thanks

shaul

you must upload the DLL files in default directory C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025

but the host must be full turst.

Deploying Web Application that uses ASP.NET AJAX

Hi,

I have created a Web Deployment Project and Web Setup Project for my companies web application. The web application uses the ASP.NET AJAX Extensions. I have failed to find much information regarding the deployment of this framework.

My preference would be to have the files necessary for the correct workings of the web application in the local bin directory. Is this possible? If so, could someone outline the steps necessary to get this working (which files into where).

My second option would be to ensure the server has the ASP.NET AJAX Extensions installed during install time of the Web Setup Project. How can I make this a prerequisite for the web application?


Thanking you,

-Brad

Hey,

ASP.NET AJAX needs to be installed on the web server; you cannot deploy it locally, that is not how they set it up. For the later question, I'm not the best at setup projects, but can't you require that a specific file exists on the installed machine? If you can, which I believe you can, you can target the extensions because it installs DLL's in a specific folder.


Hi Brad,

The Setup Project allows you to define Launch Condition?which?occurs?before?the?setup?starts or Custom Action which can perform actions during a specific step. Please refer to the following articles:
Launch Condition Management in Deployment ?http://msdn2.microsoft.com/en-us/library/ay12wede(VS.80).aspx
Walkthrough: Creating a Custom Action ???????????http://msdn2.microsoft.com/en-us/library/d9k65z2d(VS.80).aspx

Hope this helps.

deploying my ajax app

hey all,

i have a brand new windows 2003 server that i'm trying to deploy my ajax app to and i'm getting an error with the web.config. is there anything special i need to do to the server for my app to work?

thanks,

rodchar

hello.

well, you just need to install the asp.net ajax toolkit and configure your web app so that it uses asp.net 2.0.


Thank you.


hello again.

~sorry...in the previous post i meant the asp.net ajax extensions and not the asp.net ajax toolkit :) btw, both are available on the download section of the ajax.asp.net site.

Deploying Atlas Web Site

Is it as simple as running the Atlas install? Is there a way to identify the files and include the files within our existing framework? Have Googled this and found very little in regards to deploying to a production server a Atlas enabled web site.

Thanks

PinkFloyd43 - From The Dark Side Of The Moon

Deploying an Ajax (formerly known as Atlas) website is as easy as sleeping in your bed.

The only file that you need from Ajax is the AjaxControlToolkit.dll, which you put it in your bin folder if you use it. All the other files are in the GAC of the server.

The server has to have Ajax installed. Hope that helps.


Hi. I have a similar question. I understand the need to install Ajax on the GAC and this simply means running the installer package form the Ajax site or Code plex on a production environment.

Here are some questions I have.

1. Is there any way that Ajax would NOT work if everything is installed using a Xcopy in my bin folder of the Ajax enabled web site?

2. What about security and trust levels? What is the impact of this from a deployment standpoint?

3. I assume I would not be able to install Ajax on the GAC if I have a hosted server where I host my application? What are the recommendations in this kind of a scenario?

Thanks in advance,
Sriram


I have the same doubt. Please help me out

Deploying Atlas to non-dev servers

Question : What has to be done to sucessfully publish an atlas application to a web server running IIS 6 & .Net 2.0 ?

The reason I ask is that the the following error occurs when I attempted this:Could not load file or assembly 'vjslib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies

I see that the 'jslib' & 'jscor' assemblies have been referenced by the Atlas project, but ehy're in the GAC of the dev machine.. Does this mean I have to copy them into the bin of the site on the destination server? GAC ing them on a host site isn't an option.

I don't understand why this reference would be needed. What are you refering to when you say 'I see that the 'jslib' & 'jscor' assemblies have been referenced by the Atlas project'? Where are you seeing this references?

thanks,
David


BTW, in case that was not clear, those assemblies are part of the Visual J# runtime, so unless your app is explicitely trying to use this language, and wouldn't think they would ever be needed.

Have a similar question, along the same lines -

When I try to run an Atlas Application by copying the entire directory into inetpub\wwwroot, I get the following error :

Could not load file or assembly 'Microsoft.Web.Atlas' or one of its dependencies. The system cannot find the file specified.

I have the Microsoft.Web.Atlas defined in the GAC (which is another issue - as I cannot do this on Production Servers)

I assume another dependant DLL is not loaded ? I also get the following warning :

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

I dont see the Fusion!EnableLog in the resistry entry - how do I get to the bottom of this ?

Any help is truly appreciated -

Thanks in advance,

Anand -


You need to make sure that the directory of your Atlas app is marked as an IIS application. Otherwise, it's just a directory under wwwroot, and its bin directory will be ignored (hence the error).

David


My mistake. The j# dlls were required by the service provider we just started using (Web Methods) not atlas.

Thanks for the replies

Deploying ASPAJAXCTP.msi in Client Place

hi,we have developed our web page with AJAX and now we are in a stage to deploy our portal to the client. since we have used the ASPAJAXCTP.msi, we need to install in the clients place. is there any method to check whether AJAX tool kit has been installed already if not then install. like this can we check?hope some one can help me on this.thanks in advance

sbadriprasad:

we need to install in the clients place.

Well you do not need to install the MSI if you manually reference the ajax assemblies rather than using the GAC copy.

sbadriprasad:

is there any method to check whether AJAX tool kit has been installed already if not then install. like this can we check?

You can check the computer's add/remove programs for the AJAX extensions called MS ASP.NET 2.0 Ajax Extensions 1.0

Deploying ASP.NET AJAX-Enabled Web site to host without AJAX installed

Is there a sure-fire way to deploy an ASP.NET AJAX-Enabled web site to a web host who refuses to install AJAX 1.0?

How come just copying the System.Web.Extension .DLLs to the application's BIN diectory would work. I also copied the v1.0.61025\MicrosoftAjaxLibrary\System.Web.Extensions\1.0.61025.0 Javacript files into BIN as well and maybe that is the problem. If anyone has found a way to publish to a server without AJAX, please let me know what needs to be done.

Thank You!!!

Well its almost impossible since you are still missing some files from:

eg: "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727"


Though it is recommended to have ASP.NET AJAX 1.0 library in the GAC, you can keep it in the \bin folder if your application is running on Full Trust.

Thanks


My next question then, is, what files need to be in the BIN folder in order for it to work?

Deploying AJAX Extension in to the BIN folder

I noticed thatAjaxControlToolkit.dll installed in the BIN folder of the website. I wonderedsystem.web.extensions.dllcan be in installed in BIN folder as well. Specifically in some cases like Share Hosting it is not possible to access GAC (Hosting company may not support it) and it would be great to be able to install it in BIN folder.


Is there any performance or security difference between AjaxControlToolkit.dlland system.web.extensions.dll? whyAjaxControlToolkit.dllcan sit in the BIN folder not the system.web.extensions.dll?

Thanks in advance.

The ASP.NET AJAX Docs state:

note

The installation process installs the ASP.NET AJAX assembly (System.Web.Extensions.dll) in the global assembly cache (GAC). Do not include the assembly in the Bin folder of your AJAX-enabled Web site.

Reference:http://www.asp.net/ajax/documentation/live/InstallingASPNETAJAX.aspx

With that stated I am not entirely sure why this note is there. Maybe someone with more inside knowledge than myself can explain further. I can say one of the webhost I use wants to chare me to install ASP.NET AJAX and I deployed the needed DLLs in my web bin and have not ran into issue to date.


I had the same impression about the DLL and I guess technically it should be possible to install it in the BIN folder. I will appreciate if some one from Microsoft or some one with deep knowladge in this area leave here a comment that why we should not put AJAX DLLs in the Bin folder.

Deploy to a web server

As most hosts, my web host will not install any beta products on their server, which means that I'm stuck with the "Atlas" july CTP (which works just fine in the Bin folder). The fact that you need to install ASP.NET AJAX on the server makes it useless for most people. It's great, but I can't use it because it isn't installed on the server. PLEASE! Make a version that works when copied into the /Bin birectory!

Asbj?rn

hello.

well, according to several guys, it works ok if you drop the dll on the bin and set the app to full trust. i guess that most hosts will only install it when v1.0 is released.


And how would I set the app to full trust if I don't have access to the server?
And how would I set the app to full trust if I don't have access to the server?
hello.
well, you just need to ask them the level that your app runs. it mya be running at full trust, though i doubt it.

Deploy Ajax enabled site with out install any aditional file on web server

Hi All,

I need to deploy my Ajax Enabled web? project ( i used Asp.net 2.0 with vb.net and SQL Server as database ) without install any additional file or framework on Prodcution server (web server) due to some restriction....
Please guide me

note : Framework 2.0 and IIS are already install on my web server and some other web project runs successfully...

thanks

SajjadQuite simply, it's not easily done. If you want to use just the client-side library, that's possible, but I you'll still run into a bunch of errors unless you specifically build your project for it. Taking an existing ajax enabled project and converting it will require a lot of chnages on your part, depending on how big it is.
can u give step by step deployment information...

http://ajax.asp.net/about/default.aspx?tabid=47

Select Microsoft AJAX library.


thanx for reply dear
but on this page it ask to download the framework.......
i already download this framework and install......
i need asp.net Aajax deployment procedure with out install any additional file on my web server ( Production Server )

I think u understand my point...
any way, thanks for your support :)

I can't help you if you're not going to read the documents, or my posts. Let me try again:

There is no way to install the framework without installing the framework.

What you can do is deploy the client script library to your application, and that's the link I told you to follow.

There will be differences in how it interacts with your application,however, since none of the server controls will be available (updatepanels, etc).

Your only other alternative is to find a host that has production servers w/ th eframework installed, or pay for a virtual dedicated server and install it yourself.


You can try to place these (see below) dlls from C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025

AJAXExtensionsToolbox.dll
System.Web.Extensions.dll
System.Web.Extensions.Design.dll

But please be sure that your application running in the full trust in this case.


You need to place them to your application bin folder
AFAIK, that only works if his web application is permitted full trust by the host.

IS THERE *NO* CONCISE GUIDE TO DEPLOYING ASP.NET 3.5-enabled applications in a SHARED HOSTING ENVIRONMENT?

I work with several different share hosting providers and some claim to have given me "trust" (others don't seem to know how to spell ASP.NET 3.5 yet!) and I've STILL not gotten the most baby-simple "proof of install" application involving VWD 2008 EE / ASP.NET 3.5/AJAX app to actually run anyplace except on my local development system.

There are a LOT of nice features out there in VWD 2008 EE / ASP.NET 3.5/AJAX -- but if the only place they will run is where you have complete control over the "production" server (with attendent capabilities of installing what you need there) this isn't going to go very far in a shared hosting world.

CAN ANYONE point me to a clear, concise guide? (Perhaps including how I convey the necessary requirements to the hosting companies as well?)

mahalo/thanks, in advance ... KevInKauai

Wednesday, March 21, 2012

Delete confirmation in GridView and Ajax

Hi, I'm performing an upgrade from a traditional asp.net 2.0 web site to asp.net ajax.

I could perform all the necessary upgrades in my application to work with ajax, but one: how can I ask the user (using a ok/cancel dialog) if he/she wants to delete some gridview row? (assuming I use a traditional "delete command column" in the grid)

1. I tried to set this up using triggers... but could not find a way to halt execution with a custom script an resume execution if users says "ok"

2. I tried to build a custom extender... but all I could do is "intercept clicks" on the gridview, not "when it happens in a delete command" (everywhere I click on the grid fires the popup)

if someone could point any resource I can look at or any clue...

thanks a lot,

Victor

here is the code

Protected Sub gv_Project_RowDataBound(ByVal senderAs Object,ByVal eAs GridViewRowEventArgs)Handles gv_Project.RowDataBoundIf e.Row.RowType = DataControlRowType.DataRowThen Dim lAs LinkButton =CType(e.Row.Cells(5).Controls(0), LinkButton)' 5 is your column count of delete column l.Attributes.Add("onclick","javascript:return " & "confirm('Are you sure you want to delete this record " & DataBinder.Eval(e.Row.DataItem, "Project_Name").ToString() & "')")End If End Sub
 
 
cheers 

thanks a lot!!!

this is really a much simpler task as I was wondering...

thanks again,

regards

Victor


Hello,

Thanks for this tip.

I have a GridView with both Deleting and Editing enabled.

My Code sets the e.Row.Cells index to 0 so that refers to the Gridview Command column.
Dim lAs LinkButton =CType(e.Row.Cells(1).Controls(0), LinkButton)

In this case the Confirmation if triggered on a click of Edit and not Delete.

I would appreciate and suggestion how to attach the confirmation to the "Delete" Link in the GridView Command Column.

Thanks Lex


Hello, I have solved this issue by creating 2 command buttons, one for the Edit and One for the Delete.

This then allowed the reference to the Link Button to index the Delete Cell or Column.

Thanks Lex


Thanks, working perfectly

Delayed GridView Loading

I have a GridView that is loading data from a web service. For each item in the table a call must be made to the web service and they are averaging around a half second per call. So for a GridView with 83 rows it takes around 41 seconds to load the page the first time. After the page is initially loaded the data is cached so it doesn't take nearly as long. What I'm wondering is if there is a way that I could show the user the rest of the page and then load the GridView via Atlas once the rest of the page loads so that the user can at least see the page is loading and doing something? Icing on the cake would be to be able to display a loading gif while the GridView is loading.

Thanks,

Eric

Hello, I think using an UpdatePanel control will make things better.

A.

Define a PageMethod in a MasterPage

I have a web site that uses Master/Content pages and I have a PageMethod that I would like to make available to a any of the content pages. So I defined the method like I would in a Content Page:

using System;

using System.Data;

using System.Configuration;

using System.Collections;

using System.Text;

using System.Web;

using System.Web.Security;

using System.Web.Services;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

using System.Web.Configuration;

publicpartialclassMasterPage : System.Web.UI.MasterPage

{

[WebMethod]

publicstaticstring MyMethod()

{

//Some Code Here

}

}

And I already have my script manager setup on the master page as follows, which works for all my PageMethod calls from Content Pages:

<asp:ScriptManagerID="masterPageScriptManager"runat="server"EnablePageMethods="true"EnablePartialRendering="true">

</asp:ScriptManager>

However, when I try to call PageMethods.MyMethod(MyMethodCompleteHandler); I get our favorite error, "PageMethods is Undefined." Is it possible to define a PageMethod in a MasterPage like this. If so what am I missing?

Thanks

Patrick

To be able to invoke that MyMethod

you need first to cast the MasterPage property of a page to your class (MasterPage) and then invoke it.

So if it was in the code behind of a content page to be able to invoke it you should write sth like :

string result = ((MasterPage)this.MasterPage).MyMethod();



Yani, I think he's talking about fromt eh javascript side.

On an unrelated note, mnogo mi obicham Bulgaria! Moja jena e bulgarka i nia otidame tam v sofia za 2-3 cedmitsi prez ljatoto vseki godina.

Paul (my apologies for grammar and spelling)


Hi Paul,

you are right about the javascript.

However, my point was that defined on the master page this static method does not become a page (content page) method. The master page is not a base class for the content pages, moreover it is a static page.

For this case it would be more suitable to create a web service, that will be accessible from everywhere.

Cheers,

Yani

PS: Paul, it is very nice you have learn some Bulgarian :)) Congrats!Wink


To answer the original question, I looked at the response in Fiddler and it looks like the Master page pagemethod doesn't get generated. I'm not yet sure how to work around that, I'll give it some thought.

Patrick,

I believe you won't be able to accomplish what you're trying with PageMethods.

The EnablePageMethods will assume that the method is defined in a.aspx page. This is why it is called a "Page Method".

If you want the method be available to all pages, why not use a simple webservice?

Default value in child CascadingDropDown

I'm using the standard technique for setting the default option in the Web service: result.Add(newCascadingDropDownNameValue(name, code, BLOCKED EXPRESSION

(expression is true only for the default option)

This technique ony works for the parent list, and doesn't do anything for the child list. In other words, when the selection on the parent list changes, and the child list gets populated via its Web service, setting the default option via the above technique doesn't actually do anything (the first option of the child element is always selected by default). What am I doing wrong?

Hi Tomers,

My understanding of your case is that you want to set a default value for DropDownList ,which is associated with a CascadingDropDown.

As far as I know, the returned value will add to it's child list instead of parent list. Here is the code section in CascadingDropDownNameValue.cs.

public CascadingDropDownNameValue(string name, string value, bool defaultValue)
{
this.name = name;
this.value = value;
this.isDefaultValue = defaultValue;
}

I have made a sample and it works fine on my local machine. Please see my sample which is using oledb:

[WebMethod]public CascadingDropDownNameValue[] GetCities(string knownCategoryValues,string category) { StringDictionary kv = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);int stateID;if (!kv.ContainsKey("State") || !Int32.TryParse(kv["State"],out stateID)) {return null; } List myList =new List(); strSql ="SELECT * FROM tb_City WHERE StateID=" + stateID.ToString(); GetDr(strSql);while (myReader.Read()) {if (myReader["CityName"].ToString() =="Shanghai") { myList.Add(new CascadingDropDownNameValue(myReader["CityName"].ToString(), myReader["CityID"].ToString(),true)); }else { myList.Add(new CascadingDropDownNameValue(myReader["CityName"].ToString(), myReader["CityID"].ToString(),false)); } } myReader.Close();return myList.ToArray(); }

In your case, I think you should check your code and debug it step-by-step if necessary.

Best Regards,

Jonathan

Default button with updatepanel

Hello,

I have got a trouble with default button on a web page with a updatepanel component. When I use my code outside the updatepanel the default button is always ok and focus on my textbox already.

But if I put the same code inside a UpdatePanel each time I enter a value into my textbox and press enter I lost the focus and default button too!!! why?

I try to put defaultbutton and focus on the form, on the page load by form1.defaultbutton etc...by a findcontrol inside the updatepanel etc...

If someone can help me please...

Stephane

refer to following link

http://forums.asp.net/p/1007125/1337913.aspx

Declarative timer and web service

I am trying to use a declarative script to timer on tick -> web service on complete -> update label.

No problems with updating the label but is there anyway to invoke a service method without resorting to javascript (i.e. pure xml-script)? I imagine I can do something like tick="Sys.Net.ServiceMethod.invoke(..." but it kinda kills the purpose.

Any ideas?

Alex

hello.

i think you're after the servicemethodrequest class.

here's an example of it's declaration:

<serviceMethod id="myService" url="webservice.asmx" methodName="Test">
<completed>
<!--invoke your binding from here-->
</completed>
</serviceMethod>

btw, you can invoke the previous service by using the invokeMethod action (invoke is the name of the method exposed by servicemethod that let's you start the web service method execution).


Luis - yes I am after theServiceMethodRequest class except I would like to invoke the ws via a timer control (w/o resorting to using JS) on tick event:

<timer id="timer" interval="1000" enabled="true" tick="INVOKE WS"/
<serviceMethod id="svc..." url="service.asmx" methodName="GetSomething">
<completed> ...</completed>
</serviceMethod>

While I can write a JS function to invoke the method (and I have done this) I would like to create a version (more elegant) w/o any JS using declarative script. No point for me to use a combination of declarative script to do the binding and ws calls if I still have to write a JS function to call the ws on Tick, might as well do the bindings manually. Right now this is what I do but would be great if I can use the tick event to invoke a ws as well. Any ideas?

AO


hello.

how about something like this;

<timer ...>
<tick>
<invokeMethod target="svc..." method="invoke" />
</tick>
</timer>

if you need parameters, then add them as child element of the invokemethod element...


Thanks that was easy... wish there was an easy way to browse the Atlas library by class with Visual Studio. The documentation didn't make any mention of this (as far as I remember) and from briefly looking in the code I didn't find it.

Luis, thanks again!