Wednesday, March 28, 2012

Disable Autocomplete extender in code

Is there any way to disable an autocompleteextender?

I have an autocompleteextender that works fine with a textbox but I need to hide that textbox. When I hide it, a javascript exception is thrown because the atlas code can't find the control. What should I do to disable the autocompleteextender in code?

Thanks

I was using this code:

foreach

(AutoCompleteProperties propin AutoCompleteExtender1.TargetProperties) {

prop.Enabled =

false;

}

But it didn't work. However with this it works:

AutoCompleteExtender1.TargetProperties.Clear();

Probably there's a bug somewhere because I think what I was doing should be enough.


hello.

how are you hiding the textbox? i'm guessing that you're setting the visible property to false...unfortunatelly, it looks like the xml script willnot be rendered itht ie enabled property is set to false. you can try to set both the visible and enabled properties of the associated textbox controls to false and this should stop the generation of the xml-script...


It is inside a table row so I set the table row to runat=server and set visible = false to the table row.

I have just tried setting the textbox enable and visible properties to false but it still doesn't work. I think that the correct behaviour should be not to render the xml-script related to the autocomplete textbox when the associated TargetProperty is not enabled.


hello again.

hum...after looking at what's going on, i think that the problem is that the behavior is being registered even when the control is not visible. you can change this by building your own completeextender with code similar to this one:

namespace

LA

{

publicclassBetterAutoCompleteExtender :AutoCompleteExtender

{

protectedoverridevoid OnPreRender(EventArgs e)

{

WebControl ctl =this.NamingContainer.FindControl(this.TargetProperties[0].TargetControlID)asWebControl;if ( ctl !=null && ctl.Visible &&this.TargetProperties[0].Enabled )

{

base.OnPreRender(e);

}

}

}

}

