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

Wednesday, March 28, 2012

AJAX UpdatePanel works on dev machine but still flickers on web server.

Hi Guys,

I have a master page, that has a ScriptManager and some "RoundCorner" controls. I also have a child page with a textbox and a FormView.

So I created an UpdatePanel, put my FormView inside the ContentTemplate, created the trigger and assigned to the TextBox's TextChanged event. (to an Async trigger).

When I run the app on the dev machine, it works wonders, no flickering and only the formview gets "refreshed". But as soon as I upload the code to the WebServer, the entire page gets refreshed everytime I change the value on the TextBox.

Am I forgetting to have something setup on the server side? I didn't find a "Deployment guide" for AJAX (If theres one, please point me to the right direction), so I figured that installing the MS Ajax 1.0 on the server would do it.

Thanks!

Marcelo

More info:

Just tried a small example, and again it does not work on the server side (both dates get updated):

<%@. Page Language="C#" AutoEventWireup="true" CodeFile="TestPage.aspx.cs" Inherits="TestPage" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server">From here, it is inside the panel <br /> <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"> </asp:ScriptManager> <asp:UpdatePanel runat="server" ID="UpdatePanel1"> <ContentTemplate> <asp:Label ID="TestLabel" runat="server" Text=""></asp:Label> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" /> </Triggers> </asp:UpdatePanel><hr/>From here down its not inside the Panel<br /> <asp:Label id="Test2Label" runat="server" text="" /> <asp:Button ID="Button1" runat="server" Text="ClickHere" /> </form></body></html>

***********CS content

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 partialclass TestPage : System.Web.UI.Page{protected void Page_Load(object sender, EventArgs e) {TestLabel.Text = DateTime.Now.ToString();Test2Label.Text = DateTime.Now.ToString(); }}

Anyone has ideas?

Thanks!

Marcelo


Nobody at all?


Hello,

Take a look at my post and the solution we found:http://forums.asp.net/thread/1649057.aspx

Possibly your case is similar.


Hi there,

At first it seemed that I had my problem solved, since the properties show exactly the same as yours.. So I tried to change the property to true, but no luck, it still does a full refresh on the

server side..

I checked your sample site, and I it does a full refresh aswell.. what part of if should do a partial refresh?

Could you send me the code you have on your page Init?

this is what I've added on mine:

private void Page_Init(System.Object sender, System.EventArgs e) { ScriptManager1.SupportsPartialRendering =true; }

I'm getting frustrated with this...


Hi,

The partial refresh on our page (http://beta.easyquerydemo.com) works only for "Result" panel (at the bottom of the page). If you define some query using "Conditions" panel (for example: "Customer Company Name starts with A") and then click on "Update Result" button the result set should appear almost immediately and without updating the whole page.

As for code: we use exactly the same line of code as you published in your previous post.

Did you check the value of this property after assignment. Maybe it still is set to 'false' because of some limitations in browser which you use to access this page.


In this example of yours, both Labels get updated because you update the datetime in your Page_Load function.

Your Page_Load function should be like this:

Protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
TestLabel.Text = DateTime.Now.ToString();
Test2Label.Text = DateTime.Now.ToString();
}
}

And your button to update the Label inside the updatepanel should call a function to update the datetime of that label.

Protected void UpdateLabel(object sender, eventargs e)
{
TestLabel.Text = DateTime.Now.ToString();
}


Hi,

What i'm doing is the following, on page_init i force the property to be true, and on page load i load all those variables into labels, just like you do on your sample site. It does in fact change that property to True. but the full refrensh still occurs.

Now I see the part that uses the update panel (The result on your site). And it actually works.

Do you have any other hint?

Correct me if I'm wrong but, theSupportsPartialRendering property is set based on:EcmaScriptVersion,SupportsCallback andW3CDomVersion; which are properties of HttpBrowserCapabilities that is assigned from a Request.Browser object.

That means that it is checking the Client's Browser capabilities, and nothing to do with the server itself right? If thats true, as long I use the same browser (IE7 for instance) it should not matter where that page is sitting at, it should bring the same value for SupportsPartialRendering...

Is my line of thought correct or I am missing something ?

Thanks a lot for the help you are giving me!


Hi there,

