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

Wednesday, March 28, 2012

How do i use Tabs in Ajax in asp.net application..

Hi, i have a asp.net web application which is production... and the client wants us to display the data using the userid... right now i am using a datagrid in a simple aspx page.. but since the user has asked for that request.. i want to have 5 (tabs each for a user Id) and then display the datagrid on it... how can i do this is an existing aspx page.

I have downloaded the ajax tool kit and i dont know from where to start... by data grid is simple... just displaying the data using.. a sql query and there are few links in the datagrids to navigates to other pages...

So can I use Ajax just for one page,,, and is there anything that i need to know that will hamper production when using Ajax..

any help ,ideas and code will be greatly appreciated

Regards

Karen

You can easily only use ajax on one page, and creating the tab thing should be quite simple. There is nothing that will tamper production, since ajax is essentially an extra dll that goes in the bin folder, and a couple of additions to web.config. If I was you I would just go ahead and get my feet wet. There are some excellent getting started tutorials on this site. Just click the Ajax menu at the top of the page.

Good luck!

/Klaus


Thank you Klaus i will look into it. can you pls give me some link to it..

Regards

Karen


Hi,

Thank you for your post!

It seems that you are really a newbie to AJAX and javascript,this is a good start point for your learning:ASP.NET AJAX Roadmap

And this is a good point to start with Toolkit:http://www.asp.net/ajax/ajaxcontroltoolkit/samples/

And in my opinion, <ASP.NET AJAX in action> is a decent book to learn ASP.NET AJAX.

If you have further questions ,let me know.

Best Regards,


Jin,

Thanks for the link... and yeah i am newbie to Ajax and javascript... i had worked on tabs when i was working on VB.6 and then it was so easy then and that was 3 yrs ago.

regards,

Karen

How do I use AJAX controls when my site was not created with AJAX enabled?

My site is not originally created with AJAX Conotrol Toolkit Web Site. How do I use the TabContainer and TabPanel?

Step 1 - Add the following references to your project...

.NET: System.Web.Extensions

.NET: System.Web.Extensions.Design

PROJECT / BROWSE: AjaxControlToolkit