hope this helps (btw, you should open a bug report by adding a new post to the forum and redirect them to this post to get more info about the problem - don't forget to add the [BUG] word on the title).


Thanks Luis.

With that it works properly.

I'll add a new post with the bug.


Hello,

I'm attempting to put the autocomplete extender in a tabbed form. Is there a way to disable the autocomplete when the style of the div layer that the textbox is in gets set to style="display:none"?

Thanks,
Emilie

hello.

hum...in your scenario, you shouldn't need to disable it because if you're setting the display style, that means that all the elements will be loaded and you won't get errors when searching for them...


Here's the simple sample I'm working with:

<body>
<form id="Form1" runat="server">
<atlas:ScriptManager id="AtlasPage1" runat="server" />

<div style="display:none">
<asp:TextBox ID="TextBox1" runat="server"/>
</div>

<Atlas:AutoCompleteExtender runat="server" ID="autoComplete2">
<Atlas:AutoCompleteProperties TargetControlID="TextBox1"
Enabled="True" ServicePath="AutoCompleteService.asmx"
ServiceMethod="GetWordList"
minimumprefixlength="1" />
</Atlas:AutoCompleteExtender>
</form>
</body
Right now it gives me an "invalid argument" exception and cannot find the source code to break to.
However, if I remove style="display:none" from the div, it works fine.
I ran it again this morning and this time it was able to break to the line of code that was failing. In the Webresource.axd file there's a line

completionListStyle.width = (elementBounds.width - 2) + 'px';

But when the div is set to display:none, elementBound.width (referring to the width of the textbox) is 0.

Anyone have ideas on how to get around this?
I'm having the same problem here: when display: none is set, the autocompleteextender throws up an error.

Is there a workaround for this yet?

any news on this one, I have the same problem?

Andy

Disable Atlas things at runtime

I've got a form i am trying to create that if:

An administrator is logged in, a textbox with an AutoCompleteExtender (and TextWaterMark control as well) is available for the Admin to search for companies to look at data for

If it's a company logged in, i want to hide/disable this textbox and instead give them a dropdownlist of their assigned company (or companies) and not allow them to search for companies outside of them

the problem i am running into is that when i set the textbox to "visble = false", that causes Atlas to throw an error "Assertion Failed, could not find HTML element blah blah blah"...

I thought i'd be sneaky and instead of saying:
txtCompany.Visible = False

I instead said in the code
txtCompany.Style.Add("display", "none")

but that still errored, althought this time just a "runtime error has occured"

How can i simply say in code:

"If i am not an administrator, turn off the textbox, autocomplete, and watermark"

I'd probably put the entire textbox (atlas update panel included) inside a usercontrol, and show and hide the usercontrol accordinly.
Excellent suggestion and appears to be doing exactly what i want it to do......

Disable Atlas for a Specific Browser

My website was having a specific problem with Safari that required me to disable partial rendering on that browser.

I am currently using an HTTP module to detect that browser and turn off partial rendering, but I feel like this is something that I should be able to do in a *.browser file.

Is there a way using a .browser file to disable atlas for a specific browser?

hello.

well, if i recall correctly, browser files defined the known characteristics of a browser and yuo'll not be able to do that with a file of that type.


Can you please post the code that you're using for the detection. That would save some time ...

Thx
dB.


Ok, it's pretty simple. Again, I am using this in an HTTP module so it always runs:

If HttpContext.Current.Request.UserAgent.Contains("Safari")Then
Dim smAs ScriptManager =CType(CType(sender, Page).Master.FindControl("ScriptManager1"), ScriptManager)
sm.EnablePartialRendering =False
EndIf

I was just thinking that if I could somehow add something to the browsers file that said Safari wasn't capable of using Atlas (by disabling XMLHttpRequest or otherwise), it would be more efficient than what I am doing now.

If you are curious why I am doing this, it is because I am experiencing a bug with LinkButtons, with Atlas, in Safari. I posted a question about that first, butno one had any answer.

disable an updatepanel during asynch callback?

I have an UpdatePanel on a page, and within the UpdatePanel are a GridView and a Button that updates the GridView when clicked. I click the Button, a couple of seconds later the asynch callback returns and the GridView is re-rendered on the screen. Great. Now, what I would like to do is hook into the beginRequest and endRequest events of the client-side PageRequestManager and add a couple of functions that will replace the inner html of whatever UpdatePanel is making the callback request with a "Please Wait..." message while the callback is processing so that the user cannot change anything within the UpdatePanel until the callback is finished. What I can't figure out how to do is get a client-side reference to the UpdatePanel that initiated the current ajax callback. The UpdateProgress control is very close to what I'm trying to achieve, except that it doesn't "hide" its associated UpdatePanel.

Anybody have any ideas?

My recommendation would be to use the UpdateProgress control, and style it such that it covers the UpdatePanel. That would be easiest.

If you want to go ahead and hook beginRequest/endRequest, to answer your question about determining which UpdatePanel contains the control causing the postback, take a look at the JavaScript behind the UpdateProgress control, specifically this function:

 function Sys$UI$_UpdateProgress$_handleBeginRequest(sender, arg) { var curElem = arg.get_postBackElement(); var showProgress = !this._associatedUpdatePanelId; while (!showProgress && curElem) { if (curElem.id && this._associatedUpdatePanelId === curElem.id) { showProgress = true; } curElem = curElem.parentNode; } if (showProgress) { this._timerCookie = window.setTimeout(this._startDelegate, this._displayAfter); } }

Hai,

can u plz tell me any other sample.Me too facing same prblm...


Does this help?

http://weblogs.asp.net/rajbk/archive/2007/01/08/using-the-updateprogress-control-as-a-modal-overlay.aspx


Thanks for the suggestion Steve. In case anybody else is interested in doing something similar, here's the code for a simple extension of the UpdatePanel class that implements Steve's approach to the problem I originally described:

using System;using System.Collections.Generic;using System.Text;using System.Web;using System.Web.UI;namespace CustomAjaxControls{public class MyUpdatePanel : UpdatePanel{public MyUpdatePanel():base(){this.Load +=new EventHandler(MyUpdatePanel_Load);}private void MyUpdatePanel_Load(object sender, EventArgs e){RegisterClientScripts();}private void RegisterClientScripts(){StringBuilder library =new StringBuilder("");// start-up script (registered once for each instance of MyUpdatePanel on the page)this.Page.ClientScript.RegisterStartupScript(typeof(MyUpdatePanel),"StartUp" +this.UniqueID,"new MyUpdatePanel('" +this.ClientID +"');",true);// function library (registered once for all instances of MyUpdatePanel)library.AppendLine("// MyUpdatePanel javascript class");library.AppendLine("function MyUpdatePanel(panelId)");library.AppendLine("{");library.AppendLine("// properties");library.AppendLine("var _panel = document.getElementById(panelId);");library.AppendLine();library.AppendLine("// methods");library.AppendLine("this._handleBeginRequest = MyUpdatePanel_handleBeginRequest;");library.AppendLine();library.AppendLine("// hook into system events");library.AppendLine("Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(this._handleBeginRequest);");library.AppendLine();library.AppendLine("// MyUpdatePanel methods");library.AppendLine("function MyUpdatePanel_handleBeginRequest(sender, args)");library.AppendLine("{");library.AppendLine("var elem = args.get_postBackElement();");library.AppendLine();library.AppendLine("// find out if the object that requested the callback is our MyUpdatePanel");library.AppendLine("while (elem)");library.AppendLine("{");library.AppendLine("if (elem == _panel)");library.AppendLine("{");library.AppendLine("// hide the contents of the MyUpdatePanel until the asynchronrous callback returns");library.AppendLine("_panel.innerHTML ='Updating...';");library.AppendLine("return;");library.AppendLine("}");library.AppendLine("elem = elem.parentNode;");library.AppendLine("}");library.AppendLine("}");library.AppendLine("}// end class MyUpdatePanel");library.AppendLine();this.Page.ClientScript.RegisterClientScriptBlock(typeof(MyUpdatePanel),"library", library.ToString(),true);}}}

Disable an AnimationExtender

Hello,

I am developing a C# asp.net application and using the AJAX control toolkit.
I am using the AnimationExtender in order to add a fade effect to my page.
The AnimationExtender is a part of a gridView, since I wanted every row in the gridView to fade seperately.

Here is the gridView's code:
<asp:GridView ID="gvDocuments" runat="server" BorderWidth="0" ShowHeader="false" AutoGenerateColumns="False" Width="90%">
<Columns>
<asp:TemplateField HeaderText="Ticker">
<ItemTemplate>
<asp:Panel ID="pnlDoc" runat="server"><%# DataBinder.Eval(Container, "DataItem.docStart") % ></asp:Panel>
<asp:Panel ID="pnlQuote" runat="server"><%# DataBinder.Eval(Container, "DataItem.quote") %></asp:Panel>
<AjaxToolkit:AnimationExtender ID="AnimationExtender1" runat="server" TargetControlID="pnlQuote">
<Animations>
<OnLoad>
<Sequence>
<FadeIn Fps="20" Duration="0.5" MinimumOpacity=".1" MaximumOpacity="1"/>
</Sequence>
</OnLoad>
</Animations>
</AjaxToolkit:AnimationExtender>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView
The Grid is placed within an updatePanel with a timer.
What I would like to do is disable the AnimationExtender on some cases.

I tried using RowDataBound event:
((AjaxControlToolkit.AnimationExtender)e.Row.FindControl("AnimationExtender1")).Enabled = false;

And got an exception.

Is there a way to do that?

Thank you

Hello,

I do not see the handler defined for RowDataBound on your grid view. Could you provide us with your gridview with this defined and the code behind for RowDataBound and the exception?

Also, did you try to override page render and get teh control inside the grid's row?

Regards,

Louis


Sorry, my mistake.

I forgot to add:

if (e.Row.RowType ==DataControlRowType.DataRow)

So, it failed when going over the header first.

Thank you for trying to help...

Disable a button using AJAX

I saw this being discussed a couple of time but I wasn't able to figure out a solution. I got a webservice which is fired async by a button on my webform, now I need to disable the button to pretend ppl clicking multiple times on it. I tried it with that Javascript (added it to my .aspx in designer mode):

<scripttype="text/javascript">var prm = Sys.WebForms.PageRequestManager.getInstance();

prm.add_initializeRequest(InitializeRequest);

prm.add_endRequest(EndRequest);

var postBackElement;

//fired when the update starts

function InitializeRequest(sender, args) {

postBackElement = args.get_postBackElement();

$get('<%= Button1.ClientID %>').enabled =false;

}

//fired when the update ends

function EndRequest(sender, args) {

$get('<%= Button1.ClientID %>').enabled =true;

}

</script>

However, my browser is throwing the error:

Error: prm has no properties
Source File:http://localhost:3889/solution/site.aspx
Line: 48

Anyone knows how to do it properly? Thanks a lot!

My guess is that your above code is firing too early and so when you call the getInstance() you're getting a null value. Try wrapping the var prm= and the prm.add_ calls inside function pageLoad() so that it fires after everything's been initialized.


The Page requestManager does not intercept the WebService Calls. Try Something like this.

For Example if have a button.

<input id="btnFire" type="button" value="ClickMe" onclick="FireWs" /
and JS:

function fireJs()
{

$get('btnFire').disabled = true:

//Now Call Your WS
WS.YourMethod(function()
{
//In the success handler enable your button
$get('btnFire').disabled = false:
}
);
}


To keep pages cleaner, I am also a fan of emitting JavaScript from the codebehind. Just add an attribute to a control like this:

dim controlUniqueID as string = ctype(me.findcontrol("myDisabledControl"), myDisabledControlType).uniqueID ' lets the JavaScript find any control on the page

submitButton.attribute.add("OnClick", "add a reference to a javascript function, or put inline code here.")

----

For more complex functions, I will register a javaScript function library and then reference methods in it.

cheers

Directory Services problem

I am trying to switch one of our sites to Beta 2 from the last pre-Beta version. Our site uses windows authentication and directory services to handle much of the security on the website. With the pre-Beta version it would either log you in. With the Beta 2, it doesn't give authentication errors, but doesn't know which user is there and only gives access that any basic user would have. Does anyone have any ideas how to fix this?We are using Request.ServerVariables.Get("AUTH_USER") to get the logged in user.
Has anyone got that to work with the beta 2?

Directly return the result

Hey there,

What I do now is this:

Namespace.Services.GetNewPosts(OnGetNewPostsComplete);

And then in the function OnGetNewPostsComplete(), I can do some functions...

Butt... I need to do this maybe 20 times or something on different parts of the webapplication and thus with other functions...

So my question is, is it possible to do something like this:

Result = Namespace.Services.GetNewPosts();

No.. this is not possible, I know that, ATLAS is ansynchronious.. but I really need something that does the same thing.. any ideas? (I've looked up events.. but can't seem to program something that does this..)

Padschild, have you tried storing the result in OnGetNewPostsComplete() in a javascript field? Then you use it through out your page.

-jhawk

Direct method call from html event

I'm just beginning trying to get familiar with Atlas and beforehead I'm curious whether it is possible to get a event handler called without having to execute the whole state flow of a page.Hi,

do you mean a server event handler? If so, the page must go through its whole lifecycle.

dinamically adding a webuser control to a Modal Pop Up Extender

I have a page that has two buttons and a text box on it. It also has a panel named pnlPopUp and an modalpopupextender which has 'pnlPopUp' as the PopupControlID.

If you Click Button1 it will display webusercontrol1 and if you click button2 it will display webusercontrol2.

Each user control has two buttons on tem (btnOK and btnCancel).

The web user controls are added dinamically to the panel when I click button1 or button2 (using Page.LoadControl("~/WebUserControl.ascx") andpnlPopup.Controls.Add(webusercontrol) );

I am trying to fill the text of teh textbox in the page according to which button is clicked on the pop-up (if I click Ok it writes "OK" in the textbox),

but my button events aren′t firing!


P.S.: If I load the controls in the page′s Page_Load and making them visible when I need them it will work fine but I didn′t want to do that because in my actual web site i will have too many user controls.

Here′s the sample code. (I′m using the exact code for both user controls):

==================== Default.aspx=============================

<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@dotnet.itags.org. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@dotnet.itags.org. Register src="http://pics.10026.com/?src=~/WebUserControl.ascx" TagName="WebUserControl" TagPrefix="wuc" %
<!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>
<link rel="stylesheet" href="http://links.10026.com/?link=back.css" type="text/css" media="screen" />
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server" EnableViewState="true">
<ContentTemplate>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

<asp:Button ID="btnPopup" runat="server" Text="PopUp" />

<input type="hidden" runat="server" id="hdnPopUp" />

<asp:Panel ID="pnlPopUp" runat="server" CssClass="modalPopup">
</asp:Panel>

<cc1:ModalPopupExtender ID="mpeTestePopUp" runat="server" TargetControlID="hdnPopUp"
PopupControlID="pnlPopUp" DropShadow="true" BackgroundCssClass="modalBackground">
</cc1:ModalPopupExtender>
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>

===========================================================

==================== Default.aspx.cs============================

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using AjaxControlToolkit;

public partial class _Default : System.Web.UI.Page
{
WebUserControl ucTestePopUp;

protected void Page_Load(object sender, EventArgs e)
{
}

void Page_Init(object sender, EventArgs e)
{
this.btnPopup.Click += new EventHandler(btnPopup_Click);
}

void btnPopup_Click(object sender, EventArgs e)
{
ucTestePopUp = (WebUserControl)Page.LoadControl("~/WebUserControl.ascx");
this.pnlPopUp.Controls.Add(ucTestePopUp);
this.mpeTestePopUp.Show();
}
}

============================================================

==================== WebUserControl.ascx============================

<%@dotnet.itags.org. Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %>
<table>
<tr>
<td>
<asp:Button runat="server" ID="btnSim" Text="Sim" />
</td>
<td>
<asp:Button runat="server" ID="btnNao" Text="Nao" />
</td>
</tr>
</table>

==================================================================

==================== WebUserControl.ascx.cs============================

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class WebUserControl : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}

void Page_Init(object sender, EventArgs e)
{
this.btnSim.Click += new EventHandler(btnSim_Click);
this.btnNao.Click += new EventHandler(btnNao_Click);
}

protected void btnNao_Click(object sender, EventArgs e)
{
((TextBox)this.Parent.FindControl("txtTeste")).Text = "Clicou N?o";
}

protected void btnSim_Click(object sender, EventArgs e)
{
((TextBox)this.Parent.FindControl("txtTeste")).Text = "Clicou Sim";
}
}

=================================================================

Hi,

to handle events you need a control with an event handler to instantiated. If you only load your user control once in the click event handler, the button (textbox) in your user control does not exist on the page when postback caused by this button in user control is processed at the server.

Therefore, as you said you need to load your user control in page_load to handle events.

However, you don't need to load all controls. You just need to remeber which control was created last time and create this single control. You can store this information in the ViewState property.

Once you handled events from controls insode user control you can safely remove it from the page.

ALSO: You need to assign ID to your dynamically loaded user control. Otherwise, you will occasionally get problems with events firing from the second click.

-yuriy
http://couldbedone.blogspot.com

Digg-Like Button Animation, Easy Way?

Hi,

I've been trying to create a button with fading/morphing effect for a while now (kind of like digg buttons), but so far I'm not very happy with the results.

I almost got there, but not quite. Any help would be appreciated.

I have the buttons inside a Repeater control. So getting the button's client id is not the simplest thing. I also wanted to change the source image of the button (src attribute), this can't be done thru the StyleAction, so I used a Javascript/ScriptAction solution. The solution works greatly for hover effects, but not for client-side click events.

Here's the code (all client-side):

//first the fake button and animation to init everything, I know there are other ways, but this works fine.

<asp:Button EnableViewState="false" ID="FakeTarget" runat="server" Style="display: none" />
<cc1:AnimationExtender ID="aex" runat="server" TargetControlID="FakeTarget" /
//the repeater and the individual updatepanels:
<asp:Repeater ID="rpt" runat="server" OnItemCommand="rpt_ItemCommand" EnableViewState="False" OnItemDataBound="rpt_ItemDataBound">
<ItemTemplate>
<atlas:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:LinkButton id="btn" runat="server" OnMouseOver="attach(this)"/>
</ContentTemplate>
</atlas:UpdatePanel>
</ItemTemplate>
</asp:Repeater
//the javascript code
function attach(v)
{
if (v != null)
{
//scriptaction to execute (basically change the button's image)
var s = "var x = document.getElementById('" + v.id + "');if (x) x.src = 'img/new.gif';";
var effects = new Array();
effects[0] = new AjaxControlToolkit.Animation.FadeOutAnimation(v, .5, 30, .1, 1, false);
effects[1] = new AjaxControlToolkit.Animation.ScriptAction(v, .1, 20, s);
effects[2] = new AjaxControlToolkit.Animation.FadeInAnimation(v, .5, 30, .2, 1, false);

AjaxControlToolkit.Animation.SequenceAnimation.play(v, 0, 24, effects, 1);
return false;
}
}

this works perfectly, but substituting OnMouseOver for OnClientClick messes things up, as I think it's a timing issue with the updatepanel returning too quickly. The only fix I've found so far is force the Server-side Command Event to sleep for the animation time, but I hope there's a more elegant way of doing this.

Thanks,

Alexbump

Could you explain in more detail what the desired effect looks like?

Is there an example of what you want in the web?

Digg Style Comments

How can you implement a digg style commenting system using AJAX.NET?

I tried to use the CollapsiblePanelExtender within a Repeater. The idea was to fire off an asynchronouspostback to update comment rankings when the collaspe and expand controls are triggered.

Soon after I discovered that CollapsiblePanel doesn't expand/collapse within a Repeater if SuppressPostBack="false". If SuppressPostBack="true", then i could execute some code to update the ranks.

Then I realize once a PostBack occurs all my CollapsiblePanels will revert to their default collapsed or expanded state.

Please provide some ideas or point me in the right direction.

thanks

Try to specify asynchronous post back for the events of?the CollapsiblePanelExtender?through?a?asp:UpdatePanel.Can?you?post?some?codes?here?
This?is?will?help?us?to?fix?the?problem.

Dificult to reproduce : problems with webpartzones inside updatePanel

Hi !

That's very dificult to reproduce.

I'm creating a new website. I'm using the default webserver of Visual Studio 2005.

The home page users master pages and has a lot of user controls. The scriptManager and the webpartmanager are in masterpage.

One of the user controls uses three panels with ColapsiblePanelExtender. It's working now, after discovered It doesn't work without documentType tag.

The user controls are inserted in the master page, including a top menu with a top banner.

In the main page I have an UpdatePanel with two webpartzones and some webparts. I also have an UpdateProgress

The problems started when I tried to put outputcache in some user controls, like header and footer of the page.

1st Problem : The webParts in the middle don't allow to change position any more. When I move the webParts, the server is contacted (UpdateProgress works), answer is received but nothing change.

This happens sometimes. First I thinked it was cache, so I take out outputcache from all user controls and tried again, inserting outputcache one by one.

So I discovered that when I get this problem, if I delete the temporary directory for this application (in ASP.NET temp folder), close the webserver (and related process) and delete the browser cache the problem disappears.

2nd Problem : After insert outputcache in some user controls, something difference started to happend - when I move one webpart it changes, but the top banner change it's position, changing the page layout!

The UpdatePanel and webparts are in default.aspx page. Default.aspx uses one masterPage. Inside this master page is the top.ascx user control. Inside this control is the banner. So, something in the page change the layout, making the banner changes Its position!

In the moment I will undo all the cache changes, one by one, trying to discover wich change created this problema, but I don't believe one of the cache changes could do this.

With all this problems, the development becames too slow.

[]'s

Dennes

Hi !

I solved the banner problem, but I still don't know why it happend.

The original HTML was like this :

<style type="text/css" title="Portal BufaloInfo"><!--#banner {position:absoluteleft:284pxtop:21pxwidth:468height:60z-index:1}--></style><div id="banner"><a href="#"><img src="images/banner_468_60.gif" width="468" height="60" border="0"></a></div>

I changed to :

<div id="banner" style="position:absolute;left:284px;top:21px;width:468;height:60;z-index:1"><a href="#"><img src="images/banner_468_60.gif" width="468" height="60" border="0"></a></div>

So, now it works. Before this change, when the style was applied to DIV tag the banner was correct, when not, the banner apears in other position.

The main question is : Why the updatePanel, after a refresh, was changing the way this style was applied ?

[]'s

Dennes


Hi !

This seems to be a problem between Alas and IE, or something like that.

After I corrected the banner problem, IE stoped to apply the style to the rest of the page, to the entire page.

Like before : The pages start correct, after UpdatePanel has communicate with the server, the style disappears.

[]'s

Dennes

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,,,,

Difficulty building site after ajax install.

I'm having some trouble with my first AJAX experience namely in the build/publish part. F5 build on VS server works fine only when I want to Publish the application to ready for deployment I get this error underneath. Looked at couple message boards but its not clear me. I've also tried aspnet_regsql without any affect. Does anyone have any idea whether this is AJAX related and how I can solve to build the project? greatly appreciated.

-- Build started: Project: D:\...\Application1\, Configuration: Debug .NET --

Index was outside the bounds of the array.

-- Skipped Publish: Project D:\...\Application1\, Configuration: Debug .NET --

just wanted to add something... if choose Build> Rebuild Webiste instead of publish if gives me 33 warning messages saying

"Could not find schema information for the element 'webServices' and all other elements I've added from the AJAX template.

The template version works fine. Don't see why this should make a difference. Default webserver runs work fine.

Arrgg


just wanted to add something... if choose Build> Rebuild Webiste instead of publish if gives me 33 warning messages saying

"Could not find schema information for the element 'webServices' and all other elements I've added from the AJAX template.

The template version works fine. Don't see why this should make a difference. Default webserver runs work fine.

Arrgg this is cracking my head as I can't find much info on it.

Difficulty After Install. Missing JavaScripts?

Greetings everyone --

I'm investigating Atlas because I have need to drag-n-drop between up to four zones on a single page. Each time I drag an element from one zone to another, it has to persist that action to the database in real time. So I've installed the Atlas framework, but I can't get anything to work at all.

For example, I've created a web project referencing the Microsoft.Web.Atlas.dll along with a page called "Example.aspx". Into that page I copied the source code for the following example on atlas.asp.net.

http://atlas.asp.net/docs/util/srcview.aspx?path=~/atlas/samples/controls/control5.src

When I build and call the webpage, I see the content rendered by the HTML but there's nothing at all related to AJAX/Atlas functionality on the page. My hypothesis is that the appropriate Javascript files are not being referenced correctly, or they haven't been copied to the right place.

I've tried to copy the ScriptLibrary\Release directory to my local web directory but that didn't work. I had no luck either when trying to specify that the ScriptManager should load an explicitly referenced Javascript file like so:

<atlas:ScriptManagerrunat="server"ID="ScriptManager1">

<Scripts>

<atlas:ScriptReferencePath="~/ScriptLibrary/AtlasUIDragDrop.js"ScriptName="custom"/> </Scripts></atlas:ScriptManager>

At this point I'm stuck which is unfortunate 'cause I'd like to use this library given that the rest of the project is .NET. Seems like a good fit. And obviously there are people out there who've gotten this to work, but I'm at a loss.

Any suggestions? Thanks.

hello.

well, i you check the source of the page on the browser, you'll surelly see several "webresource.axd?..." entries. one or more of these should load the script files on the page.


Luis -- Yes, I do see those references when I "View Source". An example is below. However, still no Atlas functionality.

<script src="http://pics.10026.com/?src=/Atlas2/WebResource.axd?d=G9ZZO75SJS72S3-g1JZzk6TyxaOlDwXjSdR4wGRZm45lxhgXFD31v2NV1yxSd_CZ1dUM9aPflYprd8NUj4GeyW2dnZ4TxHWva8leh6b5bPQ1&t=632799165960000000" type="text/javascript"></script>

I wonder...could it be that the .axd extension isn't mapped to the appropriate dll or exe in IIS? I found that when I used the Atlas template in Visual Studio to create a new Atlas Web Site the template doesn't map the .aspx extension to the aspnet_isapi.dll -- which is kind of annoying. Perhaps I better check this hunch.

Trevor


That IS indeed what it was. I had to map the .axd extension to the aspnet_isapi.dll and now the example works.

It's my view that the "Atlas Web Site" template in Visual Studio should set all this up itself -- especially if you specifyhttp://localhost/blahblahblah for your project location.

OK, on to the next thing.

Trevor


hello.

well, in fact, it's an asp.net 2.0 installation issue. if you installed asp.net 2.0 and configured your server to use it, that extension should already be mapped to that dll...

Difficulties using an asp:ImageButton and the PopupControlExtender

I have a textbox and an asp:ImageButton. I would like the Image button to be able to launch the calendar control using the PopupControlExtender and then insert the date into the textbox from selecting it on the calendar. Not sure that I am even close in my example. I am unsure as to what should be in the code behind(C#) as well. Any help would be appreciated.

<

atlas:ScriptManagerID="ScriptManager1"EnablePartialRendering="true"runat="server"></atlas:ScriptManager><asp:TextBoxID="DateTextBox"runat="server"></asp:TextBox><asp:ImageButtonID="ImageButton1"runat="server"ImageUrl="~/Images/Calendar.gif"/><asp:PanelID="Panel1"runat="server"CssClass="popupControl"><atlas:UpdatePanelID="UpdatePanel1"runat="server"><ContentTemplate><atlasToolkit:PopupControlExtenderID="PopupControlExtender1"runat="server"><atlasToolkit:PopupControlPropertiesTargetControlID="ImageButton1"PopupControlID="Panel1"Position="Bottom"/></atlasToolkit:PopupControlExtender><center><asp:CalendarID="Calendar1"runat="server"BackColor="White"BorderColor="#999999"CellPadding="1"DayNameFormat="Shortest"Font-Names="Verdana"Font-Size="8pt"ForeColor="Black"Width="160px"OnSelectionChanged="Calendar1_SelectionChanged"><SelectedDayStyleBackColor="#666666"Font-Bold="True"ForeColor="White"/><TodayDayStyleBackColor="#CCCCCC"ForeColor="Black"/><SelectorStyleBackColor="#CCCCCC"/><WeekendDayStyleBackColor="#FFFFCC"/><OtherMonthDayStyleForeColor="#808080"/><NextPrevStyleVerticalAlign="Bottom"/><DayHeaderStyleBackColor="#CCCCCC"Font-Bold="True"Font-Size="7pt"/><TitleStyleBackColor="#999999"BorderColor="Black"Font-Bold="True"/></asp:Calendar></center></ContentTemplate></atlas:UpdatePanel></asp:Panel>

PopupControl's natural behavior is to add the commit text to its TargetControlID. You want the text to go to a different control, so that's why it's a little more difficult. However, you should be able to get this to work thanks to PopupControl's extensibility. What should work is:

1. Set the CommitProperty property to something handy like "value". This will tell PopupControl to store the commit text in a "value" property on the TargetControlID (an image in your case).

2. Set the CommitScript property to some JavaScript code that reads the commit text from TargetControlID.value and sets it to the intended text box.

That's the general idea - if it doesn't work for you, please follow up here.


Hi David,

I tried the steps you mentioned. Everytime I click on the Imagebutton the calendar displays(flickers) and then disappears, however, when I right click the button the calendar stays open and i can choose a date and it appears in the textbox. What else am I doing wrong?

<

scriptlanguage="javascript"type="text/javascript">function getCalendarValue()

{

document.getElementById('DateTextBox').value = document.getElementById('ImageButton1').value;

} getCalendarValue()

</script>

</head>

<body>

<formid="form1"runat="server"><atlas:ScriptManagerID="ScriptManager1"EnablePartialRendering="true"runat="server"></atlas:ScriptManager><asp:TextBoxID="DateTextBox"runat="server"></asp:TextBox><asp:ImageButtonID="ImageButton1"runat="server"ImageUrl="~/Images/SmallCalendar.gif" />

<asp:PanelID="Panel1"runat="server"CssClass="popupControl"><atlas:UpdatePanelID="UpdatePanel1"runat="server"><ContentTemplate><atlasToolkit:PopupControlExtenderID="PopupControlExtender1"runat="server"><atlasToolkit:PopupControlPropertiesTargetControlID="ImageButton1"PopupControlID="Panel1"Position="Bottom"CommitProperty="value"CommitScript="getCalendarValue()"/></atlasToolkit:PopupControlExtender><center><asp:CalendarID="Calendar1"runat="server"BackColor="White"BorderColor="#999999"CellPadding="1"DayNameFormat="Shortest"Font-Names="Verdana"Font-Size="8pt"ForeColor="Black"Width="160px"OnSelectionChanged="Calendar1_SelectionChanged"><SelectedDayStyleBackColor="#666666"Font-Bold="True"ForeColor="White"/><TodayDayStyleBackColor="#CCCCCC"ForeColor="Black"/><SelectorStyleBackColor="#CCCCCC"/><WeekendDayStyleBackColor="#FFFFCC"/><OtherMonthDayStyleForeColor="#808080"/><NextPrevStyleVerticalAlign="Bottom"/><DayHeaderStyleBackColor="#CCCCCC"Font-Bold="True"Font-Size="7pt"/><TitleStyleBackColor="#999999"BorderColor="Black"Font-Bold="True"/></asp:Calendar></center></ContentTemplate></atlas:UpdatePanel></asp:Panel></form>
You were SO close! You're using an ImageButton which has submit semantics - it's the submit that's causing the flicker and messing stuff up. Change it to an Image instead, and it works great. Here's the code:
<%@. Page Language="C#" %><%@. Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="atlasToolkit" %><!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 Calendar1_SelectionChanged(object sender, EventArgs e) { PopupControlExtender1.Commit(Image1, Calendar1.SelectedDate.ToString()); }</script><html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat="server"> <title>Untitled Page</title> <script language="javascript" type="text/javascript"> function getCalendarValue() { document.getElementById('DateTextBox').value = document.getElementById('Image1').value; }// getCalendarValue() </script></head><body> <form id="form2" runat="server"> <atlas:ScriptManager ID="ScriptManager1" EnablePartialRendering="true" runat="server"> </atlas:ScriptManager> <asp:TextBox ID="DateTextBox" runat="server"></asp:TextBox> <asp:Image ID="Image1" runat="server" ImageUrl="~/ToggleButton/ToggleButton_Checked.gif" /> <asp:Panel ID="Panel1" runat="server" CssClass="popupControl"> <atlas:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <atlasToolkit:PopupControlExtender ID="PopupControlExtender1" runat="server"> <atlasToolkit:PopupControlProperties TargetControlID="Image1" PopupControlID="Panel1" Position="Bottom" CommitProperty="value" CommitScript="getCalendarValue()" /> </atlasToolkit:PopupControlExtender> <center> <asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="#999999" CellPadding="1" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" Width="160px" OnSelectionChanged="Calendar1_SelectionChanged"> <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" /> <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" /> <SelectorStyle BackColor="#CCCCCC" /> <WeekendDayStyle BackColor="#FFFFCC" /> <OtherMonthDayStyle ForeColor="#808080" /> <NextPrevStyle VerticalAlign="Bottom" /> <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" /> <TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" /> </asp:Calendar> </center> </ContentTemplate> </atlas:UpdatePanel> </asp:Panel> </form></body></html>

Awesome! I changed it and it worked like a charm. Thanks David! The only other thing I noticed was that when the page loads, it seems like the calendar control shows for a brief second and disappears. How would I get around this?
Look at the .popupControl style used by the samples - it applies "visibility:hidden" to the relevant panel from the very beginning. That way the browser never tries to show it until it's popped.
Thanks for your help!! Genious!!!

Hi;

I followed your code.

Can you let me know why the document.getElementById can't find my contols? I had to look into the source of my page and find out that the name is of my text box isctl00$ContentPlaceHolder1$tbActivationDate instead oftbActivationDate?

the javascript function worked when I did this:

document.getElementById('ctl00$ContentPlaceHolder1$tbActivationDate').value = document.getElementById('ctl00_ContentPlaceHolder1_ImgActivationDate').value


The name of the control may have been ctl00$xxx, but the getElementById works off of the id which would have been ctl00_xxx. If you refer to the control by the '_' version, I this should will work fine.
Thanks, this worked like a charm! One question, though...

I was dynamically creating the javascript, like so:

sb.Append("function GetCalendar1Value(){"); sb.Append("document.getElementById('" + tbBeginDate.UniqueID +"').value = " +"document.getElementById('" + imgCal1.UniqueID +"').value;"); sb.Append("}");
However, this created a full name of "ctl00$ContentPlaceHolder1$imgCal1", which didn't work. I hardcoded it to "ctl00_ContentPlaceHolder1_imgCal1" and it works.

Why doesn't the UniqueID work for the <asp:image> control, or is there a better way of doing it? I guess it works as is, I'm just curious. Thanks!
Hi edmicman,

You may want to check out theClientID property. I think this is more along the lines of what you're looking for...

Thanks,
Ted
Thanks! But doesn't .ClientID only return the ASP.NET ID, i.e. "imgImage1" instead of the full name of the control within a master page, etc. ("ctl00_content... etc.)? It seems like I tried that before and it needed the full name or something. I'll try it again...

Thanks a lot, I was looking for this code and it works fine!


When I try to use this with MasterPages, it doesn't work anymore (yesterday I tried it on a single asp.net page for tests).

I have my JavaScript placed in the <head></head> part of my MasterPage (when I try another JavaScript placed on my MasterPage, it just works fine)

What am I doing wrong?


Hi Hopke,

I'm not sure what's going wrong with this. Perhaps you can post a small sample that still contains the problem so I can try to help.

Thanks,
Ted

Difficult to disable ClientState in User Control

Not sure there's a solution for this, but I find it overly difficult to disable the client state field. I'm using HTTP Get for my post, and I have a textbox watermark extender on a field. I don't want the ClientState because it makes my URLs look bad. So I have to set EnableClientState to false BEFORE the client state hidden control is actually set. In a user control, I don't think I get any chance to do this. (The debugger says I don't see OnInit before the contained TextBoxExtender does, and there's no PreInit for the control).

So my only choice would be to derive from TextBoxWatermarkExtender. Not the end of the world, but I don't think it's what was intended. Thoughts?

Your idea about deriving from TBW seems pretty reasonable to me. Any objections?
Yeah, it's an awfully heavy price to pay for simply setting a property. I would much prefer to see this in the core classes.

Difficult problem with the UpdatePanel and State

Hi,

I have a page with an UpdatePanel that display 5 news story headlines, within the UpdatePanel there are two buttons, back and next, to move the to the next 5 headlines set or to move previous 5 headlines set. Each headline has a link that goes to a new page where the full news story is shown. All this is working great, but if the user is on the second or third set of headlines, then clicks on one of the headlines to go to the page that shows the entire news story, then the user click the back button on the browser to get back to the news story headlines, the news story headlines page will display the first set of news story headlines, not the second or third set where the user originally left from.

How I can let the news story headlines page or the UpdatePanel know on which set the user left the page, so when the user came back via the back browser button, the set they left is displayed?

Hope this makes sense! Thank you.

Please, let me know if I should explain this better or differently, need help with it!

differnet image with each tabpanal

hi friends how can i place image with each tabpanal. likeSmilefirst tab,AngrySecondtab...

thanks in advance.

I have not tried this, but I think you might be able to through the control's Theming of Tabs. Here's a good article on customizing the appearance of the Tabs.

http://blogs.visoftinc.com/archive/2007/09/26/ajax-control-toolkit-tab-control-themes.aspx


You could just add the IMG HTML to the HeaderText attribute of the TabPanel, for example:

HeaderText="<img alt='' width='10' height='10' style='margin-right:10px;' src='...ImagePath...'/>Tab 01"

-Damien


can we set the backgroundcolor or give background image when we mouse moves over the tabs.

thanks in advance.


can we set the backgroundcolor or give background image when mouse moves over the tabs.

thanks in advance.


This can be achieved by changing the.ajax__tab_hover css class

George .


.ajax__tab_xp.ajax__tab_header {font-family:verdana,tahoma,helvetica;font-size:11px;background:url(<%=WebResource("AjaxControlToolkit.Tabs.tab-line.gif")%>)repeat-xbottom;}

.ajax__tab_xp.ajax__tab_outer {padding-right:4px;background:url(<%=WebResource("AjaxControlToolkit.Tabs.tab-right.gif")%>)no-repeatright;height:21px;}

.ajax__tab_xp.ajax__tab_inner {padding-left:3px;background:url(<%=WebResource("AjaxControlToolkit.Tabs.tab-left.gif")%>)no-repeat;}

.ajax__tab_xp.ajax__tab_tab {height:13px;padding:4px;margin:0;background:url(<%=WebResource("AjaxControlToolkit.Tabs.tab.gif")%>)repeat-x;}

.ajax__tab_xp.ajax__tab_hover.ajax__tab_outer {background:url(~\images\bt-delete.gif)no-repeatright;}

.ajax__tab_xp.ajax__tab_hover.ajax__tab_inner {background:url(~\images\bt-delete.gif)no-repeat;}

.ajax__tab_xp.ajax__tab_hover.ajax__tab_tab {background:url(~\images\bt-delete.gif)repeat-x;}

.ajax__tab_xp.ajax__tab_active.ajax__tab_outer {background:url(<%=WebResource("AjaxControlToolkit.Tabs.tab-active-right.gif")%>)no-repeatright;}

.ajax__tab_xp.ajax__tab_active.ajax__tab_inner {background:url(<%=WebResource("AjaxControlToolkit.Tabs.tab-active-left.gif")%>)no-repeat;}

.ajax__tab_xp.ajax__tab_active.ajax__tab_tab {background:url(<%=WebResource("AjaxControlToolkit.Tabs.tab-active.gif")%>)repeat-x;}

.ajax__tab_xp.ajax__tab_body {font-family:verdana,tahoma,helvetica;font-size:10pt;border:1pxsolid#999999;border-top:0;padding:8px;background-color:#fff8dc;}


Check out my blog on theming the tabs, it should help you out:http://blogs.visoftinc.com/archive/2007/09/26/ajax-control-toolkit-tab-control-themes.aspx

-Damien


hi i got the Answer from the following blog few days before.

http://mattberseth.com/blog/2007/09/more_sample_ajaxcontroltoolkit.html

thanks.

Different version...same problems...

Hi, I have downloaded the last version of "ATLAS" and I keep trying to make this things...

I have two file in my project, the UserControlDefault.ascx and Default.aspx
in my Default.aspx i have a button (bt1) and an UpdatePanel (up1).

When i hit the bt1, I load dinamically the UserControlDefault.ascx.
Inside this UserControlDefault.ascx, I have a button and a TextBox, when I hit this button, my textbox receive the value "Text changed.";

My problem is that, the usercontrol's button click doesn't fire and the usercontrol disappears =(

If I set the UseSubmitBehavior to false, I get a javascript error =(

How can I do this?
ThanxHi,

Kerkhoff:


My problem is that, the usercontrol's button click doesn't fire and the usercontrol disappears =(


are you re-creating the user control every time the page is loaded? Once you add a dynamic control, you must re-instantiate it on every request.

Kerkhoff:


If I set the UseSubmitBehavior to false, I get a javascript error =(


probably the __doPostBack javascript function is not being dropped on the page. Put this statement in the Page_Load handler of your user control:

Page.ClientScript.GetPostBackEventReference(this, String.Empty);
Thanx man =D

this really works for me :)

different version of AJAX

Dear All,

I and my friend are working on similar project.we installed the same VS 2005 version and SP1 and AJAX.my program has error.

it couldnt loadSystem.Web.Extensions does it cause by different version of AJAX?

or any other reason?

how can I fix this error?

<tagMapping>

<add tagType="System.Web.UI.WebControls.CompareValidator" mappedTagType="System.Web.UI.Compatibility.CompareValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">

<addtagType="System.Web.UI.WebControls.CustomValidator"mappedTagType="System.Web.UI.Compatibility.CustomValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<addtagType="System.Web.UI.WebControls.RangeValidator"mappedTagType="System.Web.UI.Compatibility.RangeValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<addtagType="System.Web.UI.WebControls.RegularExpressionValidator"mappedTagType="System.Web.UI.Compatibility.RegularExpressionValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<addtagType="System.Web.UI.WebControls.RequiredFieldValidator"mappedTagType="System.Web.UI.Compatibility.RequiredFieldValidator, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<addtagType="System.Web.UI.WebControls.ValidationSummary"mappedTagType="System.Web.UI.Compatibility.ValidationSummary, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

</tagMapping>

Have you tried to re-install the AJAX library again?


of course I tried to re-install AJAX but nothing happenedConfused


Sorry that I asked, but sometimes those are the common errors. Also are you sure that you installed 1.0 instead of 3.5?


As I saw in the version tab it is 1.0.does it cause trouble to install version 3.5 instead of 1.0?(if my problem is solved in this case)


hello.

well, the validators are not on the system.web.extensions assembly. I think that they're on the validators dll:

http://forums.asp.net/t/1066821.aspx

btw, if you update your app to use the new version, i think that you no longer need to use those validators.

Different stars in the rating control with css

I need a rating control that has a star/button for "no opinion". This should be something like- 0 * * * *, with 0 being the first option to click, and the *'s being normal rating stars. Is it possible to do this with just css?- all I would need is to swap out the star pictures for the first star.

If my description isn't clear, sun has a rating control that makes a good example:

http://developers.sun.com/jscreator/learning/tutorials/2/ajaxrating.html (Scroll down about 40%)

Hi SidewaysFish,

Here is a sample which is replaced by another icon and the sample also shows how to change its title.

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"></script><html xmlns="http://www.w3.org/1999/xhtml" ><head id="Head1" runat="server"> <title>Untitled Page</title> <style> .ratingStar { font-size: 0pt; width: 13px; height: 12px; margin: 0px; padding: 0px; cursor: pointer; display: block; background-repeat: no-repeat; } .filledRatingStar { background-image: url(../pic/FilledStar.png); } .emptyRatingStar { background-image: url(../pic/EmptyStar.png); } .savedRatingStar { background-image: url(../pic/SavedStar.png); } </style></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <ajaxToolkit:Rating ID="Rating1" BehaviorID="RatingBehavior1" runat="server" CurrentRating="1" MaxRating="3" ReadOnly="false" StarCssClass="ratingStar" WaitingStarCssClass="savedRatingStar" FilledStarCssClass="filledRatingStar" EmptyStarCssClass="emptyRatingStar" Tag="99" > </ajaxToolkit:Rating> <script type="text/javascript" language="javascript"> function pageLoad(){ //change its title var RatingID = "<%=Rating1.ClientID%>"; for(i=0;i<$find("RatingBehavior1").get_MaxRating();i++){ switch(i){ case 0: $get(RatingID+"_Star_"+(i+1).toString()).title ="Bad";break; case 1: $get(RatingID+"_Star_"+(i+1).toString()).title ="OK";break; case 2: $get(RatingID+"_Star_"+(i+1).toString()).title ="Excelent";break; default: break; } } //change the picture $find("RatingBehavior1")._stars[0].style.backgroundImage ="url(../pic/collapse.jpg)"; }form></body></htm>
Also you can add a independent icon at the front of the rating. Then use javascript and CSS to make it shown as what you expected. In this situation, you
should add some code on the server side to process the independent icon's state.
Hope this help.
Best regards,
Jonathan

Hey, thanks Jonathan.

I'm using visual basic- I can translate every line except the key line:

$find("RatingBehavior1")._stars[0].style.backgroundImage ="url(../pic/collapse.jpg)";
 I can do Page.FindControl("RatingBehavior1"), but then I don't know how to type-cast it properly.


Hi SidewaysFish,

As you can see, it is located inside <script type="text/javascript" language="javascript"></script>. So it's Javascript code you can copy it into your project without any convert working.Of course, you should make some changes to address your requirement. $find("RatingExtender's BehaviorID")._stars[0].style.backgroundImage ="url(../pic/collapse.jpg)";

Best regards,

Jonathan

Different instances of beginRequest & endRequest for different UpdatePanels

Is it possible to assign a different beginRequest function or endRequest function for individual UpdatePanels on a page? It appears that usingSys.WebForms.PageRequestManager.getInstance().add_beginRequest( someFunction ) assign the function to all UpdatePanels on the page.

Thank you

yeah, check this out...

http://dotnetslackers.com/community/blogs/simoneb/archive/2006/11/19/ASP.NET-Ajax-UpdatePanelNotifier_3A00_-get-notified-of-partial-updates.aspx


i have looked into alittle more.

<script type="text/javascript" language="javascript">
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
function BeginRequestHandler(sender, args)
{
var elem = args.get_postBackElement();
//What Triggered The Update
//alert(elem.id);
}
function EndRequestHandler(sender, args)
{
var s = args.get_response().get_responseData().split('|');
//UpdatePanel Triggered
alert(s[2]);
}
</script>


Thanks for the response. So there is currently no 'native' way do do this? Surprising. I'll check out this project.

Thanks again.


Interesting... It still would be nice to have a native way of assigning functions to different panels, but this could certainly be of use in certain circumstances.

Thanks!

different between Asp.net Ajax and old core Ajax

Hi all,what is difference between Asp.net ajax (recent relase ) and old core ajax....plz discuss in detail...thanksSajjad

Hi,

first of all, what do you mean by "old core ajax"? ASP.NET AJAX is a framework that helps ASP.NET 2.0 developers to smoothly integrate AJAX functionality into their projects. There are many of such libraries/frameworks for AJAX available but ASP.NET AJAX is the one that's created by Microsoft.

Grz, Kris.


thanx for replyI mean, simple ajax, which we use with any third party tool.....also can u tell me some other libraries and frame work names for Ajax (specially they support asp.net 1.1)thanks once againsajjad

Hi,

you can also use only the client scripts from the ASP.NET AJAX framework, known as the Microsoft AJAX Library.

Other frameworks are AJAX.NET, Anthem and I believe MagicAJAX's also one of them.

Grz, Kris.


thanx for reply,Please do me a more favour...i have a website which is developed in vs 2003 and i need to use some asp.net ajax feature...here is my complete post regarding this issue...http://forums.asp.net/thread/1584610.aspxplz helpthanks once againsajjad

Well, In my opinion there are different methods for integration ajax functionality in your application. for instance

ManualAJAX = This will be achieve by writing a your own java script whichwill call any xml page from the server and then rendered the result atruntime. In this scenrio you just be limited to getting results bypassing parameters and no doubt It require lots of time to make allthese things done

now lets come to the
Tool Based AJAX = AJAX.net , MajicAjax and Asp.net AJAX are someexample for this. these tools can enhance your productivity, and giveyour application a boost start in integration AJAX.
In my eyes, I see not much different in so called "old core ajax" and in Asp.net AJAX because it both relate to same category.

Cheers

Different behaviour between Atlass DragPanel and Ajaxs

<asp:Panel ID="Panel6" runat="server" Width="100%"> <asp:Panel BorderStyle="Solid" BorderWidth="2px" BorderColor="black" ID="headerPanel" runat="server" Width="100%" Height="20px"> <input type="text" id="iName" readonly="readonly" value="Drag me"/> </asp:Panel> <asp:Panel BorderStyle="Solid" BackColor="#0B3D73" ForeColor="whitesmoke" BorderWidth="2px" BorderColor="black" ID="Panel8" runat="server" Width="100%" CssClass="overflowHidden">Something here </asp:Panel></asp:Panel>

The panel above working fine with Atlas's DragPanel, as I can freely click on anywhere inside the headerPanel to move the Panel6 around, include the area within the "iName" label.

But the problem is when I move to Ajax Asp.NET Beta 2, I can click only on the area of headerPanel in which "iName" is not cover move Panel6 around. When I click iName and move it, nothing happen.

Do you guy have any idea or workaround to fix this? As I need iName as an input to dynamically change the text using Javascript

This is by design perwork item 6429: undraggable elements are "input", "button", "select", "textarea", "label". You're welcome to modify checkCanDrag in FloatingBehavior.js if you'd like to play around with removing this limitation.

difference in creating toString()

I have created a .toString() on a custom object in two ways. Is there a
significant difference between two? they both seem to work. Is there a
reason to do one instead of the other?

This is done within the class definition:

this.toString = function(){
return _Name + " at " + _Address;
}

This is outside of the class def.
ExampleNamespace.cComplexCustomerType.prototype.toString = function(){
return this.getName() + " at " + this.getAddress();
}

--
Wallace B. McClure
"The Harder I Work, the Luckier I Get."
Listen to "The ASP.NET Podcast" at http://www.aspnetpodcast.com/
Database Award: http://url123.com/vc3er
Microsoft MVP - Visual Developer ASP/ASP.NET
AspInsider
"AJAX for ASP.NET" Coming Soon!
ADO.NET Book: http://url123.com/vc2bu
865-693-3004
118 Durwood Rd.
Knoxville, TN 37922
http://www.scalabledevelopment.com/
Blog: http://weblogs.asp.net/wallym/Hi,

everything added through theprototype object is shared between instances. Thus, if you declare the toString() function by expanding prototype, you are sharing the same code, while if you declare the function using thethis pointer, you are duplicating code.

There's nothing wrong in declaring functions using this or prototype, but the thing that must be avoided is pointing to *objects* through prototype, for example arrays.

Consider the following declaration:

function myObject() {
}
myObject.prototype.myArray = new Array('Item1', 'Item2');

Now, create two instances:

var obj1 = new myObject();
var obj2 = new myObject();

Add something to obj1's array:

obj1.myArray.push('Item3_by_obj1');

and finally display the two arrays:

alert(obj1.myArray);
alert(obj2.myArray);

As you can see, both the instances shares the same reference to myArray.

Difference betwwen CTP and beta 1 with GetPostBackEventReference

Hello,

Last week I have create a page with a gridview with textbox in the header row create dynamically.

For each textbox, I had this code in the creating code :

PostBackOptions postBackOptions =new PostBackOptions(oTextBox);
postBackOptions.ClientSubmit =true;
oTextBox.Attributes.Add("onkeyup",string.Format("{0}", ClientScript.GetPostBackEventReference(postBackOptions),oTextBox.ID));

With this code, when I make a keyup in a textbox, the gridview is refresh in "Ajax mode" but now, with the Beta 1, the entire page is postaback.

Can you know why ?

PostBackOptions postBackOptions =new PostBackOptions(oGridView);
postBackOptions.ClientSubmit =true;
oTextBox.Attributes.Add("onkeyup",string.Format("{0}", ClientScript.GetPostBackEventReference(postBackOptions),oTextBox.ID));


hello,

can you show us the code that is not working?


Hi,

I had a similar problem, but after stepping through the new JavaScript libraries, I came to the conclusion that it was because the control passed to the PostBackOption constructor is not itself inside the UpdatePanel.

Moving it inside the UpdatePanel solved the problem.

Hope this helps,

Bo

Difference between using code in a separate file or not

What's the difference about placing the code in the same file as interface and placing it on a separate file for an Atlas application? All documentation samples tell to unmark the option to place code in a separate file.

And how can I call a method in a class or ASP.Net page instead of using a WebService?

I don't believe there's any reason to put the code in the same file versus putting it in a separate file. My guess is that the documentation tells you to do that simply to make the code samples smaller. (I myself tend to do that for examples on my blog so there are fewer files to download or look at.)

As to calling a page method instead of a web service, please seehttp://atlas.asp.net/docs/atlas/doc/services/exposing.aspx#webpage.


hello.

just one more thing: believe me, if you can call a web service, then call it instead of calling a page method.


What are the advantages using a WebService instead of a WebPage, Luis?

Thanks.


hello again.

well, let's suppose that you're sending only a value to the server and want to receive the result of a specific calculation...using a web method will result in sending everything from the client to the server (ie, all the fields that exist on the page are packed on the msg that will be sent to the server); if you use a web service method, only the necessary parameters will be sent to the server...

Difference Between Panel Extender and Accordion

What is the difference between the two other than the accordion can handle more areas to expand? Is it because it actually uses the panel control? I'm trying to think of why I would use one over the other. Thank you for ideas.Hi just_for_forums,

The difference between the CollapsiblePanel and the Accordion is the number of sections you want to have. The Accordion is like a CollapsiblePanel with multiple sections that can have ONLY ONE open at a time. That's pretty much the difference.

Thanks,
Ted

Hello Ted,

I have tried to use Collapsible panel with my page but because of the flickering of the page I will try to use accordion. Does accordion extender support <panel> and <updatepanel> inside its <content> tag>??

Thanks

Difference between Hoverextender andhovermenuextender??

Hi

whats the difference between the hoverextender and hovermenuextender? When would i use one and not the other?

What i want to achieve is this: I havea griview that displays data in each row. I want to be able hover over each row and disply additional notes specific for that rowitem. An d inthat same popup thingy be able to edit and save those notes. Any tips on how to do this or any samples that i am not awre of.

Anyone?
HoverExtender is a simple wrapper that makes it easy to use the HoverBehavior (client-side script for detecting mouse hovers). HoverMenuExtender uses HoverExtender and adds support for displaying UI when the hover happens. HME is more of a usable control while HE is more of a building block.
thanks

Difference between ClientSide Callback and Atlas

what is the difference between ClientSide Callback feature in ASP.NET 2.0 and Atlas.

regards

Hi,

Both are functinally same.

Microsoft has designed Gridview for having this as a implicit feature. as its a very complex control. So you can say that every grid is Ajax enabled.

When you use Atlas grid view behave same.

But important difference to note that, when you use clientscriptcallback, you can not use template columns.

But same can be done in Atlas.

So gridview is partially callbacks enabled.

So both are different

Difference between Callback and Webmethod

Hi,

What's the difference between using a callback event handler and a method defined as a WebMethod? One major difference I see is that a callback event involves some aspects of the page lifecycle. When is one advisable to be used over the other?

Thanks.

Hi,

On client side, the difference isn't very big. Both of them will use xmlHttpRequest to send to request to the server.

But it's different on server side. When work with callback, a new instance of the page is created to server the request, and a corresponding method defined in it will be fired. While with web method, no instance of page will be created, instead, an instance of the web service is created.

The latter one is a light-weighted way.

Difference between atlas and ASP.NET AJAX

What are the Difference between atlas and ASP.NET AJAX.

When MS first started working with thier AJAX library its official name was ATLAS which was split and changed to MS AJAX library and ASP.NET 2.0 AJAX extensions.

they said that the client side Functionality of ATLAS is going to be MS Ajax LIbrary and the Server side functionlity is going to be ASP.NET AJAX 2.0 exentions which is highly compatibale with ASP.NET 2.0.

for more info:

http://ajaxian.com/archives/atlas-becomes-microsoft-ajax-library-and-aspnet-20-ajax-extensions

thanks


I have found another link:

http://petesbloggerama.blogspot.com/2006/09/atlas-vs-ajax-who-won.html

thanks


thanks for reply..

if we apply ajax in existing web page ,what are the main changes ..

is there any changes in code behind?only change in html ie putting panel in it..

all events of control which is inside the panel have all ajax functionality ...

thanks


Well MS has made it quite simple for users, but in the background when you run the page check out the source of the page at run time you will see many javascript functions added to the page.

beside of it you are not limited to place content in UpdatePanel only but there are many properties,methods and Triggers that you can use.

thanks


if we add a datagrid inside update panel,inside trigger we specify only event sort...

when we click to view next page .. is postback occur or not?

is it necessary to specify all events in trigger tag..

thanks


hello.

if the control is inside an updatepanel, then you don't need to set up triggers. you only need a trigger when you want to have a partial postback and the control is outside the updatepanel.

Difference between Asynchronous calls and Callback calls

Can any1 tell me Difference Asynchronous calls and Callbacks

With reagrds,

Mahender

Hi Mahender,

Usually, asynchronous call is referred as invoking a method on another thread without blocking current working thread. You'll see it being used in calling WebService, I/O operations, etc. In AJAX, it's usually implemented with request for a resource via XmlHttpRequest, it's the essential of AJAX.

Callback is executable code that is passed as an argument to other code, or we can call itMethod Pointer. It enables the other code to call the executable code via the pointer.

Hope this helps.

Difference between ASP.NET Website and ASP.NET Ajax-enabled Website

What are the differences between creating a standard ASP.NET Website and a 'special' ASP.NET AJAX-enabled website?

What are the differences VS.NET 2005 does behind the scenes?

The "ASP.Net Website" creates a default web site to create webb apps. the "ASP.Net Ajax-enabled website" will use another template and create a "normal" web site but with the required settings in web.config that is needed and a Web Form that already have the scriptmanager on the page (ScriptManager is the control that kind of "handles" all the Ajax fetures on the page) and a reference to the ASP.Net Ajax assembly.

VS 2005 don't do anything spec behind the scenes, more than using different templates that I describe above.

Difference between <asp:scriptmanager>and <<ajaxToolkit:ScriptManager>

I m new to using the AJAX features please help me to solve my problem.

I want to use AJAX features in myASP.NET with C# website application 2005.

For that i have already installed the following onto my pc.

ASP.NET 2.0 AJAX Extensions 1.0ASP.NET AJAX Futures January CTPASP.NET AJAX Control Toolkit.
In the toolbox on left-side i get the following tab control
AJAX Extensions(after i installed the above tools).

In that i got the ScriptManager Control on the form by selecting the

    File --> New --> Website -->ASP.Net Ajax-Enabled websiteFile --> New --> Website -->ASP.Net Ajax CTP-Enabled website
which are in the visual studio installed templates ......

First of all,i want to know is this installation complete to use the features of AJAX in asp.net 2005 ??And also want to clear whether to work onASP.Net Ajax-Enabled website orASP.Net Ajax CTP-Enabled website for creating the project (what's difference)??I m going to create the master page and the contents page..
When i drag and drop the scriptmanager from
AJAXEXTENSIONS

<asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>
instead of
 <ajaxToolkit:ScriptManager ID="Script1" runat="server"></ajaxToolkit:ScriptManager>   
what should be used ??
What the difference...Also let me know why i m not gettin the proper inline code...Pls help now...i m not getting any idea...

Please can anyone help me to solve this problem


Waiting for some response...

The latest release is ASP.NET AJAX 1.0. With this you should have

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
instead of
 <ajaxToolkit:ScriptManager ID="Script1" runat="server"></ajaxToolkit:ScriptManager>
which is correct. And you'd want to work with"ASP.Net Ajax-Enabled website". The CTP version is a preview of future releases
You should get answers to any other questions you may have here:http://ajax.asp.net/default.aspx?tabid=47

Difference between $find and $get Methods in AJAX.NET Framework?

Hi All,

Can anybody help me understand the difference between $find and $get methods in AJAX.NET framework.

I was surfing through the samples of AJAX Toolkit Samples.


Hi,

$get is used to get a reference to a DOM element. It is an alias for Sys.UI.DomElement.getElementById:

<span id="myLabel"></span>

var myLabel = $get('myLabel');

$find is an alias for Sys.Application.findComponent() and it's used to get a reference to a particular component, given its id.


Hi Garbin,

In the sample application for AJAX Toolkit we have an example for Accordion. I am extracting the following code snippet from file -

 function toggleFade() { var behavior = $find('ctl00_ContentPlaceHolder1_MyAccordion_AccordionExtender'); if (behavior) { behavior.set_FadeTransitions(!behavior.get_FadeTransitions()); } } function changeAutoSize() { var behavior = $find('ctl00_ContentPlaceHolder1_MyAccordion_AccordionExtender'); var ctrl = $get('autosize'); if (behavior) { var size = 'None'; switch (ctrl.selectedIndex) { case 0 : behavior.get_element().style.height = 'auto'; size = AjaxControlToolkit.AutoSize.None; break; case 1 : behavior.get_element().style.height = '400px'; size = AjaxControlToolkit.AutoSize.Fill; break; case 2 : behavior.get_element().style.height = '400px'; size = AjaxControlToolkit.AutoSize.Limit; break; } behavior.set_AutoSize(size); } if (document.focus) { document.focus(); } }

Here I think 'ctl00_ContentPlaceHolder1_MyAccordion_AccordionExtender' is used as client Id for the MyAccorion control inside the Content Place Holder.

If I do the same without a content place holder and in different file I get a null reference.

I entered the server side Id for the $find method.


The answer is as always in C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025\ScriptLibrary\Debug\MicrosoftAjax.js and thedocs (vaguely).

$get wraps document.getByElementId ++

$find is like FindControl (I think). It seems to walk up containers to find aSys.Component


Docs on $find (findComponent)

Docs on $get (getElementById)



Great, I could get the meaning of it

Thanks a LotChristopher and Gabriel

difference b/w Postbacktrigger & Asycpostbacktirgger in AJAX Panel ?

hi all, what is the difference b/w Postbacktrigger & Asycpostbacktirgger in AJAX Panel ?

PostBackTrigger forces full (regular) postback by contol inside an update panel with ChildrenAsTriggers == true.

AsyncPostBackTrigger makes control to initiate async (partial rendering) postabck.

-yuriy

Did I miss something during installation of AJAX 1.0v?

Hi everyone;

I'm using VS2005 and I've just installed AJAX and it works but in the source view it underlines Script Manager, UpdatePanel, contenttemplate and controls under contenttemplate. I guess I missed something that I don't know:) My simple page code is belove:

Thanks... Kaan ?ZGEN

<%

@dotnet.itags.org.PageLanguage="VB"MasterPageFile="~/Copy of Turuncu.master"AutoEventWireup="false"CodeFile="DNM2.aspx.vb"Inherits="DNM2"title="Untitled Page" %>

<%

@dotnet.itags.org.RegisterSrc="Menu.ascx"TagName="Menu"TagPrefix="uc1" %>

<

asp:ContentID="Content1"ContentPlaceHolderID="ContentPlaceHolder1"Runat="Server"><asp:ScriptManagerid="ScriptManager1"runat="server"/>

<asp:UpdatePanelid="UpdatePanel1"runat="server"UpdateMode="Conditional"><contenttemplate><asp:Labelid="Label1"runat="server"Text="Label"></asp:Label><asp:Buttonid="Button1"runat="server"Text="Button"></asp:Button></contenttemplate></asp:UpdatePanel> <asp:LabelID="Label2"runat="server"Text="Label"></asp:Label><asp:LoginID="Login1"runat="server"></asp:Login><uc1:MenuID="Menu1"runat="server"/>

</

asp:Content>Have you installed SP1 for VS 2005? That can happen if you haven't.

Is there such service pack?? Thanks I didn't know it... :) I'll try and let you know if solved..

Kaan ?ZGEN


Hi mdenn;

Yes that was the problem; now because of you (sayende) I got SP1 and my problem is solved

Thanks..

Kaan ?ZGEN

Did Features Get Fixed In RC?

I loved ASP.NET Ajax back when it was "Atlas", but I haven't used it much since. There were a few things that really bothered me about the framework, however, and I'm wondering if things have changed.

In particular:

1. Is there a concept of an "event" in the client script library for the built-in features (like are there events like "DragStart" for the drag/drop functionality for example).
2. Does ASP.NET Ajax still require the SciptManager/ScriptManagerProxy malarky? I was hoping there would be a SciptManagerSettings control and that Atlas controls automatically registered a ScriptManager "singleton" (per page request) when they're loaded (the idea being you don't have to mess with the clumsiness of worrying about whether the ScriptManager already exists somewhere a MasterPage/Page/base class).

This post from Scott Guthrie tells you exatly the bug fixes and new improvements:

http://weblogs.asp.net/scottgu/archive/2006/10/20/ASP.NET-AJAX-Beta-1-Released.aspx

Dial-up accounts using AJAX

I don't know if there is an answer to my question, but here goes:

I have an Ajax page that uses an ASP.Net 2.0 GridView control. When I test the page on my development computer (where the server is the local host) it takes about 15 seconds to load. Several portions of the page are configured for partial page updates using Ajax and these updates take between 2 to 4 seconds which is acceptable.

When I test the same page on a remote server using a dial-up account, the page takes about 35 seconds to load. OK, that's to be expected. But what I did NOT expect was that the partial page updates also take 35 seconds. It's as though all of the savings using partial page rendering have been dissipated.

Is there any reason why a dial-up account has this behaivor and is there anything I can do about it? Thanks for any suggestions.

Ken McLean


hi,

Are you sure you are not doing a complete post back..

Please see if you have set Async="true" in the <%@. Page %> directive of your aspx page.

Thanks

Ruk


Ruk,

Thanks for your quick reply. Yes, I have set Async to "true" in my page directive. It does not seem to make much diffeence whether I include it or not.

I think the delay is caused by a drop-down list on my page which has 2300 entries. When I cut the list to 750, the response time for a partial update was reduced from about 35 seconds to 17 seconds on a dial-up account. If I eliminate the control the response time is cut to a few seconds. It seems that the server is re-loading the complete data for the drop-down control with each partial update. I thought that with AJAX, the data for controls outside the UpDate panels would not have to be re-transmitted but in my case apparently they are. Is there anyway I can stop the drop-down control from being refreshed with each partial update? Thanks for any suggestions.

Ken McLean


Hi Ken,

I have used ajax for partial updates. It has worked for me. If you could post your code I should be able to help you more.


Thanks

Ruk


Ruk,

I wrote a simple test program to demonstrate the problem. It consists of a drop-down list with a lot of dummy data and an AJAX update panel triggered by a button. When the button is clicked, the label inside the Update panel displays the current time. If you replicate this program and run it you will see there is a several second delay before the update panel renders the new time. You can see the amount of time by clicking the button immediatly after a partial update is rendered. Moreover, the delay is proportional to the amount of data in the drop-down list. If you double the number of items in the list the delay for the partial update is also doubled. This implies that the server is retransmitting all of the data for the drop-down list with each partial update. This does not seem consistent with what I have read about AJAX. Is there some setting I am missing that will stop the server from re-transmitting all of the data for the page on a partial update?

Here is the code behind language for the page load event:

ProtectedSub Page_Load(ByVal senderAsObject,ByVal eAs System.EventArgs)HandlesMe.Load
IfNotMe.IsPostBackThen
For jAsInteger = 0To 20000
Me.DropDownList1.Items.Add("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
Next
EndIf
EndSub

Here is the page mark-up:

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server">
<title>Untitled Page</title>
</head>
<body>
<formid="form1"runat="server">
<div>
<asp:ScriptManagerID="ScriptManager1"runat="server"></asp:ScriptManager>
<asp:DropDownListID="DropDownList1"runat="server">
</asp:DropDownList
<asp:UpdatePanelID="UpdatePanel1"runat="server"UpdateMode="Conditional">
<ContentTemplate>
<asp:LabelID="Label1"runat="server"></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTriggerControlID="Button1"EventName="Click"/>
</Triggers>
</asp:UpdatePanel>
<asp:ButtonID="Button1"runat="server"Text="Button"/><br/>
</div>
</form>
</body>
</html>

Thanks for any suggestions.

Ken McLean


When I run the debugger on my site, it runs Page_Load on partial updates. I'm not sure if things outside the updatepanel gets sent back, so if you fill the "dummy data" in another method (not Page_Load), or have the dropdown outside the updatepanel, it might help.


Hi Ken,

You are correct the page does get reloaded. But I think I found the reason for the issue (not the solution :( ). If you check the javascript errors in your browser you will notice that there is an error saying "sys is not defined".

I am using the update panel in another web application. Which I did some time back. But when I run that I didn't get that javascript error. I couldn't figure out why this javascript error is appearing given that your code and what I have done earlier is almost the same.

I'll try again in my free time.

Hope this gives you some idea about the problem.

Thanks

Ruk


Ken, try disabling viewstate temporarily to see if it resolves your performance issues... my guess is that you just have a very large viewstate, and even async postbacks transmit the entire viewstate back and forth.

Ruk, if you're seeing "sys is undefined", check out this blog post by Chris Riccio for some troubleshooting steps:http://weblogs.asp.net/chrisri/archive/2007/02/02/demystifying-sys-is-undefined.aspx.


Thanks Steve..

DHTML Tree

H All

I wanna to create an DHTMLTree without an Ajax just HTML and JavaScript

I wish to help me

Thanks

I did this long back. We basically need to create 4 div tags & do the css tweaks inside...checkout these links...

http://www.spacedust.com/scripts/rounded_table/

http://kalsey.com/2003/07/rounded_corners_in_css/

http://www.webdevelopersnotes.com/tips/html/html_table_tutorial_rounded_corners.php3

HTH

Cheers

Vishal Khanna

(pls mark as answer if reply helps)


You can use the RoundedCorners control found in the AJAX Control Toolkit, check out the demo:http://www.asp.net/AJAX/AjaxControlToolkit/Samples/RoundedCorners/RoundedCorners.aspx

Also check out http://www.cssplay.co.uk/boxes/four_cornered.html andhttp://www.html.it/articoli/niftycube/index.html

-Damien


Thank you for your help but I need a way to make a text box have a rounded corner by using HTML or JavaScript .

All of the solution you post applied on the div only.

Smile


Thank you for your help but I need a way to make a text box have a rounded corner by using HTML or JavaScript .

All of the solution you post applied on the div only.

Smile


You can't round a input / textbox, but you can "trick" it. Here's one effect:http://www.webxpert.ro/andrei/2006/10/20/rounded-border-textbox-ii/ and here's anotherhttp://pupungbp.erastica.com/css/rounded-corner-input-form/

Another is to use the DIV approach and make your textbox inside it match by blanking out all the styles of the textbox (e.g. transparent background, no border, etc).

-Damien


Hi all

I wann a javascript code to discovor the div Scroll bar is end on noe yet

Pls Help Me


I wanaa to ask How I can detect the scrol bar in div if it end or not

Thanks


You can usescrollTop andscrollHeight, if the two are equal, you are at the end.

-Damien


I was try this but the scrollTop and scrollHeight ar not the same when the scroll in the end

Adawi


HI

I wanna to check if mouse button is clicked continuasly on table <td>

can U help me

Development with Atlas. Should we work with beta, or incorporate later

We're going to be developing all our new applications with Atlas, but my bosses are concerned because it's in beta, and not fully released.

Which would be the best option for developing. My bosses would like us to develope our applications as if there were no atlas, but when it's release we could implement it.

I'm against this because we will have to chuck out so much code to use atlas fully. (I don't want to just stick updatepanels everywhere).

Any thoughts / arguments that can be used to help persuade? How much will atlas change before it is released?

Thanks.

Atlas is still under development, so it is likely some thing will change from refresh to refresh. Ajax is also still somewhat on the bleeding edge right now. :-)

I think the core concetps of updatepanel are fairly baked right now, though, so while there will probably be additions in functionality I don't think the model of existing features will change.

Hope this helps,

Scott


The reason I ask, is about time. I could spend 2 weeks designing an application before we start coding. Each page will be build using "standard" features of ASP.NET 2.0. However, with Atlas, I'd change how I design these pages entirely. I'd be using a more client-centric approach, to improve efficiency and overall speed.

Development Strategy

I'm already using homegrown callbacks in my app, it's a great feature, and so I'm happy to see that Atlas is coming along so well.

My challenge is that I've got limited development resources (me and mine) and a limited window of opportunity to get my app to market. So I'm probably going to continue to test Atlas, and wait to put it into the app later in the development cycle, depending on how strong it looks at the time.

My question is, though, is there anything about the use of Atlas that I need to consider in terms of writing the app in the first place? More specifically, I recognize the "no screen flash" and other possible effects as seen by the user...that's why I started using callbacks to begin with. And I appreciate that there are probably ways to "optimize" the way the code is written to maximize the benefits of Atlas. However, I can't afford to do that now because of the risk that Atlas interfaces or behaviors will change at the last minute, and throw off my development schedule.

So the crux of the question is, is it safe to assume I can write my ASP.NET app without specific consideration of Atlas, and then drop Atlas elements (notably update panels) into it at the last minute, and for the most part "get away with it", i.e., not be stuck with a lot of changes required to make the app "Atlas" compatible?

Hope this makes sense, and would appreciate any guidance on it.

Thanks!

One advice is to make use of good HTML coding practice, such that when you integrate Atlas into the webpage, you don't get into a confusion yourself. Try to avoid using having too many layers of z-index. z-index:1 to z-index:3 should be enough for most scenarios.

I once working on a project, which requires me to atlacise a existing page with many bad HTML and CSS coding. The result was I end up re-writing the HTML elements and dragging in the ASP Controls one at a time as a attempt to clean up the attrocious HTML which the previous developer wrote. After the HTML is cleaned up, it took me just 10 minutes to atlacise the entire site.


hello.

hum...well, i'd say that with the updatepanel it's really easy (almost too easy, if there's such a thing as too easy) to transform an aspx page intro an atlas pages. if you want to use the full power of atlas, then you'll really need to decide on several things - ex.: how to update a record on a db? use a traditional page or use only client side HTML and perform the update of the record through a web service? you'll probably drop the updatepanels in many scenarios (specially if you're looking for a perfomance)


THanks Luis for sharing. Update panel actually affects performance? How much performance advantage would you get if you update directly via a webservice? Are there any advices when to use an update panel and when not to? It seems that most using the Atlas framework would make use of the UpdatePanel .

hello.

well, what i say is that if you're buildning a new app and want to use atlas, you probably should start by looking at the client side of atlas before using the updatepanel. i really think that the updatepanel is great when you just need to enable atlas on an existing aspx page. however, i also think that its usage is only justified when you are using a server side approach. and when you use it, you should also keep in mind that a partial postback results in the sending of all the fields maintained in the form (which might not be what you want when you need to perform a simple server side operation).


Thanks for inputs. The anectdotal experience reports and cautioning comments are great for providing "view ports" into this technical area.

I'm concluding that waiting to add update panels to well-formed pages is a relatively low risk approach. I'm sure I'll be testing Atlas along the way, as well.

Agradecimento!