1. About "other hint". No I do not have it unfortunately. The only one thing I can suggest is to try add another UpdatePanel on your page and some simple controls into it (e.g. one button and one label) just for testing and see how it works. Another good idea will be to create another simple testing page using AJAX template in Visual Studio (if you use it) and see how it works on your server.

2. About the properties whichSupportsPartialRendering is based on: yes you are right, at least we understand this part of documentation exactly the same way.

Possibly we should send this request to Microsoft? There must be more conditions for partial rendering support except those ones described in documentation. I think there must be some requirements for server side.



Hey,

I will create a brand new example using the AJAX project template and report back my findings.

I agree, but I never done this before. Usually I can find a work-around for these type of issues, which doesn't seem to be the case right now. How should I proceed on submiting this to MS?

Regards


Hi again there,

More findings:

1. I created a brand new application and used the same sample as before, but this time I added the labels and forced SupportPartialRendering to true.

Amazingly the application worked just fine on the server side.

2. I've added a master page to this application and wired up the old "default.aspx" to the master page, moving the ScriptManager to the master page (and also the SupportPartialRendering portion)

Application stopped working.

3. I moved the ScriptManager (and SupportPartialRendering) back to the Default.aspx and removed from the master page.

Application still didn't work.

At this point I think is safe to conclude that: UpdatePanels will not work with master pages!!!?

PS: All the 3 situations work fine on the development machine.

Anyone has Master Pages + Update panels working properly on a production server?


We finally have solved the same problem. I think your case is similar.

Seehttp://forums.asp.net/thread/1653605.aspx for more info.


Hi korzh,

This is great, now it works like a charm! Thanks a lot for keeping me posted! Now, where in the documentation does it show anything about that property.. :P only a insider would know about it ..

Thanks a lot! Case closed!

Marcelo


Hi korzh,

This is great, now it works like a charm! Thanks a lot for keeping me posted! Now, where in the documentation does it show anything about that property.. :P only an insider would know about it ..

Thanks a lot! Case closed!

Marcelo

Ajax update panel focus problem

Hi

I have a asp.net 2 web app that uses asp.net ajax and master pages. I have a very common problem that I think most people get when using an update panel and textboxes. The tab order after leaving the text box is lost, so I have heard the fix is to use

Me.ScriptManager1.SetFocus(Textbox1.ClientID);

Rather than adding the ScriptManager to every page I have added it to my Master page. However my update panel exists within a user control, which is then embeded in a master page. So the above syntax does not work in my user control as it does not know about the ScriptManager as it is defined in my master page.

Any ideas on how I could get this to work? Or any other methods to get round this textbox focus problem?

Many thanks inadvance

Use ScriptManager.GetCurrent() to get a reference to the page's ScriptManager.


See for more detail.

http://asp.net/AJAX/Documentation/Live/mref/O_T_System_Web_UI_ScriptManager_SetFocus.aspx


Hi,

You may get reference to the scriptManager instance via
ScriptManager.GetCurrent(this.Page)

Hope this helps.


I'm having a similar problem, except that I have a timer that refreshes some content every 4 seconds. I set the

this.ScriptManager1.SetFocus(tbMessage.ClientID);

but when the content refreshes, it sends the cursor to the beginning of the text box. Even when i'm in the middle of typing something.Tongue Tied

Is there a way to keep the cursor exactly where it was when content was updated in the update panel?

- Albert

(PS - Sorry to hijack this thread.)

Ajax Update Pable not working

Hi!

I m using VS2005.I am just download & Install Ajax Extention & Controle fro asp.net.

After running the project, Web page give me following JAVA Script ERRRO:

'Sys' is undefined.

Please give me suggestion.

Abhishek

Hi,

Sys undefined means that you're not getting the client side files loaded on your browser.

See'Sys' is undefined. for more information and find out a solution.

This error have many different causes.

A lot of people run into it,and most of them finally figured out it and post up their solution.

Best Regards,

Ajax trouble with Localization HttpModule

Hello,

I'm using this HttpModule :

