Showing posts with label control. Show all posts
Showing posts with label control. Show all posts

Wednesday, March 28, 2012

asp.net ajax refresh the UpdatePanel every 30 sec?

I am currently using Timer control inside my update panel to update automatically every 30 sec. However i wanted to use json to do the same thing.

Any suggestions?

Thanks

Hi,

JSON (JavaScript Object Notation) is a lightweight data-interchange format, or it can be viewed as a protocal defining how object is serialized when transporting.

It can't be used to perform actions at a certain interval like Timer.

Please refer to this for more information:http://msdn2.microsoft.com/en-us/library/bb299886.aspx

Hope this helps.

Asp.net ajax in Custom Control

I'm beginner in asp.net ajax.

Now I have to writecustom control and apply machanismpartial updating(which can be applied for User Control)

Could I can applyasp.net ajax forCustom Controlor not , and how to do this ?

Thanks a lot !

Thank you very much !

In fack UpdatePanel can be added to Custom Control !

But I have one problem more !

For creating Custom Control Im using the command in Console

csc /t:library /out:MGR.dll /r:System.dll /r:System.Web.dllMGR.cs

MGR is the name of Custom Control class

after compiling I got the error "the type or namespace name 'UpdataPanel' could not be found (are you missing directive or an assembly referrence?)"

I modified the command to

csc /t:library /out:MGR.dll /r:System.dll /r:System.Web.dll /r:Microsoft.Web.Atlas.dll MGR.cs

but got the same error !

I don't know why ? do you know why this error occured ?

HTD


I dont know exactly what your control will be doing, but all you should need to do is design the whole control in an asp.net ajax update panel.


My goal is "Partial Updating" in Control(which include TextBox and GridView). How you can add Update Panel in Custom Control ??

(In User Control, it's easy to do )


Open your Control.ascx file.

Drag and drop a update panel on to your page.

Select everything but the update panel.

Drag and drop your selection into the update panel.

That's everything you need to do to set up the control.

Anytime you use your control in your application, make sure you have the "Script Manager" Ajax extension on that page.


My deverloping Control is Custom Control, it's not User Control !

HTD


You should b eable to add it like any other control... ?

UpdatePanel panel = new UpdatePanel();

etc.


you can add a custom control class to a updatepanel like this

myControl ctrl =new MyControl();UpdatePanel1.ContentTemplateContainer.Controls.Add(ctrl);

Asp.net Ajax Enabled web app creating more ScriptResource.axd on a Simple page

Hello,

I am using Asp.net Ajax extension 1.0.In my application ,I am using a index.aspx page,which have no script manager control.When i am runing this application the the index page is loading very slow.When I save the page from browser I am finding six ScriptResource.axd files are loading on client side.Which have up to 400 kb.So I want to reduce these files on index page.But I do not know how I do it.Please help me.

Regards,

Pawan

Hi Pawan,

Basically, those scripts won't be requested if there is no AJAX related controls on the form.
If you are using MasterPage and there is ScriptManager on it, they will be downloaded too.

Hope this helps.

Hello Raymond Wen,

Thanks for reply.

I am using asp.net ajax enable website1.0.I have noticed that ScriptResource.axd is uploaded each time when I am navigate the site.On each page ScriptResource.axd is again loading.I want to cache ScriptResource.axd on Client Side.If you have any idea about it then please help me. Thanks & Regards, Pawan


Please try the following:

1. Set debug to false in web.config

2. Set ScriptMode property of the ScriptManager to release


These should be cached on the client as long as you have <Compilation Debug="false" /> in your web.config.

Monday, March 26, 2012

ASP.NET Ajax Control Toolkit in different browsers

This toolkit seems to be incredible, better than a lot of packaeg offered (charged) by 3rd providers. I am only concerned all these controls will behave accordingly in any browser chosen, from IE 6, 7 to Firefox. Has anyone done tests, or used them in production?

I have tested most of the controls, and use them in my production environment, with many browsers (FF 1.5(OSX, Windows), FF2(OSX, Windows), IE 6, IE 7, Opera 9(OSX, Windows), Safari (OSX)). They all worked fine. Microsoft has gone through alot of trouble to see that they do. :)


