Showing posts with label project. Show all posts
Showing posts with label project. Show all posts

Wednesday, March 28, 2012

AJAX UpdatePanel and Validators - Framework Updated?

Hi Folks,

I bumped into the updatepanel/validator control issue yesterday and solved the problem by grabbing the updated validators project as per the pinned post at the top of this forum (http://forums.asp.net/t/1066821.aspx).

That said, in the post and in Scott Guthrie's blog there is mention of an official patch to ASP.NET 2.0 to fix this issue which would go out via windows update. Did this ever happen? My own dev box certainly doesn't seem to be fixed (hence having to use the compatibility validators downloaded from mattgi's site).

Cheers

Kev

I think it has because I do not have the Validator issue and I am not using the Validator library anymore. But do not hold me to it, I may have just prayed real hard for effective validation. I also like the MaskedEditValidator control too, you should check it out.


I feel like a real shoe for using someone elses code and not understanding what it's doing...

I hope I can find time to view this guys source... :(


Wow, this actually did not fix my issue -- but I know I'm using validators in the an updatepanel an getting the same issue. Grrr...


Hello.

if i'm not mistaken, you'll only get compatible validators on the 3.5 framework since the validators of 2.0 were never updated to be compatible with the updatepanel.

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,

Monday, March 26, 2012

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 dragdropmanager

Hello, I'm using Ajax toolkit in my project.

I have written own extender for drag and drop procedure.

Everything is fine, except that images that is located in target control doesn't fire onlick event.

Seems like, dragdropmanager disable this event on page load. Any workarounds?

thanks in advance.

Hi,

the DragDropManager doesn't disable any events of DOM elements. Could you explain in more detail your scenario? Are the images the draggable items?

AJAX TOOLKIT

Im just wondering, is the ajax toolkit compatible with asp.net 1.0?

im using vb.net 2003

im planning to use it for my project. the autocomplete function..

if anyone could answer, it would help me a lot

thanks!

I do not think so, since it is built on the 2.0 framework.

Ajax timercontrol - ie6 freezes with high cpu over long period of time

Hi,

I'm using Ajax for ASP.NET (2.0) on a project. In this project I use the ajax timer control to refresh contents of an update panel.
The panel refresh happens every minute. (the content of the panel consists of information that is pulled out of a database).

All works fine so far, except that I noticed to have big issue with my pages. The page with the timer & updatepanel is opened continously for literally days. (so we could speak of long user sessions), and each minute it is refreshing.

When loaded in ie6 (I didn't try another browser, but ie6 is still the standard in my company, so no other choices), after a while, I start noticing a constant CPU load on the iexplore.exe process, and I don't mean during refresh, just while the page is static & not updating/refreshing. It starts of at 0%, then after half an hour, it's at 1%, a bit later 2% and so on...
After lots of hours (like one working day), I end up with an internet explorer session that is continously using as much CPU as it can have. And most of the time, ie6 just got frozen and isn't doing anything.

This is so bad. I made sure I stopped the timer before doing the updating & then restart the timer to avoid any problems in this area, but it still exists.

Did anyone notice this as well? Is there some kind of cure for it? Or am I doing anything wrong here?

Thanks!!

Here's a related post:http://forums.asp.net/p/1009453/1367209.aspx

-Damien


As suggested in that topic I have moved the ajax timer control & the progress bar out of the update panel, I have set the update panel trigger to the timer tick event.

I also disable the timer before refreshing & enable it again afterwards:

protected void tmrRefresh_Tick(object sender, EventArgs e)
{
tmrRefresh.Enabled =false;
((BasePage)Page).Refresh();
tmrRefresh.Enabled =true;
}

The timer interval is set at 1 minute

still I have this increasing CPU load (really little, but it exists) over time, like + 1% every hour (just when the page is static).

What is going on here? Any help?

EDIT: I'd like to add that all things mentioned in the topic you posted belong to the atlas extensions. I'm not using those, I'm using the Ajax 1.0 extensions...


Atlas was the pre-release name of ASP.NET AJAX 1.0; much of the content still holds true...

Your problem sounds like this issue is a leak with IE6 and JavaScript; did you try with IE7?

-Damien


I know that Atlas preceded Ajax extensions, I only wanted to make sure what I was using. I can imagine some stuff was changed from Atlas to Ajax...
As told in my initial post, ie6 is still the standard browser in our company, so trying ie7 will not help me.

But... I created a very simple ajax enabled web application today with just a timer that refreshes a text label every 5 seconds. The label held the current date & time.
I let it run for half a day and no constant CPU load whatshowever.

Does this mean that the increasing CPU stuff is hiding somewhere else, in the refresh procedure of my project?
If so, then why does a client gets a constant CPU load even when the page is not refreshing.
I thought the only thing that would happen on client side was waiting for the next timer tick... or am I wrong?


I don't know who accepted Damien's post as answer, but this problem is still open and I have yet to find a solution...Surprise

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

Wednesday, March 21, 2012

AJAX TabContainer bold font issue

Just a little background. I have used the AJAX TabContainer in one of my previous project - begining of 2007 and had no issues with it whatsoever. I have started a new project and tried using the TabContainer and I am having yeoman amount of problems. I have a TabContainer with a few tabpanels. The TabPanels have a contentTemplate and no HeaderTemplate(s). Within the first tab I have a set of two tables and on the second tab I have a gridview and two detailView controls. No where in my code I am using a stylesheet or a style tag - so i am not specifying the font size - but ALL the controls within the tab panels are being rendered bold and large fonts. I have tried everything but to no avail and I am hoping someone can point me the right direction. Here's my code snippet. Any help would be mucho appreciated with a lot of gracias.

<asp:ContentContentPlaceHolderID="ContentPlaceHolder2"ID="Content1"runat="server">

<divstyle="background-color:#006400;color:white;font-family:@dotnet.itags.org.Arial Unicode MS"> Referadex Prospect Dashboard</div>

<ajax:TabContainerrunat="server"ID="main"ActiveTabIndex="0">

<ajax:TabPanelID="prospects"runat="server"HeaderText="Prospect Management">

<ContentTemplate>

<ajax:TabContainerid="prospectManagement"runat="server"ActiveTabIndex="0">

<ajax:TabPanelrunat="server"HeaderText="Add Prospects"ID="Add">

<ContentTemplate>

<table>

<tr>

<tdvalign="top">

<table>

<tr>

<divstyle="background-color:#006400;color:white;font-family:@dotnet.itags.org.Arial Unicode MS;Text-align:center">Prospects</div>

</tr>

<tr>

<tdstyle="font-size:small;">Company Name

</td>

<td>

<asp:TextBoxID="txtCompanyName"runat="server"Width="250px"/>

</td>

</tr>

<tr>

<td>Industry

</td>

<td>

<asp:DropDownListID="ddlIndustry"DataSourceID="industrysource"DataTextField="IndustryName"

runat="server"DataValueField="value"Width="250px"/>

</td>

</tr>

<tr>

<td>Address1

</td>

<td>

<asp:TextBoxID="txtAddr1"runat="server"Width="250px"/>

</td>

</tr>

<tr>

<td>Address2

</td>

<td>

<asp:TextBoxID="txtAddr2"runat="server"Width="250px"/>

</td>

</tr>

<tr>

<td>City

</td>

<td>

<asp:TextBoxID="txtCity"runat="server"Width="250px"/>

</td>

</tr>

<tr>

<td>State

</td>

<td>

<asp:DropDownListID="ddlState"runat="server"

DataSourceID="states"DataTextField="Name"

DataValueField="Value"Width="250px"/>

</td>

</tr>

<tr>

<td>Zip

</td>

<td>

<asp:TextBoxID="txtZip"runat="server"Width="250px"/>

</td>

</tr>

<tr>

<td>Country

</td>

<td>

<asp:DropDownListID="ddlCountry"runat="server"

DataSourceID="countries"DataTextField="Name"

DataValueField="Value"Width="250px"/>

</td>

</tr>

<tr>

<td>Phone1

</td>

<td>

<asp:TextBoxID="txtPhone1"runat="server"Width="250px"/>

</td>

</tr>

<tr>

<td>Phone2

</td>

<td>

<asp:TextBoxID="txtPhone2"runat="server"width="250px"/>

</td>

</tr>

<tr>

<td>Fax1

</td>

<td>

<asp:TextBoxID="txtFax1"runat="server"width="250px"/>

</td>

</tr>

<tr>

<td>Fax2

</td>

<td>

<asp:TextBoxID="txtFax2"runat="server"width="250px"/>

</td>

</tr>

<tr>

<td>Website

</td>

<td>

<asp:TextBoxID="txtWebsite"runat="server"Width="250px"/>

</td>

</tr>

</table>

</td>

<tdvalign="top">

<table>

<tr>

</tr>

</table>

<table>

<tr>

<divstyle="background-color:#006400;color:white;font-family:@dotnet.itags.org.Arial Unicode MS;Text-align:center">Contacts</div>

</tr>

<tr>

<td>First Name

</td>

<td>

<asp:TextBoxID="txtFirstName"runat="server"Width="250px"/>

</td>

</tr>

<tr>

<td>Last Name

</td>

<td>

<asp:TextBoxID="txtLastName"runat="server"Width="250px"/>

</td>

</tr>

<tr>

<td>Position

</td>

<td>

<asp:DropDownListID="ddlPosition"DataSourceID="positions"DataTextField="positionName"

DataValueField="value"runat="server"Width="250px"/>

</td>

</tr>

<tr>

<td>Direct Phone

</td>

<td>

<asp:TextBoxID="txtPhone"runat="server"Width="250px"/>

</td>

</tr>

<tr>

<td>Extension

</td>

<td>

<asp:TextBoxID="txtExtension"runat="server"Width="250px"/>

</td>

</tr>

<tr>

<td>Mobile Phone

</td>

<td>

<asp:TextBoxID="txtMobile"runat="server"Width="250px"/>

</td>

</tr>

<tr>

<td>Fax

</td>

<td>

<asp:TextBoxID="txtFax"runat="server"Width="250px"/>

</td>

</tr>

<tr>

<td>Email

</td>

<td>

<asp:TextBoxID="txtEmail"runat="server"Width="250px"/>

</td>

</tr>

<tr>

<td>Years with company

</td>

<td>

<asp:TextBoxID="txtYearswithcompany"runat="server"Width="250px"/>

</td>

</tr>

<tr>

<td>Decision Process

</td>

<td>

<asp:DropDownListID="ddlDecisionProcess"runat="server"DataSourceID="DecisionProcess"

DataTextField="decisionname"DataValueField="value"Width="250px"/>

</td>

</tr>

<tr>

<td>Relationship Type

</td>

<td>

<asp:DropDownListID="ddlRelationshipType"runat="server"

DataSourceID="RelationshipType"DataTextField="relationName"DataValueField="value"

Width="250px"/>

</td>

</tr>

<tr>

<td>

</td>

<td>

<asp:ButtonID="btnEmptyContact"runat="server"Text="Add Prospect"OnClick="AddCompany"/>

</td>

</tr>

</table>

<asp:LabelID="lblMessage"runat="server"ForeColor="Red"Text="Label"Visible="False"></asp:Label></td>

</tr>

<tr>

</tr>

</table>

<table>

<tr>

<divstyle="background-color:#006400;color:white;font-family:@dotnet.itags.org.Arial Unicode MS;Text-align:center">Notes</div>

</tr>

<tr>

<td>Notes Desription

</td>

<td>

<asp:TextBoxID="txtShortNotes"runat="server"Width="250px"/>

</td>

</tr>

<tr>

<td>Long Notes

</td>

<td>

<asp:TextBoxID="txtLongNotes"runat="server"TextMode="MultiLine"Width="250px"/>

</td>

</tr>

<tr>

<td>Remind me on

</td>

<td>

<asp:TextBoxID="txtCalendar"runat="server"Width="250px"/>

</td>

</tr>

<tr>

<td>Reminder Text

</td>

<td>

<asp:TextBoxID="txtReminder"runat="server"Width="250px"/>

</td>

</tr>

</table>

</ContentTemplate>

</ajax:TabPanel>

<ajax:TabPanelID="View"HeaderText="View Prospects"runat="server">

<ContentTemplate>

<table>

<tr>

<tdvalign="top"colspan="2"style="width: 610px">

<asp:GridViewID="gvProspects"runat="server"AllowPaging="True"AutoGenerateColumns="False"

AutoGenerateSelectButton="True"CellPadding="2"ForeColor="#333333"GridLines="None"

DataSourceID="ProspectsDS"BorderWidth="1px"DataKeyNames="companyId">

<FooterStyleBackColor="#507CD1"Font-Bold="True"ForeColor="White"/>

<RowStyleBackColor="#EFF3FB"/>

<PagerStyleBackColor="#2461BF"ForeColor="White"HorizontalAlign="Center"/>

<SelectedRowStyleBackColor="#D1DDF1"Font-Bold="True"ForeColor="#333333"/>

<HeaderStyleBackColor="#507CD1"Font-Bold="True"ForeColor="White"/>

<EditRowStyleBackColor="#2461BF"/>

<AlternatingRowStyleBackColor="White"/>

<Columns>

<asp:BoundFieldHeaderText="Company Name"DataField="companyName"/>

<asp:BoundFieldHeaderText="Industry"DataField="industry"/>

<asp:BoundFieldHeaderText="Phone1"DataField="Phone1"/>

<asp:BoundFieldHeaderText="Phone2"DataField="Phone2"/>

<asp:BoundFieldHeaderText="Fax1"DataField="fax1"/>

<asp:BoundFieldHeaderText="Fax2"DataField="fax2"/>

<asp:BoundFieldHeaderText="Website"DataField="website"/>

</Columns>

</asp:GridView>

</td>

</tr>

<tr>

<td>

<asp:DetailsViewID="dvContacts"runat="server"CellPadding="4"ForeColor="#333333"

GridLines="None"HeaderText="Contacts"AutoGenerateRows="False"AllowPaging="True"

AutoGenerateEditButton="True"AutoGenerateInsertButton="True"DataSourceID="ContactDS"

DataKeyNames="companycontactId">

<FooterStyleBackColor="#5D7B9D"Font-Bold="True"ForeColor="White"/>

<CommandRowStyleBackColor="#E2DED6"Font-Bold="True"/>

<RowStyleBackColor="#F7F6F3"ForeColor="#333333"/>

<FieldHeaderStyleBackColor="#E9ECF1"Font-Bold="True"/>

<PagerStyleBackColor="#284775"ForeColor="White"HorizontalAlign="Center"/>

<HeaderStyleBackColor="#5D7B9D"Font-Bold="True"ForeColor="White"/>

<EditRowStyleBackColor="#999999"/>

<AlternatingRowStyleBackColor="White"ForeColor="#284775"/>

<Fields>

<asp:TemplateFieldHeaderText="First Name">

<ItemTemplate>

<asp:LiteralID="Literal1"runat="Server"Text='<%# Eval("firstname") %>'/>

</ItemTemplate>

<EditItemTemplate>

<asp:TextBoxID="txtFirstName"runat="server"Text='<%# Bind("firstName") %>'/>

</EditItemTemplate>

<InsertItemTemplate>

<asp:TextBoxID="txtFirstName"runat="Server"Text='<%# Bind("firstName") %>'/>

</InsertItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Last Name">

<ItemTemplate>

<asp:LiteralID="Literal2"runat="Server"Text='<%# Eval("lastName") %>'/>

</ItemTemplate>

<EditItemTemplate>

<asp:TextBoxID="txtLastName"runat="Server"Text='<%# Bind("lastName") %>'/>

</EditItemTemplate>

<InsertItemTemplate>

<asp:TextBoxID="txtLastName"runat="Server"Text='<%# Bind("lastName") %>'/>

</InsertItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Position">

<ItemTemplate>

<asp:LiteralID="Literal3"runat="server"Text='<%# Eval("position") %>'/>

</ItemTemplate>

<EditItemTemplate>

<asp:DropDownListID="ddlPositions"runat="Server"DataSourceID="Positions"

DataTextField="positionName"DataValueField="value"SelectedValue='<%# Bind("position") %>'/>

</EditItemTemplate>

<InsertItemTemplate>

<asp:DropDownListID="ddlPositions"runat="Server"DataSourceID="Positions"

DataTextField="positionName"DataValueField="value"SelectedValue='<%# Bind("position") %>'/>

</InsertItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Direct Phone">

<ItemTemplate>

<asp:LiteralID="Literal4"runat="Server"Text='<%# Eval("Phone") %>'/>

</ItemTemplate>

<EditItemTemplate>

<asp:TextBoxID="txtDirectPhone"runat="Server"Text='<%# Bind("Phone") %>'/>

</EditItemTemplate>

<InsertItemTemplate>

<asp:TextBoxID="txtDirectPhone"runat="Server"Text='<%# Bind("Phone") %>'/>

</InsertItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Extension">

<ItemTemplate>

<asp:LiteralID="Literal5"runat="server"Text='<%# Eval("extension") %>'/>

</ItemTemplate>

<EditItemTemplate>

<asp:TextBoxID="txtExtension"runat="Server"Text='<%# Bind("extension") %>'/>

</EditItemTemplate>

<InsertItemTemplate>

<asp:TextBoxID="txtExtension"runat="Server"Text='<%# Bind("extension") %>'/>

</InsertItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Mobile Phone">

<ItemTemplate>

<asp:LiteralID="txtMobilePhone"runat="Server"Text='<%# Eval("mobile") %>'/>

</ItemTemplate>

<EditItemTemplate>

<asp:TextBoxID="txtMobilePhone"runat="server"Text='<%# Bind("mobile") %>'/>

</EditItemTemplate>

<InsertItemTemplate>

<asp:TextBoxID="txtMobilePhone"runat="server"Text='<%# Bind("mobile") %>'/>

</InsertItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Direct Fax">

<ItemTemplate>

<asp:LiteralID="Literal5"runat="Server"Text='<%# Eval("Fax") %>'/>

</ItemTemplate>

<EditItemTemplate>

<asp:TextBoxID="txtDirectFax"runat="Server"Text='<%# Bind("Fax") %>'/>

</EditItemTemplate>

<InsertItemTemplate>

<asp:TextBoxID="txtDirectFax"runat="Server"Text='<%# Bind("directFax") %>'/>

</InsertItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Email">

<ItemTemplate>

<asp:LiteralID="Literal6"runat="Server"Text='<%# Eval("email") %>'/>

</ItemTemplate>

<EditItemTemplate>

<asp:TextBoxID="txtEmail"runat="Server"Text='<%# Bind("email") %>'/>

</EditItemTemplate>

<InsertItemTemplate>

<asp:TextBoxID="txtEmail"runat="Server"Text='<%# Bind("email") %>'/>

</InsertItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Years with Company">

<ItemTemplate>

<asp:LiteralID="Literal7"runat="Server"Text='<%# Eval("yearswithcompany") %>'/>

</ItemTemplate>

<EditItemTemplate>

<asp:TextBoxID="txtYearsWithCompany"runat="Server"Text='<%# Bind("yearswithcompany") %>'/>

</EditItemTemplate>

<InsertItemTemplate>

<asp:TextBoxID="txtYearsWithCompany"runat="Server"Text='<%# Bind("yearswithcompany") %>'/>

</InsertItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Decision Process">

<ItemTemplate>

<asp:LiteralID="Literal8"runat="Server"Text='<%# Eval("decisionprocess") %>'/>

</ItemTemplate>

<EditItemTemplate>

<asp:DropDownListID="ddlDecisionProcess"runat="Server"DataSourceID="DecisionProcess"

DataTextField="decisionname"DataValueField="value"SelectedValue='<%# Bind("decisionprocess") %>'/>

</EditItemTemplate>

<InsertItemTemplate>

<asp:DropDownListID="ddlDecisionProcess"runat="Server"DataSourceID="DecisionProcess"

DataTextField="decisionname"DataValueField="value"SelectedValue='<%# Bind("decisionprocess") %>'/>

</InsertItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Relationship Type">

<ItemTemplate>

<asp:LiteralID="Literal9"runat="Server"Text='<%# Eval("relationshiptype") %>'/>

</ItemTemplate>

<EditItemTemplate>

<asp:DropDownListID="ddlRelationshipType"runat="Server"

DataSourceID="RelationshipType"DataTextField="relationName"DataValueField="value"

SelectedValue='<%# Bind("relationshiptype") %>'/>

</EditItemTemplate>

<InsertItemTemplate>

<asp:DropDownListID="ddlRelationshipType"runat="Server"

DataSourceID="RelationshipType"DataTextField="relationName"DataValueField="value"

SelectedValue='<%# Bind("relationshiptype") %>'/>

</InsertItemTemplate>

</asp:TemplateField>

</Fields>

</asp:DetailsView>

</td>

<td>

<asp:DetailsViewID="dvContactNotes"HeaderText="Contact Notes"runat="server"

BackColor="White"BorderColor="#E7E7FF"BorderStyle="None"BorderWidth="1px"CellPadding="3"

GridLines="Horizontal"AllowPaging="True"AutoGenerateRows="False"AutoGenerateEditButton="True"

AutoGenerateInsertButton="True"DataSourceID="notesDS">

<FooterStyleBackColor="#B5C7DE"ForeColor="#4A3C8C"/>

<RowStyleBackColor="#E7E7FF"ForeColor="#4A3C8C"/>

<PagerStyleBackColor="#E7E7FF"ForeColor="#4A3C8C"HorizontalAlign="Right"/>

<HeaderStyleBackColor="#4A3C8C"Font-Bold="True"ForeColor="#F7F7F7"/>

<EditRowStyleBackColor="#738A9C"Font-Bold="True"ForeColor="#F7F7F7"/>

<AlternatingRowStyleBackColor="#F7F7F7"/>

<Fields>

<asp:TemplateFieldHeaderText="Notes Description">

<ItemTemplate>

<asp:LiteralID="Literal10"runat="Server"Text='<%# Eval("shortNotes") %>'/>

</ItemTemplate>

<EditItemTemplate>

<asp:TextBoxID="txtNotesDesc"runat="server"Text='<%# Bind("shortNotes") %>'/>

</EditItemTemplate>

<InsertItemTemplate>

<asp:TextBoxID="txtNotesDesc"runat="server"Text='<%# Bind("shortNotes") %>'/>

</InsertItemTemplate>

</asp:TemplateField>

<asp:TemplateFieldHeaderText="Notes">

<ItemTemplate>

<asp:LiteralID="Literal11"runat="server"Text='<%# Eval("notes") %>'/>

</ItemTemplate>

<EditItemTemplate>

<asp:TextBoxID="txtNotes"runat="Server"Text='<%# Bind("longnotes") %>'TextMode="MultiLine"/>

</EditItemTemplate>

<InsertItemTemplate>

<asp:TextBoxID="txtNotes"runat="Server"Text='<%# Bind("longNotes") %>'TextMode="MultiLine"/>

</InsertItemTemplate>

</asp:TemplateField>

</Fields>

<EmptyDataTemplate>

<table>

<trvalign="top">

<divstyle="background-color:#006400;color:white;font-family:@dotnet.itags.org.Arial Unicode MS;Text-align:center">Notes</div>

</tr>

<tr>

<td>Notes Desription

</td>

<td>

<asp:TextBoxID="txtENShortNotes"runat="Server"width="250"/>

</td>

</tr>

<tr>

<td>Long Notes

</td>

<td>

<asp:TextBoxID="txtENLongNotes"runat="server"TextMode="MultiLine"width="250"/>

</td>

</tr>

<tr>

<td>Remind me on

</td>

<td>

<asp:TextBoxID="txtENCalendar"runat="Server"width="250"/>

</td>

</tr>

<tr>

<td>Reminder Text

</td>

<td>

<asp:TextBoxID="txtENReminderText"runat="Server"width="250"/>

</td>

</tr>

<tr>

<td>

</td>

<td>

<asp:ButtonID="btnENAdd"Text="Add Notes"runat="Server"width="250"/>

</td>

</tr>

</table>

</EmptyDataTemplate>

</asp:DetailsView>

</td>

</tr>

</table>

</ContentTemplate>

</ajax:TabPanel>

</ajax:TabContainer>

</ContentTemplate>

</ajax:TabPanel>

<ajax:TabPanelID="opportunities"runat="server"HeaderText="Opportunity Management">

</ajax:TabPanel>

<ajax:TabPanelID="Marketing"runat="server"HeaderText="Marketing">

</ajax:TabPanel>

</ajax:TabContainer>

<%------------- DATA SOURCES --------------%>

<asp:SqlDataSourceID="prospectsDS"ConnectionString='<%$ ConnectionStrings:ReferralRev %>'runat="Server"

SelectCommand="Select * from dbo.company where IsSubscriber = 0">

</asp:SqlDataSource>

<asp:SqlDataSourceID="contactDS"ConnectionString='<%$ ConnectionStrings:ReferralRev %>'runat="server"

SelectCommand="Select * from companyContact where companyId = @dotnet.itags.org.companyId"

InsertCommandType="StoredProcedure"InsertCommand="dbo.InsertCompanyContact"

UpdateCommandType="StoredProcedure"UpdateCommand="dbo.UpdateCompanyContact">

<SelectParameters>

<asp:ControlParameterControlID="ctl00$ContentPlaceHolder2$main$prospects$prospectManagement$View$gvProspects"

PropertyName="SelectedValue"Name="companyId"/>

</SelectParameters>

<InsertParameters>

<asp:ParameterName="companycontactId"/>

<asp:ParameterName="companyId"/>

<asp:ParameterName="firstname"/>

<asp:ParameterName="lastname"/>

<asp:ParameterName="phone"/>

<asp:ParameterName="extension"/>

<asp:ParameterName="mobile"/>

<asp:ParameterName="fax"/>

<asp:ParameterName="email"/>

<asp:ParameterName="yearswithcompany"/>

<asp:ParameterName="position"/>

<asp:ParameterName="decisionprocess"/>

<asp:ParameterName="relationshiptype"/>

<asp:ParameterName="createuser"/>

</InsertParameters>

<UpdateParameters>

<asp:ParameterName="companycontactId"/>

<asp:ParameterName="companyId"/>

<asp:ParameterName="firstname"/>

<asp:ParameterName="lastname"/>

<asp:ParameterName="phone"/>

<asp:ParameterName="extension"/>

<asp:ParameterName="mobile"/>

<asp:ParameterName="fax"/>

<asp:ParameterName="email"/>

<asp:ParameterName="yearswithcompany"/>

<asp:ParameterName="position"/>

<asp:ParameterName="decisionprocess"/>

<asp:ParameterName="relationshiptype"/>

<asp:ParameterName="modifyUser"/>

</UpdateParameters>

</asp:SqlDataSource>

<asp:SqlDataSourceID="notesDS"ConnectionString='<%$ ConnectionStrings:ReferralRev %>'

SelectCommand="select * from notes where userId = @dotnet.itags.org.userId"runat="server"OnInserting="AddNotes"

OnUpdating="UpdateNotes"InsertCommand="dbo.InsertNotes"InsertCommandType="StoredProcedure"

UpdateCommand="dbo.UpdateNotes"UpdateCommandType="StoredProcedure">

<SelectParameters>

<asp:ControlParameterName="userId"ControlID="ctl00$ContentPlaceHolder2$main$prospects$prospectManagement$View$dvContacts"

PropertyName="SelectedValue"/>

</SelectParameters>

</asp:SqlDataSource>

<%-------------- XML DATA SOURCES ------------%>

<asp:XmlDataSourceID="countries"runat="server"DataFile="~/Resources/Countries.xml"></asp:XmlDataSource>

<asp:XmlDataSourceID="states"runat="server"DataFile="~/Resources/states.xml"></asp:XmlDataSource>

<asp:XmlDataSourceID="Positions"runat="server"DataFile="~/Resources/Positions.xml"></asp:XmlDataSource>

<asp:XmlDataSourceID="DecisionProcess"runat="server"DataFile="~/Resources/DecisionProcess.xml"></asp:XmlDataSource>

<asp:XmlDataSourceID="RelationshipType"runat="server"DataFile="~/Resources/RelationshipType.xml"></asp:XmlDataSource>

<asp:ScriptManagerid="ScriptManager1"runat="server">

</asp:ScriptManager>

<asp:XmlDataSourceID="industrySource"runat="server"DataFile="~/Resources/Industry.xml"></asp:XmlDataSource>

<ajax:CalendarExtenderid="CalendarExtender1"runat="server"TargetControlID="txtCalendar"OnResolveControlID="CalendarExtender1_ResolveControlID">

</ajax:CalendarExtender>

<ajax:CalendarExtenderid="CalendarExtender2"runat="server"TargetControlID="txtENCalendar"OnResolveControlID="CalendarExtender1_ResolveControlID">

</ajax:CalendarExtender>

</asp:Content>

Well, I solved my own problem (it is not a solution but a hack, but so be it). You CANNOT put a AJAX TabContainer control within a the <asp:Content></asp:Content> tag. If you do - do so at your own peril. Since I am developing for Internet Explorer I used an IFrame and used the src property of IFrame to point to an aspx page. Within this page I put the TabContainer control and the font issue has disappeared for now. I will keep my fingers crossed......

Happy AJAXing ;-)

AJAX Slideshow using a dynamic Webservice to display images

Hi there,

I have just managed to get the example slideshow working within my own project. I would like to take it a step further by using a database and a folder within my site to display selected images.

Let me try explain.

For the ease of explaining things lets say a user adds their UserID into a textbox and pressing a button. I then have a select statement that gets all the image names for that user. The webmethod then uses those names from the SELECT statement to loop through the folder which contains the images and then displays the images within the slideshow.

The current web method looks like this

public static AjaxControlToolkit.Slide[] GetSlides() {return new 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")}; }

As you can see everything is hard coded with the images and the comments and names.

Has anyone done something like this before?

Any advise or tips would be really helpful.

Thanks Shane

Check out forum posthttp://forums.asp.net/thread/1608950.aspx. It talks about passing in user context to retrieve images from the database.

AJAX slideshow gives me error Acme.SubAcme.ConvertMeTypeConverter cannot be found.

Hi there,

I have copied the slideshow example into my own project.
So I now have a folder called SlideShow. I copied the images folder over and also SlideShow.aspx,slide.cs,slideshowbehaviour.js,slideshowdesigner.cs,slideshowextender.cs

When I try opening the page I get a large popup box displaying the following error message.

--------
Windows Internet Explorer
--------
The server method 'GetSlides' failed with the following error: <html>

<head>

<title>Type: 'Acme.SubAcme.ConvertMeTypeConverter' cannot be found.</title>

<style>

body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}

p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}

b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}

H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }

H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }

pre {font-family:"Lucida Console";font-size: .9em}

.marker {font-weight: bold; color: black;text-decoration: none;}

.version {color: gray;}

.error {margin-bottom: 10px;}

.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }

</style>

</head>

<body bgcolor="white">

<span><H1>Server Error in '/AjaxShaneSite' Application.<hr width=100% size=1 color=silver></H1>

<h2> <i>Type: 'Acme.SubAcme.ConvertMeTypeConverter' cannot be found.</i> </h2></span>

<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

<b> Description: </b>An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

<br><br>

<b> Exception Details: </b>System.ArgumentException: Type: 'Acme.SubAcme.ConvertMeTypeConverter' cannot be found.<br><br>

<b>Source Error:</b> <br><br>

<table width=100% bgcolor="#ffffcc">

<tr>

<td>

<code>

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified usin…
--------
OK
--------

Does anyone know what I have done wrong?

Thanks for your help.

Shane

In your web.config have you uncommented the json serialization section? You will need to add a real converter in that section. This, Acme.SubAcme.ConvertMeTypeConverter, is just a "howto" placeholder.

<

system.web.extensions>

<

scripting>

<

webServices>

<!--

Uncomment this line to customize maxJsonLength and add a custom converter-->

<!--

<jsonSerialization maxJsonLength="500">