Imports System.WebImports System.Web.SessionStatePublic Class URLLocalizationHttpModuleImplements IHttpModule, IReadOnlySessionStateDim LangueAs String Dim OriginalURLAs String Public Sub Dispose()Implements IHttpModule.DisposeEnd Sub Public Sub Init(ByVal contextAs HttpApplication)Implements IHttpModule.InitAddHandler context.BeginRequest,AddressOf context_BeginRequestAddHandler context.AcquireRequestState,AddressOf AcquireRequestStateEnd Sub Private Sub context_BeginRequest(ByVal senderAs Object,ByVal eAs EventArgs)Dim requestAs HttpRequest =CType(sender, HttpApplication).RequestDim contextAs HttpContext =CType(sender, HttpApplication).ContextDim applicationPathAs String = request.ApplicationPathIf applicationPath ="/"Then applicationPath =String.EmptyEnd If Dim requestPathAs String = request.Url.AbsolutePath.Substring(applicationPath.Length) OriginalURL = requestPath LoadCulture(requestPath) context.RewritePath(applicationPath + requestPath)End Sub Private Sub AcquireRequestState(ByVal senderAs Object,ByVal eAs EventArgs) HttpContext.Current.Session("OriginalURL") = OriginalURLEnd Sub Private Sub LoadCulture(ByRef pathAs String)Dim pathParts()As String = path.Trim("/"c).Split("/"c)If pathParts.Length > 0AndAlso pathParts(0).Length > 0Then Dim LangAs String = pathParts(0)Dim supportedLanguagesAs NameValueCollection = ResourceManager.GetSupportedLanguages()Dim supportedLanguageAs String = supportedLanguages(Lang)If Not (ResourceManager.IsNullorEmpty(supportedLanguage))Then path = path.Remove(0, pathParts(0).Length + 1)End If End If End SubEnd Class

When it is activated in web.config localization works fine but ajax not.

I get this error:

Sys is not defined

Can anybody help me ?

hello.

i think you can use fiddler to see what's happening but i'm almost positive that you're not getting the client files on the client. before rewriting the path you should check for scriptresource.axd requests and you shouldn't change the url for the those requests (they're responsible for getting the client js files onthe client side - btw, don't do it either to webresourece.axd requests)

Ajax tools not work in IE6

im using AccordionPanel in my web when i start my web on firfox its

ok and work

but when i run my site in IE6 Ajax tools not work

what is the problem

Sorry if this is a little basic, but is JS enabled on your IE6 browser? If so, are you getting any javascript errors? Possibly "Sys is undefined"?

i haven't any problem with js


To help with your issue, you'll need to post any error messages and code samples of what is being done.

i have this same problem with the message "Sys is undefined"

but... my web.config file is ok!

can you help me?!

thank's

Monday, March 26, 2012

ajax toolkit problem in visual web 2008

Hi,

Hope some one can help with this. I have installed vwd 2008 and am trying to get AJAX tool kit working.

I also ran the cmd script by the way.

Now when I drag a AJAX Toolkit control from the toolbox to the designer I get this...

<soap-env:envelope soap-env:encodingstyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soap-env:body> <a1:webcontroltoolboxitem id="ref-1" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/System.Web.UI.Design/System.Design%2C%20Version%3D2.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Db03f5f7f11d50a3a"> <locked>true</locked> <filter href="#ref-5">

What is going on here? And how do i 'fix' it?

Thanks Kal

Same issue here. Haven't seen a fix yet. Anyone?


I guess with the pucker release of 2008 this has been fixed - but im closing this -

Ajax Toolkit issue with web deploy project in Visual Studio 2005

Error 157 Unable to copy file "C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\AJAX Control ToolKit\SampleWebSite\Bin\zh-CHT\AjaxControlToolkit.resources.dll" to "C:\Documents and Settings\UserName\My Documents\Visual Studio 2005\Projects\TipWebCurrent\TipWeb\Bin\zh-CHT\AjaxControlToolkit.resources.dll". Access to the path 'C:\Documents and Settings\UserName\My Documents\Visual Studio 2005\Projects\TipWebCurrent\TipWeb\Bin\zh-CHT\AjaxControlToolkit.resources.dll' is denied. 1 1 TipWeb_deployProject

I am getting the above problem when I try and build my solution,(web deploy project specifically) is it as simple as changing the properties of the read-only access for each folder to false for each of the folders containing the dll's?


Yes, the directory that you are publishing to or at least the bin should have right access until you are done deploying, then make it read only again.


Yep, that was the main issue... Once I changed the permissions it worked like a charm!

:)

AJAX Toolkit installation issue

Hi all, I've downloaded the toolkit but I'm not running the full version of web developer. Can anyone tell me how to upload the toolkit into the toolbox? Thanks for any help you can give.Smile