This is nice to hear, if you dont mind, a nice list table with the results of your findings with respect to the various browsers.

I am working on creating webparts ( custom composite controls , DLLS , what ever you call them) to use AJAX.NET extensions and the "unsupported" Ajax.NET ControlToolkit and I must say the behaviour is NOT as rosy as it may be when using the controls in the WYSIWYG drop-n-drop way of the VS designer.

behaviour varies from IE6 to IE7, even on mozilla


You talked about "drag & drop′", considering u r working with webparts. Actually I know there is one of the toolkit components that is able to be dragged, the others AFAIK are not able to such a task. So as for this problem you mentioned, you were referring particularly to this case with webparts ?


Hi,

When developing webparts as custom composite or server controls, drag-n-drop is not an option as the WYSIWYG editors such as VS2k3 or WS2K5.

And yes, I am referring specifically to WebParts using ASP.NET 2.0 WebParts class and also using AJAX.NET extensions and AJAXControlToolkit extenders etc.

To be clear i am talking about the behaviour of coded webparts ( not user controls such as ASCX stuck into a webpart zone) such as overriding CreateChildControls and RenderContents or Render where the layout and lifecycle of the objects are different when laying out objects on an ASP.NET webpage or webpartpage.

Anyways, its an uphill battle. Right now I want the AlwaysVisibleControl Extender ( if thats the "correct" name) to work properly in a custom ajaxified webpart (DLL). This is where the browse side problem appears.

This is why I createdhttp://forums.asp.net/t/1128326.aspx a while back with no feedback from anyone. Oh well, i will figure it out eventually.

ASP.NET AJAX Control Toolkit & UpdatePanel

All seems to me that ASP.NET AJAX Control Toolkit has a builtin feature that is able to deal by itself with all Ajax issues. That said, then wouldnt we need to use UpdatePanel anymore, since all these controls know how to deal with Ajax?

it is true that the control toolkit controls can update properly on their own. Like how you can use a calendar extender without needing it to be in a update panel with a textbox, they can both just be on the form. I still tend to user panels though simply because it helps me group sets of controls and visually makes it easy to see what kind of results i should expect when i know what controls are bound to what area on the screen. Using update panels has never cause me any extra problems so i stick with it


My fear is to make things redundant, and worse, degrade performance, since there would be 2 types of ajax treatment. One, dealt by UpdatePanel, and the other dealt by the control itself...

if you have you page up and running no problem without the use of update panels, then there is no need for them. It really comes down to how you have stuff set up I guess. I have pages with a lot of dynamically created controls like tables that are all updated individually (for when users edit them). And some of the editing features might include a calendar extender, so I would include that extender inside of the update panel that my table is in to group the controls because the interact with each other. But like i said, if your pages are set up in way that they work without update panels, then no worries :)

ASP.NET Ajax Control Toolkit - Firewall blocking TabContainer

Hey there,

First thing's first - if this is posted in the wrong forum, I apologize. Next...

I've got an ASP.NET AJAX application developed with VS 2008 Beta 2, using the 3.5 version of the Ajax Control Toolkit - when deploying it to our web server, something interesting happens. If I access the site through a machine on the same network as the web server, it renders fine. However, if I access it from another network, or through the internet, the TabContainer is not rendering.

I checked out the reason why, and it appears that our firewall is blocking the client's ability to download the WebResource.axd file associates with the Ajax Control Toolkit - what else is interesting is that I'm also using FreeTexBox on this page (which downloads a seperate WebResource.axd file, and can access it without any problem).

If anyone has any suggestions, or has run into this problem in the past, please let me know. Thank you!

Anthony

32 views and no responses?

Wow...either I didn't explain it well enough, or nobody's run in to this.

Can anyone let me know which is the case?

Thanks.


Well, if you want comments, here is mine.. I always read anything related to the tabs since I use them a lot...

But sorry, never run into this, works fine on my laptop and the corporate machines (that have high security)... And firefox, ie 6-7...

- Have you tried with another machine, that is not on same network as webserver + where you can test different firewalls/settings?

