Showing posts with label website. Show all posts
Showing posts with label website. Show all posts

Wednesday, March 28, 2012

Ajax UpdatePanel Problem!

hey i made this news website using Asp.net .. and using Ajax UpdatePanel :www.raddar.co.il

the Top-Right News switches every 5 seconds using timer and updatepanel .. so if i was reading down page and it switches it will scroll straight away to top!

u can try it ... and see ...

scroll down and once it switchs (the news box in the top) it will scroll to top..

Thanks in Advance...

Set in page

<%@. Page smartNavigation="true" %>

<%@.PageMaintainScrollPositionOnPostback="true" %>


thx so much..


Thats niceSmile

Mark as answer if it's soved your problem,

So it will help for other people

Monday, March 26, 2012

AJAX Toolkit not working with Masterpages when retrofitting to exsiting website and what i

I have posted to these two threads with no response

http://forums.asp.net/p/1096452/1761461.aspx#1761461

http://forums.asp.net/p/1037436/1760268.aspx#1760268

Please scroll to the bottom of those threads for more details, but in a nutshell I must be having a different problem than there's as they seem to have all had problems with beta versions and I am on VS 2005 SP 1 and AJAX 1.0.

I have no problem creating a new AJAX enabled web site and getting it to recognize and use the controls, but when I try to AJAXify an exisiting website the toolkit does not work. If I only add script manager and a panel, I get no errors, but then if I try to add any of the extenders from the toolkit, the project won't even compile - get the squiggly lines underneath the control, but I still have intellisense in the update panel, but not the calendar extender, which it claims is not a known element.

With Master Pages, where do you put the script manager, in the Master page, or the child pages?

Notes below are added after the original post

OK, I created a new AJAX enabled web site from scratch and then added a master sheet, deleted everything except the following from my default page after wiring the MAsterPAgeFile reference

<%@dotnet.itags.org.PageLanguage="VB"MasterPageFile="~/MasterPage.master"AutoEventWireup="true"CodeFile="Default.aspx.vb"Inherits="_Default" %>

<%@dotnet.itags.org.RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="cc1" %>

then I added a script manager, and then a textbox and calendar extender inside an update panel, and ran the debugger. Right away it popped up a dialog box wanting to know where the ExtenderControlBase.cs file was, and so I browsed to it in the subsequent ASP and then AJAX directories, found it and then ran this project and it worked fine. Problem is I didn't need to find and browse for that ExtenderControlBase.cs file to get this project to work before I added master pages..?? And why does it continue to work eventhough I have since removed that file from the project?

Nevertheless it still does not work in my original website that has far too much work put into it to try and start over from scratch. This is the error I am getting:

Error 1 Element 'CalendarExtender' is not a known element. This can occur if there is a compilation error in the Web site.

and I get

Error 34 Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.


usually people don't like to reply because: some people post too much information that readers do not want to go over everything ... time is valuable. if you can make it short and precise then you will get more help.

...

do you have your AjaxControlToolkit.dll inside your bin?
From your other threads, you said that when you create a new ajax site it works, but your existing website with ajax doesn't work? May be you didn't copy the web.config file correctly.

if you want to add ajax to a non-ajax website; first, you create a new ajax site and copy the web.config file over to your old website. be sure to back up your old config file and move over the data that you need to the new config file. Good luck ......


Thanks for replying Wishstar,

Yes, I have taken over a web.config just as you said. I did it twice. The only diff in the web.config is that the old one had a connection string. I went along step for step with the video tutorial. And yes AjaxControlToolkit.dll is inside my bin.

The only other apparent differences is that my exisiting website has Sql dataset connections, and is also being developed on a remote machine, but the VS 2005 and all my AJAX stuff is on my local machine, but my source code and database is on a remote machine. Everything has worked fine up until now.

It seems nothing in the toolkit is recognized. I also tried reregistering (re-adding a reference to) the dll, and it even recognized that it was already registered and warned it would be overwritten.


sorry ...accidentally double posted


does anything run on your system at all? any of the samples from the toolkit? Try running it on your dev machine. if you are able to run the samples, that means there must be something wrong with your work.


OK solved part of problem found MUCH BIGGER PROBLEM

Sorry I haven't responded for two days, but I was on jury duty and just got back to debugging this problem.

I ruled out my coding as the problem by taking my code from the working exisiting web site and using the Visual Studio copy web site tool, copied the develoment files to an AJAX toolkit enabled website that I juts created on my local machine.