Andy

checkout this link

http://asp.net/AJAX/Control-Toolkit/Live/Walkthrough/Setup.aspx

if you find soln, mark this post as answer


Thanks - that was very useful.Smile


You r most welcome !!!

AJAX Toolkit installation

Forgive my ignorance, however today we are working on migrating an ASP .Net site to the web server that is running IIS6. We have installed AJAX onto the server and it seems to be working fine, however now I am getting errors with the AJAX toolkit. Our sys admin says that Visual Studio needs to be installed on the server to install the toolkit. Now I know this is not true, correct?

This is the error that we are getting. I double checked that the .dll file has been copied over to the web's directory bin file.

Parser Error Message:Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The system cannot find the file specified.

Source Error:

Line 4: Namespace="System.Web.UI" TagPrefix="asp" %>Line 5:Line 6: <%@dotnet.itags.org. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AJAXTools" %>

Thanks for the information

Yes, you are correct, visual studio does not need to be installed on the web server.

Did you add a reference to the .dll file? Just putting it in the bin folder is not enough, you have to reference it once it is there.


I do have these directives on the default.aspx page:

<%

@.PageLanguage="VB"AutoEventWireup="true"CodeFile="Default.aspx.vb"Inherits="_Default" %>

<%

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

<%

@.RegisterAssembly="AjaxControlToolkit"Namespace="AjaxControlToolkit"TagPrefix="AJAXTools" %>

Now, does the toolkit have to be installed on the web server? It already is installed on the development computer and is working fine. The actually error message is stopping at the AjaxControlToolkit Register Assembly statement.


Do you have the toolkit DLL as a reference in your web project?
Thanks for that information. I just added a reference and I will check it out tomorrow morning.

AJAX Toolkit CalendarExtender Issue

I am going to write a web application using AJAX Toolkit. In one of the application modules, I have to use calendar control. To meet this requirement I am using CalendarExtender with a TextBox control. I have a problem when I submit the form having this controls combination. The problem is that I am unable to get Text field value after submitting the form. I have written a sample page to make my point cleat to you. Here is the code:


<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
string strDate = "";
strDate = txtCheckinDate.Text;
}

</script>

...

...

<div>

<asp:TextBox ID="txtCheckinDate" runat="server" ReadOnly="True"></asp:TextBox>
<asp:ImageButton ID="btnCalendar" runat="server" AlternateText="Click to show calendar" ImageUrl="~/images/Calendar_scheduleHS.png" />
<div style="font-size: 90%"><em>(Click the image button to open the calendar)</em></div> <br />
<ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" Format="MMMM d, yyyy" PopupButtonID="btnCalendar" Animated="true"
TargetControlID="txtCheckinDate"> </ajaxToolkit:CalendarExtender> <br />

<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /><br />
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

</div>


Would you please help me to find out the cause of problem?

Waiting your kind reply.


I created my own...Works for me. I did notice a few thing.

The ScriptManager must appear before any control that needs it.

Your page should include something like this...

<%@. Register Assembly="AjaxControlToolkit, Version=1.0.10301.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

and your tag prefix should look something like this

 <cc1:CalendarExtender ID="CalendarExtender1" runat="server" Format="MMMM d, yyyy" PopupButtonID="btnCalendar" Animated="true" TargetControlID="txtCheckinDate"> </cc1:CalendarExtender>

I hope that helps.

AJAX to grab a server controls RenderContents() output

Hi everyone,

My web application dynamically loads custom built server controls at runtime from seperate assemblies using the reflection namespace. Everything works fine, and the server controls display on the page as required.

I would like to extend this, to enable the server controls to be displayed asycronously. Is it possible to make an asynronous request to the web server and then when the server control is loaded, pass back the HTML that is generated in the RenderContents() method as the responseText?

How would I go about doing this? Example code would be great.

Any help is much appreciated,
Ad

Hi,

I'm still stuck on this on this one, any ideas?

Thanks again,
Ad


Hi,

Please refer to this:Emailing the Rendered Output of an ASP.NET Web Control, it implements the function you need.

Hope this helps.

NOTE:This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


This link looks like a good start, but a bit more sample code especially on the Ajax part would be very helpful.

Regards

Dion


Hi Dion,What probelms do you have after you've got the output of a control?

Saturday, March 24, 2012