<converters>

<add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>

</converters>

</jsonSerialization>

-->

<!--

Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate.-->

<!--

<authenticationService enabled="true" requireSSL = "true|false"/>

-->

<!--

Uncomment these lines to enable the profile service. To allow profile properties to be retrieved

and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and

writeAccessProperties attributes.

-->

<!--

<profileService enabled="true"

readAccessProperties="propertyname1,propertyname2"

writeAccessProperties="propertyname1,propertyname2" />

-->

</

webServices>

<!--

<scriptResourceHandler enableCompression="true" enableCaching="true" />

-->

</

scripting>

</

system.web.extensions>

Hi Kirtid

Yip I have uncommented that line. I copied over the webconfig from the example site into my own site.

This is the webconfig. I am really new to .NET & AJAX so I am not sure how what I need to do to add a real converter in that section

Thanks for your help

Shane

 <configuration> <configSections> <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/> <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"> <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/> <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/> <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/> </sectionGroup> </sectionGroup> </sectionGroup> </configSections> <system.web> <trust level="Medium"/> <pages> <controls> <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </controls> </pages><!-- Set compilation debug="true" to insert debugging symbols into the compiled page. Because this affects performance, set this value to true only during development. --> <compilation debug="true"> <assemblies> <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies> </compilation> <httpHandlers> <remove verb="*" path="*.asmx"/> <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/> </httpHandlers> <httpModules> <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </httpModules> <siteMap defaultProvider="SamplesSiteMap"> <providers> <add name="SamplesSiteMap" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Web.sitemap"/><!-- <add name="WalkthroughsSiteMap" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Walkthroughs.sitemap"/> --> </providers> </siteMap> <globalization culture="en-us" uiCulture="en"/> </system.web> <system.web.extensions> <scripting> <webServices><!-- Uncomment this line to customize maxJsonLength and add a custom converter --> <jsonSerialization maxJsonLength="50000"> <converters> <add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/> </converters> </jsonSerialization><!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. --> <!-- <authenticationService enabled="true" requireSSL = "true|false"/> --> <!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and writeAccessProperties attributes. --> <!-- <profileService enabled="true" readAccessProperties="propertyname1,propertyname2" writeAccessProperties="propertyname1,propertyname2" /> --> </webServices><!-- <scriptResourceHandler enableCompression="true" enableCaching="true" /> --> </scripting> </system.web.extensions> <system.webServer> <validation validateIntegratedModeConfiguration="false"/> <modules> <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </modules> <handlers> <remove name="WebServiceHandlerFactory-Integrated"/> <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </handlers> </system.webServer></configuration>