All extenders started working and intellisense returned UNTIL I WENT TO PUBLISH TO THE REMOTE MACHINE.

The publishing went apparently fine until I went to pull up the web site ...I got a cryptic error and then remote desktopped into that machine and ran the local host to get a more verbose explanation of the error.

It seems that it does not like anything to do with the System.Web.Extensions or System.WebServer. I had to remove all the AJAX stuff and line by line comment out these lines from my web.config and rebuild before my website was working again...PHHHEWWW (I got a demonstartion meeting this afternoon and people will want to review my site between lunch and the meeting - I told them to).

The following is a screen of the error I got while running the local host...what do I have to do to the remote host running IIS to get it to allow me to run AJAX on it?

Thanks, Earl

Server Error in '/' Application.

Configuration Error

Description:An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message:Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. (c:\inetpub\wwwroot\web.config line 52)

Source Error:

Line 50: </httpHandlers>Line 51: <httpModules>Line 52: <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>Line 53: </httpModules>Line 54: <!--


Source File:c:\inetpub\wwwroot\web.config Line:52

Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210


did you install ajax on your server?


OK, paint me stupid...am I supposed to install AJAX on my server too? I'm confused, I thought AJAX toolkit was a set of controls that generated script. I guess I am thinking way too much like the VB6 hack that I am (guilty as charged) and controls are just like ocx's.

Ok, so do I install AJAX toolkit? AJAX normal that came with the script manager, er?


OK problem solved...at least so far. This is what I posted in this other threadhttp://forums.asp.net/t/1072841.aspx?PageIndex=2

On my development machine, I clicked on the .Bin folder and then clicked on Add Item, and NOT Add Reference. I then browsed to the folder where ASP.Net extensions folder and then clicked the folder of my version number v1.0.61025 and NOT the AJAX Control Toolkit. In that version numbered folder you find the System.Web.Extensions.dll. The dll now appears under the Bin folder. I merely published to my remote (nearby Windows 2000 SP4, .Net Framework 2.0, IIS 5.0 or 5.1? box) webserver (intranet).

Now, my only question, am I running the minimum configuration to allow the ASP AJAX services? Also, was I oblivious to this trust issue. As I understand a host (other than intranet?) has to support AJAX, but it seems I got around that issue?


Hi,

FYI

Just keep in mind when you want to host your application make sure that your hosing company support ajax as well. I had this promblem and I had to ask them to install the framwork on their server.


Lucky for me I'm just an Intranet kinda guy, but I imagine some day I will be on the Internet, and I'll have to learn this all over again. BTB I am on a LAN and using a Windows 2000 SP4 server running IIS 5.0 with a 'shadow' IT group (yep, they really call it that) and I may have to move it to the official IT group (dark side, black helicopters), and I don't think they are AJAXified or willing either.


I have this similiar issues. I installed AJAX on my local machine. I have to create a reomote project, I can't install AJAX on the reomote Server because I'm not allow. But I did, copy all the .dll related to AJAX and AJAX control and the Web.config has all the stuff need. When I build the project I get erros on every control that I'm using, sample "Element CalendarExtender is not a known element" If I go to the http link, everything seams to work fine, but I can build the project because of the elements errors.

How can I fix this issue?

Thanks


Please look at my answers above, and then follow the link in my response as to how I solved the issue.

If your issue is that you cannot install AJAX because you are publishing to an ISP (commercial third party Internet Service Provider) then you need to ask them to install it, and they should comply, most people are doing this.

If you are publishing on an Intranet or a captive network for lack of better terms, then you will probably at least need to get administrative rights on that server and then publish while properly referencing the AJAX toolkits, and the System.Web.Extensions.


It's on an Intranet and they will not install anything and they wouldn't give us Administrative rights. I was trying to work around the issue by adding the System.Web.Extensions.dll and AJAXControlToolkit.dll to the bin folder. Sad

Thanks


How do you publish to it normally?

Ajax toolbox missing in Visual webdeveloper 2005 express

I've just installed the Ajax tool kit but the toolbox is missing from the toolsbox panel. I have the Ajax website in the templates but no toolbox and suspect there is no intellisence either. Does anyone know haw to sort this out Ajax toolbox missing in Visual webdeveloper 2005 express

regards

jim

Hi Jim,

The AJAX Control Toolkit won't show up automatically in the toolbox - you have to add it yourself. Check out theSetup Your Environment walkthrough for details on how to add them. Intellisense also works fine.