ajax timeout.

What is the default timeout? how do i set default in web.config?

And also how do i get exception in the endrequest?

I am using ajax 1.0.

thanks for all the help.

Hi

Please check this link for answer:Configuring ASP.NET AJAX

Thanks


I could not find any information about setting timeout.. can you please help.


http://ajax.asp.net/docs/mref/P_System_Web_UI_ScriptManager_AsyncPostBackTimeout.aspx


Thanks that helps to some extent ... i would like to set that value in Web.Config is it possible?


maybe something like this:

Web.config
<appSettings>
<add key="AsyncPostBackTimeout" value="900"/>
</appSettings
.aspx
<asp:ScriptManager ID="scrManager" AsyncPostBackTimeout="<%$ AppSettings: AsyncPostBackTimeout %>" runat="server" /
it's not a spacial ajax feature :) but it must work

AJAX Tabs in SharePoint Web Part

Has anyone seen an issue like the one below where the AJAX Tab Control's tabs have a white space when used as part of a web part in SharePoint?

Tabs With Blank Spots


Notice the white space slightly overlapping the text on each tab. Also notice that the white space begins at the tabs left most point, but ends before the right most point. Has anyone else seen this issue and resolved it?

Hello,I have exactly the same problem when I use this AJAX Control in my webpart SharePoint, only with IE (with Firefox the display is good). But when I use this AJAX Control in a page .aspx (not in a webpart) the display is normal with IE and Firefox.Actually I don't success to find a solutionSad If anybody has an advice, I am interestedWink Thank you


The solution we have arrived with is as follows...but you will need to get the Ajax Toolkit with Source Code. (This is not tested in Firefox as we are only supporting IE at the current time!!!!! If you try this with Firefox please post the results back!)

Open the Tabs folder of the Ajax Toolkit and change the tabs.css to be:

/* default layout */
/* .ajax__tab_default .ajax__tab_header {white-space:nowrap;} */ <!-- Remove only if you want to allow the tabs to wrap across multiple lines as well. It actually doesn't look bad. -->
.ajax__tab_default .ajax__tab_outer {display:-moz-inline-box;display:inline-block}
.ajax__tab_default .ajax__tab_inner {display:-moz-inline-box;display:inline-block}
.ajax__tab_default .ajax__tab_tab {margin-right:4px;overflow:hidden;text-align:center;cursor:pointer;display:-moz-inline-box;display:inline-block}

/* xp theme */
.ajax__tab_xp .ajax__tab_header {font-family:verdana,tahoma,helvetica;font-size:10px;background:url(<%=WebResource("AjaxControlToolkit.Tabs.tab-line.gif")%>) repeat-x bottom;}
.ajax__tab_xp .ajax__tab_outer {padding-right:4px;background:url(<%=WebResource("AjaxControlToolkit.Tabs.tab-right.gif")%>) no-repeat right;}
.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:21px;padding:4px;margin:0;background:url(<%=WebResource("AjaxControlToolkit.Tabs.tab.gif")%>) repeat-x;}
.ajax__tab_xp .ajax__tab_hover .ajax__tab_outer {background:url(<%=WebResource("AjaxControlToolkit.Tabs.tab-hover-right.gif")%>) no-repeat right;}
.ajax__tab_xp .ajax__tab_hover .ajax__tab_inner {background:url(<%=WebResource("AjaxControlToolkit.Tabs.tab-hover-left.gif")%>) no-repeat;}
.ajax__tab_xp .ajax__tab_hover .ajax__tab_tab {background:url(<%=WebResource("AjaxControlToolkit.Tabs.tab-hover.gif")%>) repeat-x;}
.ajax__tab_xp .ajax__tab_active .ajax__tab_outer {background:url(<%=WebResource("AjaxControlToolkit.Tabs.tab-active-right.gif")%>) no-repeat right;}
.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:1px solid #999999;padding:8px;background-color:#ffffff;}

/* scrolling */
.ajax__scroll_horiz {overflow-x:scroll;}
.ajax__scroll_vert {overflow-y:scroll;}
.ajax__scroll_both {overflow:scroll}
.ajax__scroll_auto {overflow:auto}

Once you have done this recompile the DLL, link it in and deploy your solution. Also...you may find that if you deploy the Ajax Toolkit as part of a solution into the standard "BIN" directory you may get a 403 Forbidden error until an Administrator logs into the system. If you experience this then deploy the Ajax Toolkit to the GAC, this will resolve the issue.