Shane,

You can use the web.config from the toolkit sample website for your stuff. We have it commented out in that file. Looks like you do not need to worry about Converters and you can safely keep it commented out. If you need more information you can take a look at some documentation onconverters.

Kirti


Hi again,

Sorrry if im sounding very simple here but I don't understand :( I have searched through the example site and there is only 1 reference toAcme.SubAcme.ConvertMeTypeConverter which is the web.config which is the same as mine.

However I get this popup.

Do I need to add this into the page load event?

// Get the Web application configuration.
System.Configuration.Configuration configuration =
WebConfigurationManager.OpenWebConfiguration("/aspnetTest");

// Get the external JSON section.
ScriptingJsonSerializationSection jsonSection =
(ScriptingJsonSerializationSection)configuration.GetSection(
"system.web.extensions/scripting/webServices/jsonSerialization");

//Get the converters collection.
ConvertersCollection converters =
jsonSection.Converters;

if ((converters != null) && converters.Count > 0)
{
// Get the first registered converter.
Converter converterElement = converters[0];
}


You should just comment out that section. You do not need it if you are not dealing with Converters. Acme.SubAcme.ConvertMeTypeConverter is just a dummy placeholder that is actually commented out in the atlas web.config and in our sample website web.config as well. It is a "how-to" add a converters section to your web.config file sample. We recommend that you reuse the sample website web.config for starters.

Thank-you I do feel silly now.

This brings me to my next question so I think I will start a new thread.

Thanks again.

Shane