- Also, are you sure the tabs are to blame? Is everything on your web app from the same domain?

It could be so many different things...Tongue Tied


Yeah I had a similar issue. We use an Aventail product (now SonicWall I believe) to allow users to login securely to our network over the net. It was configured in a way that was stopping that WebResource.axd file from being downloaded.

It seems that the issue is with your firewall. If it is blocking the file then there is little you can do. We configure our firewall\Aventail product to be a little less stringent so that the file is now downloaded and the asp.net ajax apps work fairly well. There are still other issues.

So I think you need to talk to your Network Admin people...?


Hi Anthony,

Why not use a debugging tool such as Web Development Helper,Fiddler and Firebug(used on Firefox) etc? They will help you on detecting all the downloaded items.

Best regards,

Jonathan


Jonathan Shen – MSFT:

Hi Anthony,

Why not use a debugging tool such as Web Development Helper,Fiddler and Firebug(used on Firefox) etc? They will help you on detecting all the downloaded items.

Best regards,

Jonathan

Thanks for the suggestion - that's the point of my query, however. I do in fact know that the file is not being downloaded, I'm just trying to determine what changed between the AJAX Toolkit for VS2005 and the toolkit that's compatible with 3.5 (VS 2008) that's causing it to be filtered by our firewall. It seems odd to me that it would work with a prior release, yet not with the new version.


After some more debugging, I think I may have determined the reason why the ScriptResource.axd files are not being downloaded - it appears that they are using a Content-Type of application/javascript, where WebResource.axd (downloaded without any problems) uses Content-Type application/x-javascript.

Additionally, I checked older projects built on VS 2005 .NET 3.0, and the ScriptResource.axd files there use Content-Type text/javascript.

So the question then becomes: Why in the world was the Content-Type changed to something which isn't successfully downloading?

Thoughts?


Alright, for anyone who searches this post in the future, here's the solution that we just implemented and tested:

First of all, we checked the content type of the files that weren't coming through to the client when it was posted to the web using Fiddler2 (http://www.fiddlertool.com/fiddler/).

When we checked the remote site, Fiddler showed that the files were forbidden. I checked it through localhost to see that the Content-Type was application/javascript.

Then, we checked our firewall. We had both application/x-javascript, and text/javascript, but no application/javascript!

We updated the configuration file for the firewall to include application/javascript content-types, uploaded it, and tested the site again - Voila, the Ajax Control Toolkit now works with Visual Studio 2008 and the 3.5 framework.

Thanks everyone for their help with this, much appreciated.

ASP.NET AJAX Callbacks in Server Control

I have been heavy into doing AJAX control development. The one thing that I can't seem to find any information about is callbacks in an ASP.NET AJAX Server Control. In terms of "callbacks" I've found:

ICallbackEventHandler - Pre- ASP.NET AJAX technology, although is used in AJAX controls (e.g. the AJAX Control Toolkit's Rating control)

Web Services - Is an issue since the service isn't part of the control. I don't want to have to include an asmx page in an app that uses my control; plus it really doesn't make sense

Am I missing something? Is ICallbackEventHandler the correct way to handle callbacks in an AJAX control? Is there something new in .NET 3.5 that will take it's place?

-Damien

hello.

well, i think there really isn't anything new here.if you're just trying to run some server logic associated with a control, then ICallbackEventhandler is the way to go.

ASP.NET AJAX and Image Problem

Hi all.

I am using AJAX Tab Control to display a grid view in one tab and an IMAGE in another tab.

The image is created within the program and saved to "images" folder using Serve.MapPath.

Everytime the TAB index is changed, I do postback and call the code to create IMAGE. The image displays the value of dropdown box.

When I click the IMAGE TAB for the first time it is displaying the value of dropdown box correctly. But when I select another value and click the IMAGE TAB again it is not updating the image... it still shows the old image. But I am sure that the IMAGE is updated with new value (i can open the image from "images" folder manually and see the new value).

I am also sure that the page is posted back and new image is created (debugging revelas this).Even I change the tabs and come back to the image tab, it still shows old image..even thought the ImageUrl is pointing to the new (updated) image.

But when i press F5 (refresh) it is displaying the updated image with new value.

Can anyone help me solve this ? I dont want the user to press F5 everytime they select new value from dropdown box. I want the user to select new value and then press the TAB and display the new Image.

Thanks,

Chandra

Use this. it will work.

i think the cached output shown everytime.

to clear it, add the following code in the code behind.

Response.Expires = 0;

Response.Cache.SetNoStore();

Response.AppendHeader("Pragma","no-cache");

it will work.


Hi

Thanks for the reply. I have another problem! it works well in FIREFOX but not in IE!!

how can I solve this browser issues ?

Chandra.


Add the following line on top of the Page_Load event handler and your ASP.NET page will not be cached in the users browsers:

Response.Cache.SetCacheability(HttpCacheability.NoCache)

it will work.

Asp.net Ajax Accordion SelectedIndex Event

Hello. Im trying to catch the selected index property of an accordion control and then store it into a session variable that I can then load later on in my application. Anyone have any suggestions on how to make this happen...Thanks in advance.

Here you go. On postback, just grab the value of the textbox and assign it to a session variable. Some of the javascript is for dealing with finding form objects when using a master file.

/*** Code Behind ***/
for (int i = 0; i < YourAccordionName.Panes.Count; i++)
{
YourAccordionName.Panes[i].HeaderContainer.Attributes.Add("onclick", "AssignIndex(" + i.ToString() + ")");
}

/*** Source View ***/
<asp:TextBox
ID="txtAccordionSelectedIndex"
runat="server"
style="background-color:#FFFFFF; color:#FFFFFF; border:solid 0px #FFFFFF"
Text="-1" />

<script language="JavaScript">
<!--
function AssignIndex(val)
{
document.forms[0].<%= txtAccordionSelectedIndex.UniqueID%>.value = val;
}
//-->
</script>

Hope that helps.

asp.net ajax 2.0 beta 2 error

hi..

i am using asp.net ajax 2.0 beta 2, with scriptManager with any ajax control in the control tool kit, and i get this error:

Sys.WebForms.PageRequestManager._initialize(

'ScriptManager1', document.getElementById('form1'));

'sys' is undefined.

when i get back and use atlas dll, instead of Microsoft.Web.Extensions dll, everything is ok...

why is that?

Hi ya,

I had similar problem two weeks ago. It was that my web site was not properly migrated to an ajax enabled web site. You need to modify your web config to be able to migrate it properly.

http://ajax.asp.net/files/Migration_Guide.doc

here is a document how you should do that.

Cheerz,

Yani

Asp.Net ajax 1.0 Paging control

Is there any control in ajax tool kit which can be used for paging?

i dont want to post back the page to get the next page of records.

Today a video was published that addresses this very topic. I hope it helps you.

How Do I: Implement the AJAX Paging Pattern?


thanks man..

nice to hear from you...No 1 in the hall of fame listParty!!! CONGRATS

ASP.NET AJAX 1.0 Beta - Unable to use asp:ScriptManager in Control Toolkit and samples

Hi All,

I have uninstalled all the ATLAS related things using “Add or Remove Programs” and installed ASP.NET AJAX 1.0 Beta in the following way

Step 1 – Download and installed ASP.NET AJAX 1.0 Beta

Step 2 – Download and installed ASP.NET AJAX CTP

Step 3 – Download the ASP.NET AJAX Samples

Step 4 – Download the ASP.NET AJAX Control Toolkit

Now I can create new websites but I am unable to run the Samples and Control tool kit samples. I am getting JavaScript errors 'Sys' is undefined, Expected '}' etc.

I have even tried changing asp:ScriptManager to aspatlas:ScriptManager as mentioned in some blogs

Anyone facing such problems ?

Did you build the toolkit solution? I think by default when you download the source that you have to before you run the samples as the bin folder of the sample website does not have the toolkit dll...


Thanks Jodywbcb for your quick reply.

I have build the solution before running the toolkit. Also for the sample applications (Contacts, SimpleList and TaskList) I have copied Microsoft.Web.Preview.dll from the ASP.NET AJAX CTP installation directory (%Program Files%\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025\) to the Bin directory of each sample application.

None of the samples are working in my system. But I can run the tool kit fromhttp://ajax.asp.net/ajaxtoolkit/ in my system.

I also tried reinstalling, restarting etc... No hope...


No problem... Can you post a a screenshot or capture of the error message you are recieving?

Sounds to me like for whatever reasons you are not able to GAC the Microsoft.Web.Extensions.dll for whatever reasons .. if you have the preview then you should have that dll ( its in the same folder you copied the preview stuff from btw if not revisit the Ajax announcement page and do step 1...). So try copying the dll I listed to the AjaxControlToolkit\SampleWebSite\Bin - it will search for it there if not in the GAC and let me know if you have any issues from that point. If you are installing the kit on a laptop / desktop that actually does set restriction that may be the cause - but copying the dll to you bin should allow it to run as there is nothing explicitly documented with this release that it needs to be GACed...


Error is 'Sys' is Undefined, 'Type' is Undefined, Expected '}'. Also I am unable to use intellisense in VS 2005 forasp:ScriptManager and other ajax elements. The error is "Element ScriptManager is not a known element"

Microsoft.Web.Extensions.dll is already there in GAC. Even after coping it to the BIN folder error exists.


Ref:My blog and see if anything helps you - the toolkit example does work as intended if everything is properly installed but there are workarounds...

I have tried running toolkit samples in 3 different systems and got the following observations

1. I have copied the AjaxControlToolkit folder to all the 3 systems and installed Microsoft.Web.Extensions.dll in GAC

2. I can successfully build and run the application using VS 2005.

3. When I open any one page (Any Ajax sample page)first time it will work

4. When I open some other page I will get the JavaScript error I mentioned

5.After that none of the page will work (Including the first page which successfully executed) in that system


I have the exact same problem with the samples.

I've noticed that the web.config has a namespace entry under system.web -> pages -> controls with tagPrefix="asp" for both the preview and extensions dlls, so maybe the problem is related to those dlls.


Could it be that you're missing some javascript files?

Re: Intellisense not working, did you try removing all the Atlas components from Visual Studio and re-adding the new 1.0.6x NET Framework Components? Also, make sure you have the new files in Bin folder.


Do I need to explicitly add any JavaScript files for the toolkit? New dll's I copied to the BIN folder.

Is there anyone who is successfully using the toolkit? I have tried installing it in more than four systems (In all the systems ATLAS was there)

The very first sample I can run, After that no hope to run any sample in that system.


Gary A. Stafford:

Re: Intellisense not working, did you try removing all the Atlas components from Visual Studio and re-adding the new 1.0.6x NET Framework Components? Also, make sure you have the new files in Bin folder.

I've installed it on a machine with a fresh VS2005 installation, meaning no Atlas component.

I've copied the 'Preview' and 'Extensions' dlls to the bin folder, if thats what you meant.


It seems that the caching issue solved in the ASP.NET AJAX 1.0 release. Now there is no script error!! Smile

Thanks

Saturday, March 24, 2012

asp.net 2.0: is there any where where we can check ajax version

Hi,

Sometimes I run into problems in the server that I don t run in my developement machine, especially regardingAjax,validation,Ajax control toolkitlikeValidatorCalloutExtender...etc

Are you aware if there re different versions of Ajax or any thing else that might be causing these little weird behaviours on the production machine different from our dev machines?

If so how can we check the Ajax or customValidators version?

I m just making a hypothesis, let me know pls if any other possibility?

Thank thee

You can check the version of the currently installed Ajax Control Toolkit.dll by going to C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\AJAX Control Toolkit\Binaries and setting the view to Tiles or just hovering your mouse over the AjaxControlToolkit.dll. The latest version is currently 1.0.10920.0.

You can also check the versions of the AJAX individual controls by right-clicking in the Toolbox and selecting Choose Items then under the tab .NET Framework Components you can scroll through and check the versions of all the AJAX Controls by clicking on them.


hello.

another option is to look at the web.config file and see the info that is shown on the <assemblies> element...


I can t check that, because all those files are copied from my development machine to the server anyway, so obviously the web.config file is the same and gonna say the same version. There must be something outside the web site solution that interfers.

I can't check toolbox in the server since there is no visual studio there. On my dev machine , the ajaxcontrolToolkit controls version is: 1.0.10618.0

One more thing, when I remove the UpdatePanel from my page, every thing works well.

Thanks for tryimg to help me.


Is the ajaxcontroltoolkit.dll version on the server the same as the one on your dev box? Also if you haven't already, take a look at the following link and more specifically the section "Controls that Are Not Compatible with UpdatePanel Controls". I'm not sure if this will help, but if nothing else you'll be better informed.Smile

http://www.asp.net/ajax/documentation/live/overview/UpdatePanelOverview.aspx


hello.

tutus:

I can t check that, because all those files are copied from my development machine to the server anyway, so obviously the web.config file is the same and gonna say the same version. There must be something outside the web site solution that interfers.

well, then use reflector to load the dlls and check the versions of the assemblis you want

btw, if you're building a 2.0 web site, you'll need to download the compat validators since the ones that come with asp.net 2.0 don't work with the updatepanel.

ASP.Net 2.0: Can an UpdatePanel be placed inside a Control?

Hi all,

I recently discovered the power of ASP.Net AJAX Extensions and re-architected my site to take full advantage of it. I want to say Kudos to the DevDiv guys in MS to create such a powerful toolkit!

I converted most of my custom controls to use the AJAX ScriptLibrary and it is working very well. However, I noticed that if I place the UpdatePanel inside the control, the AJAX postback does not work and results in the whole page being updated. If I move the UpdatePanel back to the container ASPX Web Form, then the AJAX call works again. Is this somehow by design?

The really strange part is that I can place the UpdateProgress control inside my custom control and it still works, but I need to place the UpdatePanel outside of the custom control for the AJAX to work properly. Ideally, I would like the control to have its own UpdatePanel and UpdateProgress so I won't have to manage the UpdateProgress' "AssociatedUpdatePanelID" value in two separate places (i.e. in the custom control and in the web form).

Has anyone successfully done that, or is this going to be "fixed" in future releases?

Any help will be appreciated,
- K.

You need to expose the Update() event of the updatepanel and explicitly call it in response to whatever events are necessary.

http://www.asp.net/AJAX/Documentation/Live/tutorials/UsingUpdatePanelUserControls.aspx


Thanks DisturbedBuddha! I think this is what I am looking for.

Cheers,
- K.

ASP.NET 2.0 Wizard in Update Panel BUG

Hi all,

I have a Wizard control within an Update Panel. This used to work fine in Atlas but now that I upgraded to the ASP.NET Ajax release, I've discovered a bug.

When you go through the wizard, clicking the next button to go from step 1 to step 2 works fine. When you click the next button to go from step 2 to step 3, nothing happens and there is a javascript error -'null' is null or not an object. This same bug occurs under the same scenario in a MultiView, even if the next buttons are outside of the MultiView.

This seems to have something to do with ajax choking on the ASP.NET client-side validation, as you can set CausesValidation="false" on the next buttons and then you can go on to step 3. However, this isn't much of a solution, as I want to have client-side validation and not just the Page.Validate() / if(Page.IsValid) server-side code.

Anyone know a way around this bug or if it is being fixed in an upcoming release?

Thanks,

Justin

It appears it had nothing to do with the wizard and everything to do with the asp.net validator controls not working correctly in the current release of asp.net ajax 1.0.

The answer until they fix this is:

http://blogs.msdn.com/mattgi/archive/2007/01/23/asp-net-ajax-validators.aspx

asp.net 2.0 web project implement asp.net ajax control kit

Hi There,

How can i implement asp.net ajax in my asp.net 2.0 project. If i start a new project it would be easy to start this one, but i want to use in my existing project.

Thanks

There are plenty of guides on how to do this. The easiest way is to create a new temporary AJAX Enabled website, copy the missing elements out of the web.config file into your existing one and then place a ScriptManager component onto your page, before any of the components.

Hope this helps.

asp.net 2.0 ajax website menucontrol : javascript error :"Microsoft JScript runtime error:

i m developing application using ajax in asp.net 2.0 . I m using menu control of asp.net,multiview and view control.while running this application i got error "Microsoft JScript runtime error: '0.cells' is null or not an object" so now what is the solution of this i have returend following coad in html

<

div>

<

asp:UpdatePanelID="UpdatePanel2"UpdateMode="Conditional"runat="Server"><ContentTemplate>

<tablecellpadding="0"cellspacing="0"border="0"width="100%"><tr><tdwidth="6%"><asp:MenuID="Menu1"runat="server"DynamicHoverStyle-BackColor="Aqua"DynamicHoverStyle-Font-Overline="true"DynamicHoverStyle-ForeColor="Brown"DynamicMenuItemStyle-BackColor="Crimson"dOrientation="Horizontal"StaticEnableDefaultPopOutImage="False"OnMenuItemClick="menu_click"Orientation="Horizontal"><Items><asp:MenuItemText="Operator"Value="0"></asp:MenuItem><asp:MenuItemText="Visitor"Value="1"></asp:MenuItem></Items><StaticMenuStyleBackColor="White"/><StaticMenuItemStyleBackColor="White"/><StaticSelectedStyleBackColor="#FFC080"/><StaticHoverStyleBackColor="#80FFFF"/></asp:Menu><asp:MultiViewID="MultiView1"runat="server"><asp:ViewID="op"runat="server"><tablewidth="30%"><trvalign="top"><td>hetal</td></tr></table></asp:View><asp:ViewID="visitor"runat="server"><tablewidth="30%"><trvalign="top"><td>tarun</td></tr></table></asp:View></asp:MultiView></td>

</tr>

</table>

</ContentTemplate>

</

asp:UpdatePanel>

</

div>

please give me solution for this error...thank u

<asp:menu > control seems to be not compatible withUpdatepanel. Put the menu control outside the updatepanel. If you wantto refresh only updatepanel contents on click of menu control, then setmenu control as an async postback trigger for updae panel as givenbelow.

try following modified code.

<div>
<asp:Menu ID="Menu1"runat="server" DynamicHoverStyle-BackColor="Aqua"DynamicHoverStyle-Font-Overline="true"DynamicHoverStyle-ForeColor="Brown"DynamicMenuItemStyle-BackColor="Crimson" dOrientation="Horizontal"StaticEnableDefaultPopOutImage="False" OnMenuItemClick="menu_click"Orientation="Horizontal">
<Items>
<asp:MenuItem Text="Operator" Value="0" ></asp:MenuItem>
<asp:MenuItem Text="Visitor" Value="1"></asp:MenuItem>
</Items>
<StaticMenuStyle BackColor="White" />
<StaticMenuItemStyle BackColor="White" />
<StaticSelectedStyle BackColor="#FFC080" />
<StaticHoverStyle BackColor="#80FFFF" />
</asp:Menu>
<asp:UpdatePanel ID="UpdatePanel2" UpdateMode="Conditional" runat="Server">
<ContentTemplate>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td width="6%">
<asp:MultiView ID="MultiView1" runat="server" >
<asp:View ID="op" runat="server">
<table width="30%">
<tr valign="top"><td>hetal</td></tr>
</table>
</asp:View>
<asp:View ID="visitor" runat="server">
<table width="30%">
<tr valign="top"><td>tarun</td></tr>
</table>
</asp:View>
</asp:MultiView>
</td>
</tr>
</table>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Menu1"EventName="MenuItemClick" />
</Triggers>
</asp:UpdatePanel>

</div>


You can also add the below script to your aspx page. It overrides the AJAX function and takes care of the error. This works for problems with Tab Controls too, seehttp://forums.asp.net/thread/1628780.aspx.

<scripttype="text/javascript">

var oldMenu_HideItems = Menu_HideItems;if(oldMenu_HideItems)

{

Menu_HideItems =

function(items)

{

if (!items || ((typeof(items.tagName) =="undefined") && (itemsinstanceof Event)))

{

items = __rootMenuItem;

}

if(items && items.rows && items.rows.length == 0)

{

items.insertRow(0);

}

return oldMenu_HideItems(items);

}

}

</script>

ASP.NET 2 - AJAX control toolkit autocomplete

hi

how can i do to have a session variable ( like for example session("name") ) to web site ( asp.net 2) in a class of control toolkit autocomplete.

with the use of this instructions in the class vb autocomplete :

Dim session As System.Web.SessionState.HttpSessionState

session = System.Web.HttpContext.Current.Session

the 'session' variable is nothing

thanks to attention

Hi Robby,

My understanding of your issue is that use session your WebService which is associated with a AutuCompleteExtender. If I have misunderstood, please feel free to let me know.

Based on this knowledge, here is a sample which is written by Jeffrey Zhao. I found it on MS WebCast. This sample is not use AutuCompleteExtender but they are similar. You can do some changes on your source code.

<%@. WebService Language="C#" Class="EnableSessionService" %>using System;using System.Web;using System.Web.Services;using System.Web.Services.Protocols;using System.Web.Script.Services;using System.Web.SessionState;[WebService(Namespace = "http://tempuri.org/")][WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)][ScriptService]public class EnableSessionService : System.Web.Services.WebService{ [WebMethod(true)] public int AddOne(){HttpSessionState session = HttpContext.Current.Session;object objValue = session["value"];int value = objValue == null ? 0 : (int)objValue;value++;session["value"] = value;return value; } }
Aspx page:
 