Thank you for your answer. I will test this monday morning at work !Smile


I had a similar problem. It's not really an issue. It was caused by your stylesheet referencing:

You probably have this:

<%@. Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<link href="http://links.10026.com/?link=StyleSheet.css" rel="stylesheet" type="text/css" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">


Do this instead:

<%@. Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<link href="http://links.10026.com/?link=StyleSheet.css" rel="stylesheet" type="text/css" />

You will be fine.


Notice we are using this as part of a SharePoint (actually MOSS 2007) AJAX enabled Web Part. Since we have no idea where the web part will be deployed (what page) modifying the code on the page is not what we want to do. Instead the modifications within the CSS have allowed us to deploy our web part with the tab control within it and not have to worry about where the CSS refernece appears on the page.


Make sure the doctype is XHTML. That used to occur before I upgraded our app from HTML 4. The toolkit is not 100% compatible with HTML 4. I'm not using SharePoint, but it shouldn't make a difference.


I am having the same problem, and i have compiled your suggestion. It now works in IE, but now the right side of each tab is jacked up in Firefox.


It seems to look just fine on our site.

Our site is a MOSS 2007 site, we have not used this on any other older technologies.


I have not tried any other methods 1) because we needed the issue solved quickly and 2) because we wanted to modify some of the other behaviors like allowing the tabs to wrap. I don't think you will be able to because you cannot get access to the Tab objects to modify their CSS class setting.

On the other hand we believe that we have found the culpret to this issue. Its appears if you ever to a response.write during a page load and have malformed HTML then the issue of the white space occurs, even on ASP.NET sites. We have not dug into the MOSS 2007 page to see where this could be occuring or how to fix it, but it is the most likely source of the issue.

Wednesday, March 21, 2012

AJAX tab control cant find properties

Hi All:

I've had an AJAX enabled web site running for approx. 1 month now. One of my tab controls now prevents me from getting a working build. In Visual Studio 2005 It displays "error creating control: unknown server tag AJAX toolkit.tabControl". My build attempt hilights several hundred errors in my source code where i try to reference any tab control property. Including this

<system.web.ui.control runat="server">

I've looked at my current web.config and system.web.ui.control is not in the assemblys section.

While trying to solve my problem i've uninsatlled, and then re-installed all my AJAX software.

How can I get my website to build again?

TIA

jhh

Hi,

It's likely to be caused by not configuring ajax correctly. Please refer to this document for how to configure ajax:

http://asp.net/ajax/documentation/live/ConfiguringASPNETAJAX.aspx

I'm not sure if it's your typo, the control's class name is TabContainer, rather than tabcontrol.

Ajax support by Web Hosts?

I currently use 1and1.co.uk as my web host on a shared server. i have an asp.net application under development and all is looking good. I would extend the look and feel for my application by using AJAX.

does my web host need to support AJAX or is it part of my application and when compiled will run on my host?

Thanks in advance

Matt A

As of Beta 1 and 2, the AJAX dll is part of the GAC, so a server admin needs to install it on the server, won't work like before where you had the dll in your bin dir.

Basically, you'll have to wait till your host adds AJAX support, which probably won't be till the final version is released...


Hi,

ASP.NET AJAX Beta2 is not a part of .Net Framework2.0,.

We are installing externally, in installation it will add "Microsoft.Web.Extensions.dll","Microsoft.Web.Extensions.Design.dll" to GAC.

Suppose if your webhost is not having AJAX Beta2, how can you run AJAX functionality at host.

If you want to use AJAX functionality there are two ways,

1) At the time of deployment you should add the two DLL to GAC,

2) Webhost must be installed AJAX Beta2

Pradeep Kumar Bura


Has anybody tried just copying the dlls to the bin directory of the website when using a third party web host? Any other workarounds out there?

JDG.


Ajax SlideShow Help

Can Someon help me to convert C# to Vb this web service code from SlideShow example? I already tried conversion tools and it gives me some errors. Thank You All.

<

scriptrunat="Server"type="text/C#">

[System.Web.Services.

WebMethod]

[System.Web.Script.Services.

ScriptMethod]publicstatic AjaxControlToolkit.Slide[] GetSlides()