Thanks,
Ted

Ajax Tool Kit

We have built a website using ASP.net 2.0 and Ajax 1.0 version. We are using AjaxTool kit for Calendar,CollapsiblePanelExtender(4) and few other Ajax controls.We have conducted performance Testing and found the page is taking more time. Based on the logfiles, I have observed that "CollapsiblePanelExtender" taking longer time.Component Time in MillisecondsASP.Net 9467.40Ajax Control 4170.57 To Process All Layers 300 Is the AjaxToolKit makes the application Slow ? Is there any work around to resolve the issue ?

Dear Sunny,

There could be a lot of content generated which is increasing your page size. Checkthis post specific to CollapsiblePanelExtender.

Also check the amount of viewstate generated. To compress viewstate, checkthis article.

HTH,

Suprotim Agarwal

Saturday, March 24, 2012

ajax timer problem

Hi..
Iam using Ajax Enabled website in my Project iam using two Ajax Timer controls for displaying
two images in different time one for 5 seconds another for 2 seconds but it is displaying only one image

have you used two update panels for two timer controls?
Try updating panel, once one image is displayed. Then enable another timer.

i.e

timer1.enabled=true;
timer2.enabled=false;

timer1_tick() {
//display image

timer1.enabled=false;
timer2.enabled=true;
updatepanel.update() //if updatemode is set to conditional
}

timer2_tick() {
//display image

timer2.enabled=false;
updatepanel.update() //if updatemode is set to conditional

}


Hi,

I used two update panels for two timer controls then also its not working

protectedvoid HomeImages(object sender,EventArgs e)

{

if (n > 13)

n = 1;

if (n != 4)

{

Image1.ImageUrl =String.Concat("Dimages/image", n.ToString(),".jpg");

}

Image1.ImageUrl ="Dimages/images" + n.ToString() +".jpg";

n++;

homeImages.Enabled =false;Timer1.Enabled =true;

UpdatePanel1.Update();

}

protectedvoid Timer1_Tick3(object sender,EventArgs e)

{

if (k > 6)

k = 1;

Image3.ImageUrl =String.Concat("ClientsImages/clientimage", k.ToString(),".jpg");

// Image1.ImageUrl = "Dimages/images" + n.ToString() + ".jpg";

k++;

Timer1.Enabled =false;

UpdatePanel2.Update();

}


Hi Pathipati,

I have made a sample for your situation. Please wholly copy my source code and have a test.

<%@. 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">public static bool timer1State = false; public static bool timer2State = false; protected void Timer2_Tick(object sender, EventArgs e) { if (timer2State) { Image2.ImageUrl = "~/pic/expand.jpg"; } else { Image2.ImageUrl = "~/pic/collapse.jpg"; } timer2State = !timer2State; UpdatePanel2.Update(); } protected void Timer1_Tick(object sender, EventArgs e) { if (timer1State) { Image1.ImageUrl = "~/pic/expand.jpg"; } else { Image1.ImageUrl = "~/pic/collapse.jpg"; } timer1State = !timer1State; UpdatePanel1.Update(); }</script><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> UpdatePanel1:<%=DateTime.Now.ToString()%> <asp:Image ID="Image1" runat="server" ImageUrl="~/pic/expand.jpg" /> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick"/> </Triggers> </asp:UpdatePanel> <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional"> <ContentTemplate> UpdatePanel2:<%=DateTime.Now.ToString()%> <asp:Image ID="Image2" runat="server" ImageUrl="~/pic/expand.jpg"/> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Timer2" EventName="Tick" /> </Triggers> </asp:UpdatePanel> <asp:Timer ID="Timer1" runat="server" Interval="5000" ontick="Timer1_Tick"> </asp:Timer><asp:Timer ID="Timer2" runat="server" Interval="2000" ontick="Timer2_Tick"> </asp:Timer> </form></body></html>

Best regards,
Jonathan

Ajax Timer not working in published website

Hi,

In my project I am using Ajax timer for loading the images every 20 seconds. This functionality works fine in my localhost. but when i publish the site in the server, i am getting the following error.

Method not found: 'Void Microsoft.Web.UI.Controls.Timer.remove_Tick(System.EventHandler`1<System.EventArgs>)'.

Someone please help me whats wrong with the server where i am publishing my site.

TIA,

Prashanth

You are using the System timer, this is the wrong time, you need the Ajax timer:http://alpascual.com/blog/al/archive/2006/12/21/Code-Snip-_2200_AJAX-Timer_2200_.aspx