<%@. 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 runat="server"> <title>Enable Session</title></head><body> <form id="form1" runat="server"><asp:ScriptManager runat="server" ID="ScriptManager1" ScriptMode="Debug"><Services><asp:ServiceReference Path="Services/EnableSessionService.asmx" InlineScript="true" /></Services></asp:ScriptManager> <input type="button" value="Add One" onclick="addOne()" /><script language="javascript" type="text/javascript">function addOne(){EnableSessionService.AddOne(onSucceeded);}function onSucceeded(result){alert(result);}</script> </form></body></html>

Please pay attention to the "Bold" part. Hope this help.

Best regards,

Joanthan


Hi Joanthan

thanks to your advice, it's that i had necessity.

in my code i haven't put TRUE in[WebMethod(true)]

now is working

thanks

asp.net 1.1 , how to do use tab control in asp.net 1.1

AJAX provides following functionality to website, and I want to make something like this in my application. I m using asp.net 1.1 How can I do this.

Please click following link and see demo how AJAX does ( you will get it what I mean by, thank you)

http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Tabs/Tabs.aspx

I want to make something like above like deom , how can I do that using asp.net 1.1

thank you in advance

maxmax

It is possible but there is not a simple solution. The more simple solution would be to convert your site to the 2.0 framework. If that is not possible, then just google "ajax with .net 1.1" there are lots of articles out there.

Asp.net & Microsoft Ajax Performance issues

I am having performance problems with ajax control toolkit. I have a web form with some ajax control toolkit controls(Textbox, Dropdownlist) and some simple standard asp.net controls. Now whats hepening with me whenever I post a ajax call to server each time request size increases secondly all the data of controls of the page is being sent back to server on each request why?

If I do all this work with raw javascript using XMLHttpRequest object(the very first form of ajax) it works fine.

Hi,

According to your description, I think it's normal to see this.

When you use ASP.NET AJAX, it doesn't eliminate unnecessary data transfer. All information on current page will be posted to server just as a normal request.

While working with a raw XmlHttpRequest, you can send necessary data explicitly.


you are right its normal way of httprequest.

But my point is, don't you think for a specific control say a button or text box only required data(viewstate) should be travel to server as you can do using simple ajax.

I think if this functionality could be added in Ajax Framework it will be a value added in this framework for enterprise applications wehere performance is critical.


Yes, this is a good point.

But we have to sacrifice some performances when we manage to achieve an easy-to-use framework. This sacrifice usually comes with UpdatePanel, but if you are accessing WebService or PageMethod, there will be less unnecessary traffic.