{

returnnew AjaxControlToolkit.Slide[] {new AjaxControlToolkit.Slide("images/Blue hills.jpg","Blue Hills","Go Blue"),new AjaxControlToolkit.Slide("images/Sunset.jpg","Sunset","Setting sun"),new AjaxControlToolkit.Slide("images/Winter.jpg","Winter","Wintery..."),new AjaxControlToolkit.Slide("images/Water lilies.jpg","Water lillies","Lillies in the water"),new AjaxControlToolkit.Slide("images/VerticalPicture.jpg","Sedona","Portrait style picture")};

}

</script>

<System.Web.Services.WebMethod()> _

<System.Web.Script.Services.ScriptMethod()> _

PublicSharedFunction GetPictures()As AjaxControlToolkit.Slide()ReturnNew AjaxControlToolkit.Slide() { _New AjaxControlToolkit.Slide("images/Blue hills.jpg","Blue Hills","Go Blue"), _New AjaxControlToolkit.Slide("images/Sunset.jpg","Sunset","Setting sun"), _New AjaxControlToolkit.Slide("images/Winter.jpg","Winter","Wintery..."), _New AjaxControlToolkit.Slide("images/Water lilies.jpg","Water lillies","Lillies in the water"), _New AjaxControlToolkit.Slide("images/VerticalPicture.jpg","Sedona","Portrait style picture")}

End

Function

Ken Tucker:

<System.Web.Services.WebMethod()> _

<System.Web.Script.Services.ScriptMethod()> _

PublicSharedFunction GetPictures()As AjaxControlToolkit.Slide()

ReturnNew AjaxControlToolkit.Slide() { _

New AjaxControlToolkit.Slide("images/Blue hills.jpg","Blue Hills","Go Blue"), _

New AjaxControlToolkit.Slide("images/Sunset.jpg","Sunset","Setting sun"), _

New AjaxControlToolkit.Slide("images/Winter.jpg","Winter","Wintery..."), _

New AjaxControlToolkit.Slide("images/Water lilies.jpg","Water lillies","Lillies in the water"), _

New AjaxControlToolkit.Slide("images/VerticalPicture.jpg","Sedona","Portrait style picture")}

EndFunction

Thank You Ken.


Ken Tucker:

<System.Web.Services.WebMethod()> _

<System.Web.Script.Services.ScriptMethod()> _

PublicSharedFunction GetPictures()As AjaxControlToolkit.Slide()ReturnNew AjaxControlToolkit.Slide() { _New AjaxControlToolkit.Slide("images/Blue hills.jpg","Blue Hills","Go Blue"), _New AjaxControlToolkit.Slide("images/Sunset.jpg","Sunset","Setting sun"), _New AjaxControlToolkit.Slide("images/Winter.jpg","Winter","Wintery..."), _New AjaxControlToolkit.Slide("images/Water lilies.jpg","Water lillies","Lillies in the water"), _New AjaxControlToolkit.Slide("images/VerticalPicture.jpg","Sedona","Portrait style picture")}

End

Function

How can I populate this array dynamically? For example, Read some folder with images and create an array?

ForEach sIn Directory.GetFiles(Server.MapPath("my_vacation"),"*.jpg")

Response.write ( Path.GetFileName(s) )

Next


I saw that you answered the dynamic file issue with

ForEach sIn Directory.GetFiles(Server.MapPath("my_vacation"),"*.jpg")

Response.write ( Path.GetFileName(s) )

Next

But how do I get it to dynamically use a value from an SQL table field.

My images have names such as R12345.jpg, R12345_2.jpg, R12345_3.jpg etc...

The listing_id field value is R12345 which would need to replace the "my_vacation" above.

How can I get this to work?

Thanks for your help!

Mike


Imports System.IO
Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
MyData.ImagePath = Server.MapPath("~/Images")
Dim strUrl As String = Request.Url.ToString

MyData.Url = strUrl.Substring(0, strUrl.LastIndexOf("/")) & "/Images/"
End Sub


<System.Web.Services.WebMethod()> _
<System.Web.Script.Services.ScriptMethod()> _
Public Shared Function GetPictures() As AjaxControlToolkit.Slide()
Dim di As New DirectoryInfo(MyData.ImagePath)
Dim s(di.GetFiles.Length - 1) As AjaxControlToolkit.Slide
Dim x As Integer = 0
For Each fi As FileInfo In di.GetFiles()
s(x) = New AjaxControlToolkit.Slide(MyData.Url & fi.Name, "", Path.GetFileNameWithoutExtension(fi.Name))
x += 1
Next
Return s
End Function
End Class