Step 2 - Modify your web.config (add in the bits you don't have)

<configSections><sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"><sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"><section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/><sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"><section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/><section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/><section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/></sectionGroup></sectionGroup></sectionGroup></configSections><system.web><pages><controls><add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/></controls></pages><compilation debug="true"><assemblies><add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/><add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/><add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/><add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/><add assembly="System.Management, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies></compilation><httpHandlers><remove verb="*" path="*.asmx"/><add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/><add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/><add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/></httpHandlers><httpModules><add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/></httpModules><system.webServer><validation validateIntegratedModeConfiguration="false"/><modules><add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/></modules><handlers><remove name="WebServiceHandlerFactory-Integrated"/><add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/><add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/><add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/></handlers></system.webServer>

Step 3 - Top of your aspx page

<%

@.RegisterAssembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"Namespace="System.Web.UI"TagPrefix="asp" %>
<%@.RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="ajaxToolkit" %>

I think that's about it!


Thanks! I'll give that a try. By the way, does the IIS server needs to have some kind of update for all my AJAX enabled pages to work?

As long as you've installed the ASP.NET AJAX (downloadable from this site ajax.asp.net) then you'll be fine - it has to be installed on the machine you're using as the web server as it places itself in the GAC.

How do I know the load?

I have my web pages that are using web services via atlas technology. when page loads users can click on the links but get error because page has not been loaded yet. How do I know that page loaded on atlas? How do I know that procies are created? can someone provide me some working javascript or what ever is possible to detect it?

thanks and greately appreaciated

Hi,

just hook up the load event raised by the global Sys.Application instance. Here's the code to add to your page:

<script type="text/javascript">
<!--
function onLoad() {
// Put your Atlas stuff here.
}
//-->
</script>
<script type="text/xml-script">
<page>
<components>
<application load="onLoad" />
</components>
</page>
</script>

The above code will call the onLoad function (it's a javascript function that you have to define) when all the framework stuff is initialized.

Monday, March 26, 2012

How do I install the toolkit controls?

Incredibly novice question I know. I'm using Visual Web Developer 2005 Express Edition, have download the ZIP containing all toolkit controls and samples, but how do I add the controls?

Thanks in advance

Mark

what you want to do is right-click on the control toolbox and goto choose items, then goto browse and navigate to where ever you unzipped the ajax control toolkit .dll file. Selecting this should add the controls to your toolbox list and select them all, so then click apply and you should be good

check this out if you need further help

http://ajax.asp.net/ajaxtoolkit/Walkthrough/Setup.aspx


Thanks pal!

How do I deploy an AJAX Toolkit web app?

This seems like a pretty common thing to want to do, yet I can't find anything (clear) in the documentation or various forums. Simply put, how do I deploy an AJAX enabled ASP.NET 2.0 application?

I can get the files on the server no problem, but what do I need to install on the server to get the AJAX 1.0 code to work? I assume I just need to install AJAX 1.0 on the server, and everything should be fine, right? If so, then why isn't my AJAX code working. If not, then what am I missing?

Note, I'm using the CascadingDropDown control. It works fine on my development computer, but I get the following message when trying to run it on our web server:

AjaxControlToolkit.CascadingDropDown missing required Category property value for CascadingDropDown1.
Parameter name: Category

The category parameter is being set, so I don't understand what the error is.

Any help is much appreciated.

Hi...

and welcome to ASP.NET Forums!

I have an article on cascading dropdownlist. Check this linkhttp://www.aspalliance.com/1183

You also need to make sure, the parameter names should be the same (case-sensitive) as defined in the docs.

Thanks

How do I consume a JavaScript object on the main page in an ASCX control?

Hello,

I am using the ASP.Net AJAX client side libraries, and I want to be able to write Web User Controls (ASCX) that I dynamically load into my site. I want to be able to have a global object in my main page that is used by each ASCX control that is loaded into the page. As soon as the ASCX control is loaded, I want it run its script to call a method in the global object.

I am having a "timing problem" with my code. In order to use the ASP.Net AJAX libraries (like the "Type" object to register namespaces, etc.), I have placed the JavaScript on the main page in the "pageLoad" function.

Right now I am using the "setTimeout" function in my ASCX script to delay it a few seconds so I can be sure that the script in the main page has completely loaded before I make a call to the global object.

Is there any way that I can ensure that the script on the main page has loaded and stop using the "setTimeout" method in my ASCX script?

Here is the markup for my main page…

1<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="StartupScriptTest._Default" %>23<%@dotnet.itags.org. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>45<%@dotnet.itags.org. Register src="WebUserControl1.ascx" tagname="WebUserControl1" tagprefix="uc1" %>67<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">89<html xmlns="http://www.w3.org/1999/xhtml" >10<head runat="server">11 <title>Untitled Page</title>12 <script type="text/javascript">1314 var x = null; // <- I want to access this in the ascx control after pageLoad is finished1516 function pageLoad()17 {18 Type.registerNamespace('MyNamespace');1920 MyNamespace.MyClass = function()21 {22 MyNamespace.MyClass.initializeBase(this);23 }2425 MyNamespace.MyClass.prototype =26 {27 sayHello : function(message)28 {29 alert(message);30 }31 }3233 MyNamespace.MyClass.registerClass("MyNamespace.MyClass");3435 x = new MyNamespace.MyClass();36 }3738</head>39<body>40 <form id="form1" runat="server">41 <div42"ToolkitScriptManager1" runat="server">43 </cc1:ToolkitScriptManager>44 </div>45 <uc1:WebUserControl1 ID="WebUserControl11" runat="server" />46 </form>47</body>48</html>49

…and here is the markup for my ASCX control…

1<%@dotnet.itags.org. Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs" Inherits="StartupScriptTest.WebUserControl1" %>2<script type="text/javascript">34 setTimeout('x.sayHello("hello")', 1000); // <- Any way to not use 'setTimeout'?56<> 

Thank you for your help,

Dave

hello.

i'll just enumerate the things i think that are important:

1. do you need to define the class in the load event? I think that you can put it outside, in an external file and load it so that it's available at the begining of the page

2. are you wrapping any html control or behavior that exists on the page? if not, then i think that you can also insert your x = new class() at the begining of the class declaration.


Hi restating what Luis has said, you gotto implement something like this.,

Create a .js file consider sample.js.

Put this code inside

Type.registerNamespace('MyNamespace');

MyNamespace.MyClass = function() { MyNamespace.MyClass.initializeBase(this); } MyNamespace.MyClass.prototype = { sayHello : function(message) { alert(message); } } if ( typeof (Sys) !== 'undefined' ) Sys.Application.notifyScriptLoaded();

register this sample.js in the scriptmanager.


<asp:ScriptManager ID="ScriptManager1" runat="server" >
<Scripts>
<asp:ScriptReference Path="../../client_scripts/sample.js" />
</Scripts>
</asp:ScriptManager>

Then create the global variable inside your function. var x = new MyNamespace.MyClass();

Saturday, March 24, 2012

How do I add ATLAS feature to an existing ASP.NET 2.0 Web Application?

Hi all,

Can some one provide me the steps needed to add ATLAS features to an existing ASP.NET 2.0 Web Application?

I saw the video "Developing ASP.NET 2.0 Applications using "Atlas"" byScott Guthriewhere he explained how to add ATLAS features to the To-do application. But to start with, he created anATLAS WEBSITE PROJECTand started modifying it.

I see that the config file is very important for ATLAS to function correctly. What other dependency is there? How do I create an ATLAS enabled "Web application"?

Most importantly, if i have an ASP.NET 2.0 Web Application, how do i add ATLAS features to it?

Thankx in advance

Jacob

from other thread:

ScottGu:

The easiest approach might be to create a newweb-site using the Atlas template, and then copy the resultingAtlas.dll into the \bin directory of your existing application andintegrate the web.config file changes in as well. Then you should begood to go.

Hope this helps,

Scott


hello.

well, you must:

1. add the atlas dll to the bin folder and
2. add the necessary entries to the web.config file

note that you can get the dll from the installation folder (normally, program files\microsoft asp.ent\atlas\v...\atlas and you can also see the necessary web.config entries by opening the web.config file that exists on that dir.


Hi luis,

Thankx for the information. However, this i what is had figured too. I had tried this earlier but some how, it did not seem to be working.

I was looking to see if some one has already done this, and can specify the detailed steps, including the web.config changes etc..

did you ever try to do this? Were u able to make it work? I wanted to use the new 'atlas' control toolkit. Do u think it would be easy to integrate this to an existing web application?

What difference are there between an ASP.NET 2.0 Web Application and ATLAS Website Project provided by the visual studio? Is that only the web.config which differs?

thankx

Jacob

How do I acces profiles from a web service called from Atlas?

I have a web service that is called by a page that employs Atlas. I was wondering if there is a way to access the profile of the user from the webservice?

I'm trying to use HttpContext.Current.Profile.GetPropertyValue() but it's returning empty data. Is there anything that I have to set up?

Hi Zephyr,

Can you check to see whether the User.Identity.Name property is available in your web-service? This will indicate whether the user is logged in when the web-service is called. My guess is that they aren't - which is why the Profiloe is coming back null.

Thanks,

Scott

How can i use dataSource control, let it binding to page method but not web service

such as

<dataSource id="listDataSource" autoLoad="true" serviceURL="MyService.asmx" />

it binding to a web service named MyService.asmx,How can i binding it to a page method?

thanks

A data source can only declaratively bind to a DataService.

To bind it to other data, you can obtain the data programmatically (e.g. from a page method), and set the data property of the data source to the returned data.

Alternatively, you could directly bind the content (e.g. the ListView control) directly to the data, without using the data source control.

Thanks,

How can i use AJAX Control Toolkit in legacy ASP?

Hello to all,

like many i am new to AJAX and i am willing to dig in because i need to modernize an existing web application with pages in both in ASP (80%) and ASP.NET (20%) pages. I know the straightforward answer should be migrate all your asp in asp.net but unfortunately it's not an option.

Basically, what i am trying to do is to display a dragable panel on top those existing pages. The panel should be able to display information about the page. The user could also add new content in this panel and save seamlessly with AJAX.

First of all, if i want to reuse the widget from the toolkit, how can load them in ASP pages ?

Also, i read you can use the Ajax client library in non ASP.net. What does it mean ? I've look at it and it does seem very friendly. Any help would be appreciated.

Lastly, is it possible to have widget load from ASP integrated with an ASP.NET back-end for server side processing?


Thanks in advance for helping me out. I really would like to use this technology.


Olivier.

Well i got a solution that worked perfect for me: I am using Dojo. It's much more flexible in non ASP world and the toolkit set much richer as of now.

Wednesday, March 21, 2012

How can i stop my client side list view from disappearing every time i poll a web service?

I've written a page that displays some live information that is provided by a web service and then bound to a client side list view (the binding follows this example:http://atlas.asp.net/docs/Walkthroughs/GetStarted/databind.aspx). This page is updated with a client side timer that ticks every 3 seconds. The idea is that the page updates seamlessly as the web service is polled every few seconds.

This almost works, but there seems to be a delay whilst the web service is fetching the information, during which no list view is rendered. This means that every 3 seconds the table disappears momentarily, and then the new information is shown correctly. This leads to the screen looking "flickery".

My question is how can i prevent this flickering from appearing whilst the data is retrieved from the web service?

Many thanks

-Matt

Bonus Information:

Here are some code examples to make this a bit clearer. This is the code that updates the page and retrives the information from the webservice:

function PageRefreshTick() { LotItemDataService.GetInProgressLots(inProgressCallComplete); }function inProgressCallComplete(result) { document.getElementById("InProgressLotsItemListView").control.set_data(result); }
 And here are the relevant parts of the markup: 
<asp:Content ID="Content2" ContentPlaceHolderID="Zone1Content" runat="server"> <timer id="PageRefreshTimer" interval="3000" enabled="true" tick="PageRefreshTick" /> <atlas:ScriptManagerProxy id="ScriptManagerProxy" runat="server"> <services> <atlas:ServiceReference Path="LotItemDataService.asmx" /> </services> </atlas:ScriptManagerProxy><div class="ListView"> <div id="InProgressLotsItemListView"> </div> <div style="display: none;"> <div id="InProgressLotsItemListView_layoutTemplate"> <div id="InProgressLotsItemListView_layoutTemplate_templateItem"> <table border="0"> <tbody id="InProgressLotsItemListView_layoutTemplate_LotItemParent"> <tr id="InProgressLotItem" style="height: 28px; width: 599px;"> <td style="height: 28px;"> <table cellpadding="0" cellspacing="0"> <tr> <td style="width: 16px;"> <img id="InProgressIsTracked" alt="Tracked" src="../App_Themes/BCADirect/images/icons/icontracker.gif" /> </td> <td style="width: 40px;"> <a id="InProgressLotId" class="BidSessionLink"></a> </td> <td style="width: 10px;">   </td> <td style="width: 40px;"> <img id="VehicleImage" alt="VehicleImage" /> </td> <td style="width: 10px">   </td> <td style="width: 250px;"> <table> <tr> <td> <a id="InProgressCompleteDescription" class="BidSessionLink" /> </td> </tr> <tr> <td> <label id="InProgressRegistration" class="BidSessionLabel" /> </td> </tr> </table> </td> <td style="width: 10px;"> </td> <td style="width: 300px;"> <table> <tr> <td> <label id="InProgressHighestBidder" class="BidSessionLabel" /> </td> </tr> <tr> <td> <label class="BidSessionLabel">Current price: </label> <label id="InProgressCurrentPrice" class="BidSessionLabel" /> </td> </tr> </table> </td> <td style="width: 10px;">   </td> <td> <label class="BidSessionLabel" id="PlaceBidLabel">Test</label> </td> <td style="width: 100px; height: 100px;"> <label id="InProgressTimeRemaining" class="BidSessionLabel" /> </td> </tr> </table> </td> </tr> </tbody> </table> <a id="InProgress_layoutTemplate_HyperLink1" href="http://www.google.com" class="BidSessionLink"> </a> </div> </div> </div></div> <listView id="InProgressLotsItemListView" itemTemplateParentElementId="InProgressLotsItemListView_layoutTemplate_LotItemParent"> <layoutTemplate> <template layoutElement="InProgressLotsItemListView_layoutTemplate" /> </layoutTemplate> <bindings> <binding dataContext="waitingLotsItemDataSource" dataPath="data" property="data" /> </bindings> <itemTemplate> <template layoutElement="InProgressLotItem"> <image id="InProgressIsTracked"> <bindings dataPath="IsTracked" property="visible" /> </image> <hyperLink id="InProgressLotId"> <bindings> <binding dataPath="Id" property="text" /> <binding dataPath="VehicleDetailsUrl" property="navigateURL" /> </bindings> </hyperLink> <hyperLink id="InProgressCompleteDescription"> <bindings> <binding dataPath="CompleteDescription" property="text" /> <binding dataPath="VehicleDetailsUrl" property="navigateURL" /> </bindings> </hyperLink> <label id="InProgressRegistration"> <bindings> <binding dataPath="Registration" property="text" /> </bindings> </label> <label id="InProgressTimeRemaining"> <bindings> <binding dataPath="TimeRemaining" property="text" /> </bindings> </label> <label id="InProgressHighestBidder"> <bindings> <binding dataPath="HighestBidUserName" property="text" /> </bindings> </label> <label id="InProgressCurrentPrice"> <bindings> <binding dataPath="CurrentPrice" property="text" /> </bindings> </label> <label id="PlaceBidLabel"> <bindings> <binding dataPath="BidNowText" property="text" /> </bindings> </label> </template> </itemTemplate> </listView></asp:Content>

Although i didn't receive any replies through this board, I received a number of emails from my companies .net community, including this one:

The problem with the list view is a known issue with the Atlas team (not that they seem to be actively trying to fix it). I am currently working n a custom list view to try and reduce the flickering.

So there are couple of options open that you could try :-

1.Buffer your data and only redraw the list view when there is a delta in your data reducing the flicker.

2.Use the XML script data binding but draw the list view manually using atlas client side JavaScript (Here at HMV I manually create the list view using divs or a table due to the flickering issues).

3.If you are not bound to a Atlas then try http://www.telerik.com/ who has some awesome ajaxable controls that you can use.

I tried rendering the output myself with JavaScript to the innerHTML of a div tag, and this indeed fixed the problem. However this in turn introduces its own set of problems further down the line as I wanted to use animations, and using this method I have no components in the xml portion of the markup.

I guess until the underlying listview big is fixed, there is no way to move forward with this?

-Matt

how can i restate the focus inside updatepanel

hi,

i have several web controls inside a update panel. But i don't know how to set it so that right after my page come back from a callback, it will lost the focus. i tryed .focus() in asp.net, but it doesn't work... help anyone?

Alan,

after the focus method, try the upatepanel's Update() method.

it should work, although, i hide the same headache.

lblRowCount.Text = gridview1.Rows.Count.ToString();

txtProduitID.Focus();

pnlProduit.Update();

in this sample code, txtproduitID is the textbox where i type in the product code. and pnlProduit is the update panel.
this works for me.

regards,
formationusa


I tried that but it didnt work. Here is my code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> protected void btn_Click(object sender, EventArgs e) { txt1.Text = DateTime.Now.ToString(); txt1.Focus(); up2.Update(); }</script><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <atlas:ScriptManager ID="scriptmanager" EnablePartialRendering="true" runat="Server" /> <atlas:UpdatePanel runat="server" ID="up2" Mode="Conditional"> <ContentTemplate> <asp:TextBox runat="server" ID="txt1"></asp:TextBox> <asp:Button runat="server" ID="btn" Text="Button" OnClick="btn_Click" /> </ContentTemplate> </atlas:UpdatePanel> </form></body></html>

Can you tell me what im doing wrong?


your syntax is correct, it seems to be something which will need more time. i tested your sample, and got the same problem. Also, in the forms i worked on, I have different conditions for setting the focus on the textboxes.
I will keep checking on this problem in more detail.

if others experience the same, please post.

regards,
formationusa


I have the same problem, but I want to set the focus AFTER the UpdatePanel has returned because it is adding the field I want to focus. I've tried using a client-side timeout to wait for the UpdatePanel to finish, but the time would change from one browser/client to another.

Is there a way to tell an UpdatePanel to execute a client-side method after it has updated?


setting the focus in AJAX seems to be working with Fireworks and not IE, please will that be fixed for future releases as its very crucial to have working properly for data entry Web pages.
Sorry, I meant Firefox browser and not fireworks, my apology.

How can I pass additional parameters to the web service or how can I call a method in the

I have done a ton of research in this area and there just does not seem to be a way to pass any addiional parameters to the Web Service reference in the autoextneder call. Is there a way that this can be done. In my world, the list of suggestion is dependant on other data on my web form or web user control. I had read some references that you might be able to call a method in the code behind page, however everything i have tried on this has failed. Here is a list of what I have attempted

Tried to add query string arguments to the service path property (error is thrown trying to render the page)

Tried to set the service path to a web page (aspx) and then call the code behind method (this also threw error trying to render the page)

Viewed some alternative solutions from vrious posts...however most we out of date t the current release (RC1).

I see that David Reed has an example at Infiinity Loop, however his server is unavailable at this time.

I would love for the auto extender to be able to natively support calling the code behind method of the page or user control that is using it. It would seem logical that the derived suggestion should be able to present a filtered list based on other data. It would be nice if I could pass it an array of string that represent name value pairs of data that I can then access in the web service and pass to whatever is building the list. Anyway just a suggestion...maybe the functionality is there and I just can not figure it out

Please help

>> I have done a ton of research in this area and there just does not seem to be a way to pass any addiional parameters to the Web Service reference in the autoextneder call. Is there a way that this can be done. In my world, the list of suggestion is dependant on other data on my web form or web user control.

With some digging around in the AutoCompleteExtender you may be able to modify the javascript to do this - I've never looked at it personally but that is where I would start. You would need to hijack that part that reads from the target control and add other data to the call.

>> I had read some references that you might be able to call a method in the code behind page, however everything i have tried on this has failed.

The following RC1 example of using a page method works on my system, but it's not going to solve your problem. The page method has to be static, so you won't be able to access any form data.

<%@. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><%@. Register Assembly="BenValidationControls" Namespace="ben" TagPrefix="hauna" %><!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><script runat="server"> [System.Web.Script.Services.ScriptMethod] [System.Web.Services.WebMethod] public static string[] AutoCompleteMethod(String prefixText, int count) { return new string[] { "foo", "baz" }; } </script><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true" /> <div> <asp:TextBox ID="TextBox1" runat="server" /> <asp:AutoCompleteExtender ID="AutoCompleteExtender1" ServiceMethod="AutoCompleteMethod" ServicePath="~/default.aspx" TargetControlID="TextBox1" MinimumPrefixLength="1" runat="server" /> </div> </form></body></html>

Thanks for the response. I am looking at modifying from the jvavascript as you have suggested. Here is also what I have found out...

First off the code behind must be in an aspx page and not in a ascx. I am not sure why that should matter but apparently it does. it would be really be nice if I could reference the code behind on either type of file. If you are trying to make a reusable control within your app with the auto complete extender then this is somewhat limiting. Also what I did not know or see document anywhere that this function needed to be static. Once I did that it started working quite well.

Thank you very much on this. This actually helped quite a bit.


You were referring to my derived AutoCompleteExtender that enables callbacks... I had some server issues but its back up and running :) This would solve your problem perfectly.

http://weblogs.asp.net/infinitiesloop/archive/2006/11/15/ASP.NET-Ajax-Beta_3A00_-AutoCompleteBehavior-without-a-Web-Service.aspx

How can I optimize using ASP.NET with ajax control toolkit ?

-I have finish a web application. But when I launch it . It was running slowly. I can't understand what's happen in my web application.

-I'm using SQL Server 2000. My database have approximately 40,000 records. I used DataTable to store all records which I got information from database and using gridview , datalist control inside update panel.

-Especially my web application often use ModalPopupExtender to Insert or Update some informations.

-Could you show me how to optimize my web application with asp.net?

Thanks in advance !


There is no magic cure for making a website run fast. You will have to look at the page size, the objects you are storing in memory, enable tracing on the page to see where bottlenecks may occur and look at the speed of any database queries you are running (i.e. look at the execution plan of your stored procedures).

how can i make draggable/dockable elements on a web page

I want to create a web page where I can drag and drop content, and dock it on other parts of the page. I also want that content to remain in the most current position on the page when the page is reloaded. I want to do something along the lines of what they did atPageflakes but I have no clue how to implement it. Can anyone offer suggestions? I just need some pointers as how I should approach this.

Thanks!

I have discovered the wonderful world of webparts, which answers my question here. Check outthis article if you want to learn to create these kinds of sites too.

How can I make a masked label in web forms?

I'm developing a web site using AJAX and I need to display some data in a label but the data must be displayed with a mask.

For example, if I have two textboxes and I wanna do a sum between then, the label must display the result. But, I don't know what can I do to use a masked label.

If somebody can help me I'll be very thankful.

Thanks in advanced

i dont know if i completely understand you. you say you need a lable to display a sum but you want it masked? what exactly do you mean by masked.

a masked label is a lable that replaces certain (or all) characters with something else. For example a credit card number in a masked label could look like

***** ***** **** 3182

you can use a simple string.Replace method, or regular expressions to mask the label. Textboxes even have a Password Type which will mask everything typed into them automatically

What exactly do you want to mask in your label?