Also check your config file :http://ajax.alpascual.com/Walkthrough/AtlasToAspNetAjax.aspx

Hope it helps


Hi,

I am using Ajax Timer inside the update panel and I am usingAjaxControlToolkit assembly.

The error is stil there.


The GAC (Global Assembly Cache) of your server on wich you have published the code should contain the ajax dll.

Check if you have that?


I have the ajax dll in GAC on my server. Now i am facing one more problem. When i try to access the default page I am getting "Object Reference Not set to an instance of an object " exception.

any idea on this problem?

Thanks,

Prashanth

Ajax Textbox Issue

Hi,

I have created a ASp .NET 2.0 Ajax enabled Website. I have two textbox controls on the default page. These controls are added to the UpdatePanel. What I want is, when the first textbox looses focus and moves to textbox2 the datetime should automatically get added to the first textbox.

All I find is the serverchange event of the first textbox. An article on web should that it can be done through onblur but since the textbox control is a server side control, I think onblur will not work.

Please help!!

Thank You,

~B.

You can add onblur in the code behind file if you do something like TextBox1.Attributes.Add("onblur","dothis();");


onblur, onfocus, etc. will work with the server controls. You can also add them right in source view, though the Visual Studio IDE may tell you that they are not supported attributes.


You can use onblur or lostfocus event

TextBox.Attributes.Add("onblur","functionName()");

TextBox.Attributes.Add("lostfocus","functionName()");

Wednesday, March 21, 2012

AJAX Tab Control

Hi,

I tried to follow the sample website for AJAX Tab control. It does not work for me. Is thier any videos on how to use the New TAB Control.

Please forward the links. Much thanks........

I can't find a video for this one - but here is a snippet that may help - the most common problem I've come across is people not popping the TabPanel inside a TabContainer...

"server" ID="TabContainer1" Height="150px">"Server" ID="TabPanel1" HeaderText="Summary">

Test 1

"Server" ID="TabPanel2" HeaderText="Categories">

Test 2

"Server" ID="TabPanel3" HeaderText="Additional Details">

Test 3


Okay, a fair bit of code went missing then! Must have selected the wrong language - here is another attempt:

<ajaxToolkit:TabContainer runat="server" ID="TabContainer1" Height="150px"><ajaxToolkit:TabPanel runat="Server" ID="TabPanel1" HeaderText="Title 1"><ContentTemplate><p>Test 1</p></ContentTemplate></ajaxToolkit:TabPanel><ajaxToolkit:TabPanel runat="Server" ID="TabPanel2" HeaderText="Title 2"><ContentTemplate><p>Test 2</p></ContentTemplate></ajaxToolkit:TabPanel><ajaxToolkit:TabPanel runat="Server" ID="TabPanel3" HeaderText="Title 3"><ContentTemplate><p>Test 3</p></ContentTemplate></ajaxToolkit:TabPanel></ajaxToolkit:TabContainer>

Ajax support on the hosting server

If I have an Ajax website that I want to copy to the hosting server,
But the hosting server didn't install AJAX,

Is it enough just to include ajax dll within my bin folder, and my web site will function well,
Or AJAX must be also installed on the hosting server ?

Thanks.

>> Is it enough just to include ajax dll within my bin folder, and my web site will function well,
>> Or AJAX must be also installed on the hosting server ?

The hosting Server should have AJAX installed. Otherwise your aspx pages uses AJAX controls will not work.


1. If the server has AJAX installed, I don't need the ajax dll at my bin folder ?

2. What about AjaxToolkit ? I just there is not server installation needed, just the DLL at my bin folder, amI right ?

3. By the way, what are the language extension folders been created under my bin folder, while adding reference to AjaxToolKit ?
If I need only English support, can I delete these folders ?
(And anyway, what these resource dll within these folders hold ? error text messages ?)

Thank you.


david79:

1. If the server has AJAX installed, I don't need the ajax dll at my bin folder ?

Yes, it's not needed. The assembly will be loaded from GAC.

david79:

2. What about AjaxToolkit ? I just there is not server installation needed, just the DLL at my bin folder, amI right ?

Yes, it's enough.

david79:

3. By the way, what are the language extension folders been created under my bin folder, while adding reference to AjaxToolKit ?
If I need only English support, can I delete these folders ?
(And anyway, what these resource dll within these folders hold ? error text messages ?)

Yes, you can delete them. Those satellite assembly contains all text messages for different language.