Public Class MyData
Private Shared _Path As String
Private Shared _Url As String

Public Shared Property ImagePath() As String
Get
Return _Path
End Get
Set(ByVal value As String)
_Path = value
End Set
End Property

Public Shared Property Url() As String
Get
Return _Url
End Get
Set(ByVal value As String)
_Url = value
End Set
End Property
End Class


AWESOME!

How can I get it to retrieve images at a url other that mine, such as:

http://www.xyz.com/images

Thanks,

Mike


If you have ftp access to the images you can try something like this.

<System.Web.Services.WebMethod()> _
<System.Web.Script.Services.ScriptMethod()> _
Public Shared Function GetFtpPictures() As AjaxControlToolkit.Slide()
Dim ftp As FtpWebRequest = WebRequest.Create("ftp://ftp.xyz.com/images")
ftp.Credentials = New NetworkCredential("YourUserName", "YourPassword")
ftp.Method = WebRequestMethods.Ftp.ListDirectory
Dim wr As WebResponse =ftp.GetResponse
Dim sr As New StreamReader(wr.GetResponseStream)
Dim lst As New List(Of String)
Do While sr.Peek > 0
Dim strOut As String
strOut = sr.ReadLine
lst.Add(strOut)
Loop
Dim s(lst.Count - 1) As AjaxControlToolkit.Slide
Dim x As Integer = 0
For Each str As String In lst
Dim i As Integer = str.IndexOf("."c)
s(x) = New AjaxControlToolkit.Slide("http://www.xyz.com/images/" & str, "", str.Substring(0, i))
x += 1
Next
Return s
End Function

Article on how to use photos stored in Flickr in a slide show

http://www.onteorasoftware.com/blog.aspx?BlogID=75


pashaKasim this site may help you. You may already know about it, but there might be someone out there who hasnt run across this tool yet.

http://www.developerfusion.co.uk/utilities/convertcsharptovb.aspx

J


Really usefull piece of code.I would like to use a slider control to move across page.For that to be implemented i need to move to the Nth image.Is there a method / way to move to the Nth image.ThanksRain Man Alex

Ajax Slideshow from Database

I have a web application with a database that stores, among other things, productname, description, and imagefilename.

i have been beating my head against the wall trying to write javascript or a web service to populate an Ajax slideshow using that data.

Can anyone steer me out of this dead end?

Thanks in advance for any help.

I am currently working on a similiar project. I am not sure if I am doing things 100% correctly, but I basically followed the examples in the Toolkit. I populate the AjaxControlToolkit.Slide objects individually from the filename and then create an array AjaxControlToolkit.Slide[] full of these objects and return it via the GetSlides() web service. Hopefully you will know how to get the data out of your particular database and populate the slide objects.

I personally wrote wrappers SlideShowDocuments for my slide internal data mostly because I needed to keep track of which slide was on the screen at a time, and I didn't want to use a hack with the description fields. Inside the SlideShowDocuments object is where I connect to the Database and create the prepared information for the Slide objects.

I basically used the contextKey to create the SQL to select the appropriate rows. Then I move the information and formatted the filename into my internal structure for a SlideShowDocument object.

You shouldn't HAVE to write any Javascript, the SlideShowExtender does all the work for you! Here is how I went about it... hope this helps!

[System.Web.Services.WebMethod]

[System.Web.Script.Services.ScriptMethod]publicstatic AjaxControlToolkit.Slide[] GetSlides(string contextKey)

{

SlideShowDocuments _slideShowDocuments =newSlideShowDocuments(contextKey);

_slideArray =new AjaxControlToolkit.Slide[_slideShowDocuments.Count];

for (int i = 0; i < _slideShowDocuments.Count; i++)

{

_slideArray[i] =new AjaxControlToolkit.Slide(_slideShowDocuments[i].Filename,"","");

}

return _slideArray;

}


Thank you for your advice. I actually stumbled across another post on the forum that really did the trick for me and may be helpful to you too.

http://forums.asp.net/p/1115257/1728447.aspx#1728447

Thanks for taking time to reply.

Steve