Showing posts with label asp. Show all posts
Showing posts with label asp. Show all posts

Wednesday, March 28, 2012

Content Place Holder containing accordion control

Hi

I'm new'ish to ASP (AJAX) and was trying to create a web site. Most has gone fine but I have a Master page with a content Place Holder on it.

I tried to put an accordion control on (between content tags) and it told me I needed a Script Manager which I did put on. Even with no other controls / code I get errors about 'sys' is undefined from IE with line numbers etc.

It seems to be from the following lines in source

//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('ctl00$ContentPlaceHolder1$ScriptManager1', document.getElementById('aspnetForm'));
Sys.WebForms.PageRequestManager.getInstance()._updateControls([], [], [], 90);
//]]>

Has anyone managed to get Accordion working with Content Place Holder and if so what am I doing wrong. I can get it workig with just a default.aspx type page.

thanks

Trev

The sample website uses a master page. So the accordiondemo shows the usage of the control inside a content placeholder. Check it out the accordion.aspx demo page code for more details. You can download the code for the toolkit which includes the sample website from thecodeplex site.

Thanks

I rebuilt the default.aspx file and it seemed to cure the problem. Now I just have the problem of Contant place holder not sizing correctly

thanks again

Constructors!

The only thing that REALLY winds me up about ASP.NET is the near total lack of useful constructors

I'd guess a lot of people want to do something like:

ContentPanel1.Controls.Add( new LinkButton("link3", "This is the Text", "http://some.url") )

BUT! you can't. You have all the pain of:

LinkButton link3 = new LinkButton();
link3.ID = "link3";
link3.NavigateURL="http://some.url";
link3.Text = "This is the Text";
ContentPanel1.Controls.Add(link3);

Declaratively, its beautiful, but there are some things that you just CANNOT DO declaratively, or at least you need to seriously hurt youself to manage it. Obviously, you can write helpful methods to immitate a ctor, but i'd really love to see decent ctors in both ASP.NET and ATLAS - ASP.NET is released, so i assume i've got no luck until V3.0 for that, but ATLAS is very much in devel, so any chance of a constructor or two (one on ControlEventTrigger would be great!)

hello.

yes, i also believe that the asp.net controls should have constructors which receive parameters. i guess that the problem is defining the important ones...if you really write a lot of code like the one you've presented, then i believe that your current best option is to write a factory class for those controls...it sucks, but...


Hi Luis,

I totally agree with you. In fact, some ASP.NET controls do have constructors that take parameters, such as SqlDataSource, though most do not. The factory pattern is probably your best bet here, especially since it lets you define exactly the properties that are important toyou, which might not be the same as the properties we would have come up with.

Edit: I also opened a suggestion bug so that we can investigate doing this for our controls in a future CTP.

Thanks,

Eilon

Monday, March 26, 2012

Confused about hosting and Atlas

I'm ready to start working with ASP.NET 2.0 and I'm looking for hosting plans for my website. However, I'm confused about Atlas. Can I use Atlas and all the AJAX extensions on any hosting provider that gives me ASP.NET? I was looking to use aplus.net for my hosting. Does anyone know if I can use aplus.net for this? If not, can someone give me a good hosting site?

Thanks!

The hosting site has to install it seperately. It does not come automagically with all asp.net hosting companies (although over time it probably will). There are a number of hosting companies that do offer it,...ultimahost.com being one I can think of off the top of my head.
Just copy the required Microsoft AJAX dll's to the \bin\ directory. I can't see how that should be a problem anywhere, or why you would need to install it (I've have done this on my own site).
That will only work if you can set your web site to run in full trust mode, most hosting providers don't allow this. There are several threads on the forum about this already with some explanations.

Conflict between UpdatePanel and Client-side Callback?

I posted this issue in the ASP.Net Ajax UI forum originally but never got a definitive answer:http://forums.asp.net/t/1184085.aspx

Basically, I have a Timer control outside an UpdatePanel that Ticks every second and triggers the UpdatePanel to display the current date & time. I also have an HTML button that initiates a client-side callback, which simply counts the number of client-side callbacks executed so far, and displays the count on the page. And finally I have a TextBox control placed outside the UpdatePanel. The TextBox isn't used for anything, but it needs to be there for the error to be generated.

The problem is that when I repeatedly click the HTML button to initiate client-side callbacks while the Timer is ticking, I will eventually get the "The state informationis invalidfor this page and might be corrupted"error. To get the error to be thrown I usually have to vary thefrequency of my clicking, but I can reproduce it without too muchtrouble (i.e. between 2 and 30 clicks). I am able to reproduce theerror in both IE and Firefox, though it is much easier to get Firefox to throw the error (to get IE to throw the error, I had to add more server controls to the page).

A poster on the other thread said it sounded like there was a conflict between the UpdatePanel and Client-side callbacks, but couldn't provide any further information. Is this a known issue/limitation? Anyone know what's going on here?

Thecode is below.

<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!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 id="Head1" runat="server">
<title>Testing</title>
<script type="text/javascript">
function initiateCallBack(){
doCallBack(document.getElementById("spanCallBackCount").innerHTML);
}

function callBackComplete(result){
document.getElementById("spanCallBackCount").innerHTML = result;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager
<br /><br />
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="conditional">
<ContentTemplate>
Date & Time: <asp:Literal ID="ltrDateTime" runat="server"></asp:Literal>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>
<asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick"></asp:Timer
<br /><br />
<asp:TextBox ID="txtTest" runat="server" Text="Testing"></asp:TextBox
<br /><br />
Call Back Count: <span id="spanCallBackCount">0</span>
<br /><br /
<input type="button" id="btnCallBack" name="btnCallBack" onclick="initiateCallBack();" value="Initiate Client-side Callback" /
</form>
</body>
</html

using System;
using System.Data;
using System.Configuration;
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 _Default : System.Web.UI.Page, System.Web.UI.ICallbackEventHandler
{
int callBackCount = 0;

protected void Page_Load(object sender, EventArgs e)
{
string callBackReference = Page.ClientScript.GetCallbackEventReference(this,"cnt","callBackComplete","context");
string callBackScript ="function doCallBack(cnt, context){" + callBackReference +"}";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),"doCallBack", callBackScript,true);
}

public void RaiseCallbackEvent(string cnt)
{
callBackCount = Convert.ToInt32(cnt);
callBackCount++;
}

public string GetCallbackResult()
{
return callBackCount.ToString();
}

 protected void Timer1_Tick(object sender, EventArgs e)
{
ltrDateTime.Text = DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss tt");

UpdatePanel1.Update();
}

}

No one can help with this? Come on, one of you Microsoft gurus must be able to provide some input...


Hi,

I tried it but can't reproduce the issue.

It's caused by viewstate validation failure, you can disable it.

<%@. Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" EnableViewStateMac="false"%>


Thanks for the help. Did you test it with Firefox? It's much more difficult to get IE to throw the error. I do get the error with IE, but it's much less consistent (and usually requires me to add more controls to the page). Firefox throws it pretty easily though. I actually created a video of the behavior I'm seeing with Firefox which can be seen here:

http://www.youtube.com/watch?v=EBsMRxnOtpE

(There's no audio, but I'm just running the code that I posted above, so it's not a big deal. In it, I run it with Firefox, and get it to throw the error after 20 clicks).

Unfortunately I can't disable the ViewState as in my real scenario the UpdatePanel and timer are at the top of the page checking every 60 seconds to see if the user has any new messages (internal messages to our system), and a client-side callback is used to maintain the state of the side navigation menu which consists of a Ajax Accordion control inside a Collapsible Panel.

Since the collapsing of the Panel and the selecting of Accordion panes is all done via client-side javascript, there's no good way of maintaining the state of the menu when the user is redirected to another page (or clicks a link). To solve this, I added some additional javascript that is executed whenever the user manipulates the menu, that makes a callback which stores the state of the menu in a session variable (whether it's collapsed and what Accordion pane is selected). This way when the user is redirected, or clicks on a link to another page, I have the information necessary to make the side menu look the same as it did on the previous page.

And since, these two elements are shared among all the site's pages (via a MasterPage with a UserControl for each element)....I'm not sure what to do.

Also, the error still persists even after settingEnableViewStateMac="false"in the page directive....(not sure why this thread was marked resolved/answered, I know I didn't mark it that way...)


I tried it on both IE && FF like a hundred times, but still get no exception. May be I didn't click it quickly enough?

Based on my understanding, it may be caused by different requests and responses intersect.

Can you try to disable the button upon a click and enable it again after the callback returns to avoid this?


Thanks for the help, you do have to vary the frequency of your clicking to get it to throw the error. I know it sounds bizarre but I start with a few steady clicks, not even that fast, and then increase the frequency of clicks until the error is thrown. If it hasn't thrown the error after 50 clicks, I'll reload the page and try again (Here's a better YouTube video:http://www.youtube.com/watch?v=EBsMRxnOtpE).

Disabling the button after a click might work in the test scenario but my real world app initiates a callback whenever the user manipulates the navigation menu in some way. So, hindering their ability to quickly jump from one item in the menu to another may be problematic....though callback doesn't take long, sio it's something I'll look into more...

More importantly though, I'm not sure that solves the problem. In my real app the Timer for the UpdatePanel ticks every 60 seconds, while a callback is issued every time the navigation menu is manipulated. And, when I've seen the error thrown, it appears to be thrown by the ticking of the Timer, because I've received the error after I clicked on the menu a few times, and then did nothing, and the error would only popup when the Timer executed its next Tick event...

Conflict between Microsoft ASP.NET 2.0 AJAX Extensions (Atlas) and ArcGIS Server 9.2 Contr

Helloo,

I was trying to use Microsoft ASP.NET 2.0 AJAX Extensions (Atlas) and ArcGIS Server 9.2 controls in the same web applications but there were conflict a between the Map control and UpdatePanel control as the error message appear with the message (“unknown error”);

Why this conflict occurs?

Is there’re any solution that enable be to use the UpdatePanel control in the same page with Map Control?

In the Atlas CTPs we had a lot of conflicts with 3rd part controls (and even some of our own controls) because we did a lot of automatic scanning for scripts and things like that. In Atlas 1.0 we don't do automatic stuff like that because it breaks too easily. Instead, 3rd party controls will have to be updated to be compatibleinside the UpdatePanel. If they're outside the UpdatePanel then they typically don't require any changes.

Thanks,

Eilon

ConfirmButton Problem

Hi all, im new here and also to asp/ajax.. ive got a slight question to ask which may be simple.. im using the confirmbutton extender programatically as shown below

Dim lnkOptionAs New LinkButton lnkOption.Width = 50 lnkOption.Text ="Delete" lnkOption.ID = lblUser.TextAddHandler lnkOption.Click,AddressOf Delete ContentPanel2.Controls.Add(lnkOption)Dim btnConfirmAs New AjaxControlToolkit.ConfirmButtonExtender btnConfirm.TargetControlID = lblUser.Text btnConfirm.ConfirmText ="Are you sure you want to delete ?"

It retrieves a list of users and lists them down on a page using a for loop... now id like each option to have a delete ability as shown in the code above.. however the code doesnt seem to work as i think im missing something out since it doesnt show the text "Are you sure you want to delete ?"

Thanks :)

I don't see any code that adds the btnConfirm to the page...are you doing this?

Jason

Saturday, March 24, 2012

Configuring VS2005 to use the AJAX Control Toolkit

Hi,

I have installed the lasted version of the ASP.Net AJAX and then downloaded the ASP.Net AJAX Control Toolkit. When trying to add the items to the Toolbox of a new ASP.NET AJAX Web Site raises the following error:

There was an error loading types from assenbly AjaxControlToolkit.dll "Could not load file or assembly System.Web.Extensions, Version:1.0.61025.0", the system couldn't find the specified file.

The file instaled in my system is: ..\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025\Microsoft.Web.Extensions.dll

How can I fix this problem?.

Thanks

Marco

Matellor:

Hi,

I have installed the lasted version of the ASP.Net AJAX and then downloaded the ASP.Net AJAX Control Toolkit. ... ..\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025\Microsoft.Web.Extensions.dll

It's sounds like you did not install the latest version. Microsoft.Web.Extensions is from the beta, RC1 has System.Web.Extensions. Make sure you installed RC1 if you're using the latest toolkit.

Configure a ATLAS website in IIS

I downloaded the ATLAS msi, installed it, and I could create a ATLAS enabled ASP.Net web project. It works fine from VS.Net 2005, but when I copy the project to ISS it doesn't work. I copied the entire solution to C:\Inetpub\wwwroot\ATLASWebDemo, and created a web application called "ATLASWebDemo", but as soon as I execute the page I get "Object reference not set to an instance of an object" Messagebox.

How do I configure IIS to deply this solution to our IIS server (Windows Server 2003)?

Regards

Arno

hello.

have you checked if iis is configured to use asp.net 2.0?


Have got any new ideeas, because I am in the same situation...

Johan

www.helheten.net


Yes, the ASP.Net 2.0 application works 100%, but as soon as I invoke the timer <atlas:TimerControl> I get "Object reference not set to an instance of an object". It works fine when I run it from the VS.Net 2005 IDE, but as soon as I copy the solution to my InetPub folder it doesn't work.

How would you publish a solution that is using ATLAS? I am sure I am missing a setting in IIS or something.

Thank for the speedy reply.


Hi there, no ideas yet, I'll be trying again today, will keep you up to date.

I'm also have the same problem, but also in Cassini.

Here is the server respone for TimerControl request:

<delta><pageError message="Object reference not set to an instance of an object." /></delta></delta>


hello.

well, this means that you're getting an exception on the server side...it's not a configuration problem though.


Here are some suggestions (yes, some are obvious, but you never know):

1) Check to make sure Microsoft.Web.Atlas.DLL is indeed copied over and resides in the bin directory.

2) Check web.config to confirm it has the correct references to Atlas.

3) Look in EventViewer and see if there are any helpful logs coming from the app.

4) Use tools such as FileMon (fromwww.sysinternals.com) to check if there are any permissioning issues that could prevent objects from getting created.

-Jeff

Configuration Error

I have uploaded my asp.net/ajaxenabled site up to a server and I get this error:

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.

I have checked my c:\windows\assembly folder and the web extensions are there as matching versions. Does anyone have any idea what I need to do to fix this?

thanks,

wdg

Does the server have AJAX extension installed? Microsoft set up AJAX so the files need to reside in the Global Assembly Cache, rather than just being placed in your application's /bin/ folder, which means you/system admin/web host need to install the extensions with the same installer you used to get access to them on your machine.

Config error browsing AJAX Offline Docs

Hi All

I have installed ASP.NET AJAX Extensions 1.0 and have setup the Web Project to view the docs offline.

When I try to browse the web app I get the following configuration error:

Parser Error Message:Unrecognized attribute 'type'.

Line 4: <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">

I have set the app up in IIS 5.0 to use ASP.NET 2.0 and I have made sure that the System.Web.Extensions is in the windows assembly.

Any ideas please?

Cheers

John

Make sure you have Asp.net Ajax Installed.


I added the reference System.Web.Extensions to fix the error you are receiving!


Thanks Ron

I'll try that

John

Conditional Modal popup?

I have a <asp:checkbox> control on my ASP.NET page as a column (template item) in a GridView. This check box is to mark certain thing as reviewed. When the user checks it, before I run my sql query to mark the sql table rows as reviewed, I would like to pop up a confirmation dialog to the user.

However, this confirmation is not always needed, based on a condition (i.e.) if the GridView row that this check box is on is currently highlighted i.e. selected, then I don't need a confirmation. But if some other GridView row was selected and the check box on some other row is checked then I would like to confirm with the user.

I checked the modalpopup in Ajax toolkit, but it seems like it pops up every time the target control is clicked. I need the ability to be able to decide when to show the popup and when not to.

Please help.

instead of assigning the modal popup to a target control. Assign the target control id to a hidden field, so just make a random hidden field on your form with the id modalTarget and set the popupcontrolid for the modal to be modalTarget. Now you have it set up so nothing can cause the modal to popup since users cant really interect with the hidden field. You are now free to use the Show() function to display the modal popup. So say you click the submit button and first want to check if the checkbox is clicked. all you have to do if it is checked is something like this

if(checkbox.Checked == true)
{
modalPopup1.Show();
}

modalPopup1.Show(); will allow you to show the popup any time u want :)


Thanks for the neat idea. One question though, after the popup shows, how would I check if the ok was selected or the cancel?

ex:

if (selectedRowIndex != checkBoxRowIndex)

{

modalpopup1.Show();

}

// check if the Ok button was clicked (how to check that??)

if yes

call UpdateSQLRows();

else // cancel button clicked

do nothing.


i have never used these but you might wanna try setting the okControlID so you can use that to determine what the user clicked. or just write onClick events for your buttons

OkControlID - The ID of the element that dismisses the modal popupOnOkScript - Script to run when the modal popup is dismissed with the OkControlIDOkCancelID - The ID of the element that cancels the modal popupOkCancelScript - Script to run when the modal popup is dismissed with the CancelControlID

Thanks, I will work on that.

Conditional confirmation pop up?

I have a <asp:checkbox> control on my ASP.NET page as a column (template item) in a GridView. This check box is to mark certain thing as reviewed. When the user checks it, before I run my sql query to mark the sql table rows as reviewed, I would like to pop up a confirmation dialog to the user.

However, this confirmation is not always needed, based on a condition (i.e.) if the GridView row that this check box is on is currently highlighted i.e. selected, then I don't need a confirmation. But if some other GridView row was selected and the check box on some other row is checked then I would like to confirm with the user.

I checked the modalpopup in Ajax toolkit, but it seems like it pops up every time the target control is clicked. I need the ability to be able to decide when to show the popup and when not to.

Please help.

Sounds like this can be solved by a simple if statement in your JavaScript that generates the popup. I found however that the client-side onchange event for checkboxes only fires when the focus has changed, so in this case I capture the onclick and keyup event for the checkbox, for example:

myCheckbox.InputAttributes.Add("onclick","EVENT");
myCheckbox.InputAttributes.Add("onkeyup","EVENT");

Hope this helps...

-Damien


In the client side onclick event handler for the check box, would I be able to know which row on the Server side GridView was selected before checking the checkbox.?

Should this hidden field be a server side control or just a regualr HTML hidden field?

My intent is to be able to pass to the client side javascript function, the GridView's selected row index and the row index of the row on which the clicked check box is sitting.

And then inside the JavaScript function ex: SomeValidationFunction(), I would compare the values of both the indexes, if they are equal then I return true and if not then I popup the confirmation.

So, In a nut shell, the main deal is to make the server side's GridView's row index values available to the onclick function...and how do I do it ( from the onclick() function, without going to the server) is the question?.


You could do this by passing the row index to yourSomeValidationFunction as a parameter. When you add these events to the checkbox, you can do this during the data binding event, just append the parameter(s) you need when you add the function call.


When I append the parameters during the databinding event, my parameters wont be having values. Will I be able to value the parameters when the check box is clicked later on?

Could you please provide a snippet of code as to appending parametes to a function call and valuing them...if its not too much to ask.

Thank you.


In theRowDataBound event, you can use theGridViewRowEventArgs (in this example's case, the parameter is named "e". Then this code will add the javascript event to the checkbox:

myCheckbox.InputAttributes.Add("onclick","EVENT(" + e.Row.RowIndex + ")");
myCheckbox.InputAttributes.Add("onkeyup","EVENT(" + e.Row.RowIndex + ")");

Hope this helps you out...

-Damien

Hi Damien

I have added the below code to the RowDataBound event handler for my GridView. When I add the onclick() attributes to the check box, it no more causes a postback.

<script type="text/javascript" language="javascript">
function ReviewConfirmation() {
var confirmation = confirm("Do you really want to mark reviewed?");
return confirmation;
}
</script>

protected void gvAlertSummary_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
CheckBox chkRevSummary = (CheckBox)e.Row.FindControl("chkRevSummary");
chkRevSummary.Attributes.
chkRevSummary.Attributes.Add("onclick","return ReviewConfirmation()");
}
}

I have noticed that previously there used to be a _doPostBack() call in the onclick() for the checkbox, after adding the code for the attributes, I no more see the _doPostBack, which got replaced by the attributes that I have added. How should I work around this problem.

Also, how do I add the EVENT attribute to this check box.

Thanks for you help.

Wednesday, March 21, 2012

Composite Control Examples?

Does anyone have any examples of using ASP.NET Ajax with Composite Controls or custom server controls?

Thanks.

3 samples here:

http://alpascual.com/blog/al/archive/2006/06/19/The-power-of-CompositeControl.-Another-skeleton-class-.aspx

http://alpascual.com/blog/al/archive/2006/09/28/Creating-an-Atlas-control-is-not-very-well-described-anywhere_2C00_-centralize-documentation-please_2100_.aspx

http://alpascual.com/blog/al/archive/2006/09/06/Dropdown-with-checkbox-for-ASP.NET-2.0.aspx

Complication Running AJAX ASP.NET on a currnet ASP.NET Web Server?

Hi there i'm currently busy converting a ASP.NET web site to a AJAX ASP.NET site.

I just want to know what is the prerequisites for copying, or publishing a AJAX ASP.NET site on a Web Server currenly configured to run ASP.NET?

What should i do?

Is there any unforseen problems that might come ot light down the line?

Please can someone help me...

THANKS

SJB

You will first have to install the AJAX framework on the web server, which can be foundhere.


Do you know of any other complications down the line?

After the AJAX framework has been installed?


Not that I've come across.


thx...


Hi s_j_b,

To converting a web site to AJAX ASP.NET site.It is recommended to do these steps as below:

1. Install Asp.Net AJAX Extension. The introduction is here: http://ajax.asp.net/docs/InstallingASPNETAJAX.aspx (not necessary)

2. Add a reference to the "System.Web.Extensions.dll " in your project. (In common, the dll is in C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025).

3. Modify your web.config file. Please follow this: http://ajax.asp.net/docs/ConfiguringASPNETAJAX.aspx

Hope it helps , if any problems or has been resolved yet , please let me know.

Complex page with slider control works locally, but breaks when run from production server

I have my ASP.NET 2.0 AJAX product working fine on my local machine. However, when I upload it to our production server and run it from there, I get the following Javascript error when the page first loads:

IE: "Microsoft JScript runtime error: Object doesn't support this property or method"
Firefox: "this.control.get_text is not a function"

It occurs on line 239 of the Slider control's WebResource.axd:

var _elementValue = Number.parse(this.control.get_text());

When running locally, the runs under the VS2005 built in web server athttp://localhost:xxxx/MyGossip/. The production server's address is ishttp://production/MyGossip/.

The page source is as follows (there are a couple of trivial web service methods in the code behind that are not shown):

<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeFile="Search.aspx.cs" Inherits="Search" %>

<%@dotnet.itags.org. Register Assembly="RadTabStrip.Net2" Namespace="Telerik.WebControls" TagPrefix="radTS" %>
<%@dotnet.itags.org. Register src="http://pics.10026.com/?src=Stars.ascx" TagName="Stars" TagPrefix="uc1" %>

<!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">
<link type="text/css" rel="stylesheet" href="http://links.10026.com/?link=Results.css" />
<link type="text/css" rel="stylesheet" href="http://links.10026.com/?link=Default.css" />
<link type="text/css" rel="stylesheet" href="http://links.10026.com/?link=Rating.css" />
<title>MyGossip - Search tours</title>
</head>
<body>

<form id="Form1" runat="server">

<atlas:ScriptManager ID="s1" EnablePartialRendering="true" runat="server">
<Scripts>
</Scripts>
</atlas:ScriptManager>

<table align="center" style='width:800px;'>
<tr>
<td>
Min rating
</td>
<td colspan="2">
Max cost (0 for none)</td>
<td style='width: 199px'>
<atlas:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<span id="DivProgress" style='font-size:90%; position:relative; top:-9px; left:200px; background-color:#666699;color:white; font-weight:bold;padding:3px;'>
Loading...
</span>
</ProgressTemplate>
</atlas:UpdateProgress>

</td>
</tr>
<tr>
<td style='width:300px;'>

<asp:DropDownList ID="DropDownListRating" runat="server" AutoPostBack="True" CssClass="textbox" Visible="false">
<asp:ListItem Value="0">All ratings</asp:ListItem>
<asp:ListItem Value="1">At least *</asp:ListItem>
<asp:ListItem Value="2">At least * *</asp:ListItem>
<asp:ListItem Value="3">At least * * *</asp:ListItem>
<asp:ListItem Value="4">At least * * * *</asp:ListItem>
<asp:ListItem Value="5">At least * * * * *</asp:ListItem>
</asp:DropDownList>


<atlasToolkit:Rating ID="RatingMinRating" runat="server"
CurrentRating="0" Direction="LeftToRight" ReadOnly="false" StarCssClass="ratingStar"
WaitingStarCssClass="savedRatingStar" FilledStarCssClass="savedRatingStar" EmptyStarCssClass="emptyRatingStar">
</atlasToolkit:Rating>


</td>
<td style='width:1px;'>
<asp:TextBox ID="SliderMaxCost" runat="server" style='width:80px;' AutoPostBack='true'></asp:TextBox>
</td>
<td style='width:80px;'>
<asp:TextBox ID="TextBoxMaxCost" runat="server" MaxLength="5" Columns="5" AutoPostBack="true" CssClass="textbox"></asp:TextBox>
<atlasToolkit:SliderExtender ID="SliderExtender1" runat="server">
<atlasToolkit:SliderProperties TargetControlID="SliderMaxCost" BoundControlID="TextBoxMaxCost"
Decimals="0" Minimum="0" Maximum="1000" Length="80" /></atlasToolkit:SliderExtender>
AUD
</td>
<td style='text-align:right;'>
<asp:Button ID="Button1" runat="server" Text="Update" />
</td>
</tr>
<tr>
<td colspan="4">

<atlas:UpdatePanel ID="UpdatePanelResultGrid" runat="server">

<Triggers>
<atlas:ControlEventTrigger ControlID="RatingMinRating" EventName="Changed" />
<atlas:ControlEventTrigger ControlID="Button1" EventName="Click" />
</Triggers>

<ContentTemplate>

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
style='width:100%' CellPadding='4' AllowPaging='True' AllowSorting='True'>
<Columns>
<asp:TemplateField HeaderText="Activity" SortExpression="name">
<ItemTemplate>
<span class="ResultTitle">
<asp:Label ID="Label1" runat="server" Text='<%# Bind("name") %>'></asp:Label>
</span>
<br />
<asp:Label ID="Label3" runat="server" Text='<%# Bind("description") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="duration" HeaderText="Duration" SortExpression="duration" />
<asp:BoundField DataField="departs" HeaderText="Departs" SortExpression="departs" />
<asp:BoundField DataField="price" DataFormatString="{0:0.00} AUD" HeaderText="Cost"
SortExpression="price" />
<asp:TemplateField HeaderText="Rating" SortExpression="rating">

<ItemTemplate>
<uc1:Stars ID="Stars1" runat="server" Rating='<%# Eval("rating") %>' />
</ItemTemplate>
</asp:TemplateField>

<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="LinkButtonShowDetails" runat="server" Text="more"></asp:LinkButton>
<atlasToolkit:ModalPopupExtender ID="ModalPopupExtenderDetails" runat="server">
<atlasToolkit:ModalPopupProperties
TargetControlID="LinkButtonShowDetails"
PopupControlID="PanelPopupDetails"
DynamicControlID="LabelPopupDetailsDynamic"
DynamicContextKey='<%#Eval("name")%>'
DynamicServiceMethod="GetContent"
OkControlID="ButtonPopupDetailsClose"
BackgroundCssClass="ModalBackground" />
</atlasToolkit:ModalPopupExtender>

|

<asp:LinkButton ID="LinkButtonAddToShortlist" runat="server" Text="shortlist"></asp:LinkButton>
<atlasToolkit:ModalPopupExtender ID="ModalPopupExtenderShortlist" runat="server">
<atlasToolkit:ModalPopupProperties
TargetControlID="LinkButtonAddToShortlist"
PopupControlID="PanelPopupShortlist"
DynamicControlID="LabelPopupShortlistDynamic"
DynamicContextKey='<%#Eval("name")%>'
DynamicServiceMethod="AddToShortlist"
OkControlID="ButtonPopupShortlistClose"
BackgroundCssClass="ModalBackground" />
</atlasToolkit:ModalPopupExtender>

</ItemTemplate>
</asp:TemplateField>

</Columns>
</asp:GridView>
</ContentTemplate>

</atlas:UpdatePanel>

</td>
</tr>
</table>

<asp:Panel ID="PanelPopupDetails" runat="server" style='display:none;' CssClass='Popup'>
<h3>
<asp:Button ID="ButtonPopupDetailsClose" runat="server" Text="Close" style='float:right' />
<asp:Label ID="LabelPopupDetailsDynamic" runat="server" />
</h3>

<radTS:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" SelectedIndex="0"
Align="justify"
style='margin-bottom: -1px;'>
<Tabs>
<radTS:Tab runat="server" Text="Tour details"></radTS:Tab>
<radTS:Tab runat="server" Text="Reviews"></radTS:Tab>
<radTS:Tab runat="server" Text="Pricing"></radTS:Tab>
</Tabs>
</radTS:RadTabStrip>
<radTS:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0"
style='BORDER:solid 1px #BBBBBB; width:95%; padding:20px; background-color:#FAFAFA;'>
<radTS:PageView ID="PageView1" runat="server" Width="100%">
<div>
<h3>
<img src="http://pics.10026.com/?src=images/bus.png" style='float:right; margin-left:20px;margin-bottom:10px;' alt='' />
Tour details
</h3>

<ul>
<li class="style4">1 Hour Daintree River Cruise<br />
</li>
<li class="style4">Hand feed kangaroos<br />
</li>
<li class="style4">Lunch at a freshwater creek<br />

</li>
<li class="style4">4WD the "Bloomfield Track"<br />
</li>
<li class="style4">Small & personalised </li>
</ul>
<p class="style14">Your naturalist guide will meet you at your accommodation at around 7am.
The first 1/2 of the journey north is very scenic with beautiful ocean views in contrast with the lush
farmland around Mossman. After morning tea you will learn about the mangrove rainforests, and hopefully
observe local wildlife including the Estuarine Crocodiles on the Daintree River Cruise. </p>

<p class="style14">This tour offers a little more. It takes you beyond Cape Tribulation along the 4WD
only 'Bloomfield Track', allows time for a swim in the Coral Sea at Cape Tribulation (seasonal).
There is no set timetable. You can enjoy elevated walks through the Cape Tribulation National Park
with experienced guides who allow ample time for questions and photographs. While you are taking a swim
in a tranquil freshwater stream the BBQ lunch is prepared then served with home made salads, tropical
fruit and Australian wine. You will probably see fish and turtles in the creek, butterflies and exotic
birds in the trees and often Goannas on the forest floor all at the luncheon site. On the way home enjoy
a short afternoon refreshment stop where you can pat a Kangaroo, scratch a cockatoo, have a cold beer or
sip a cup of local tea. Return to Cairns by 6:30pm. </p>
</div>
</radTS:PageView>
<radTS:PageView ID="PageView2" runat="server" Width="100%">
<div>
<h3>Reviews</h3>
<p><strong>Samantha, 22, Canada</strong>
<img src="http://pics.10026.com/?src=Images/Stars/star_on.png" /><img src="http://pics.10026.com/?src=Images/Stars/star_on.png" /><img
src="http://pics.10026.com/?src=Images/Stars/star_on.png" /><img src="http://pics.10026.com/?src=Images/Stars/star_half.png" /><img src="http://pics.10026.com/?src=Images/Stars/star_off.png" />
</p>
<p>
Our tour guide Geoff was amazing and the size of the group was just right. I would definitely recommend this tour
to backpackers.
</p>
<p>Helpful? <input type="button" value="Yes"/ > <input type="button" value="No"/ ></p>

<p><strong>Keith, 24, Ireland</strong>
<img src="http://pics.10026.com/?src=Images/Stars/star_on.png" /><img src="http://pics.10026.com/?src=Images/Stars/star_on.png" /><img
src="http://pics.10026.com/?src=Images/Stars/star_on.png" /><img src="http://pics.10026.com/?src=Images/Stars/star_on.png" /><img src="http://pics.10026.com/?src=Images/Stars/star_off.png" />
</p>
<p>
I only had two days in cairns, so this tour was perfect for me. If you're looking for a way to pack in as much
as you can in one day this would be the tour for you.</p>
<p>Helpful? <input type="button" value="Yes"/ > <input type="button" value="No"/ ></p>

<p><strong>Felicia, 19, UK</strong>
<img src="http://pics.10026.com/?src=Images/Stars/star_on.png" /><img src="http://pics.10026.com/?src=Images/Stars/star_on.png" /><img
src="http://pics.10026.com/?src=Images/Stars/star_on.png" /><img src="http://pics.10026.com/?src=Images/Stars/star_half.png" /><img src="http://pics.10026.com/?src=Images/Stars/star_off.png" />
</p>
<p>
Make sure you know what the weather is going to be like before you book this tour, it rained the whole time we were
there. But our tour guide made me most of it and was really enternaining.
</p>
<p>Helpful? <input type="button" value="Yes"/ > <input type="button" value="No"/ ></p>

</div>
</radTS:PageView>
<radTS:PageView ID="PageView3" runat="server" Width="100%">
<div>
<h3>Pricing</h3>
<p>All prices shown in Australian Dollars, valid from 1 April 2006 until 31 March 2007</p>
<table width="400" border="0" cellpadding="5" cellspacing="0">
<tr>
<th align="left" ><span class="style15"></span></td>
<th align="center"><span class="style1">Adult</span></td>

<th align="center"><span class="style1">Child</span></td>
<th align="center"><span class="style1">Family</span></td>
</tr>
<tr>
<th align="right"><span class="style1">Safari, Pensioner</span></td>
<td align="center"><span class="style1">$ 135</span></td>
<td align="center"><span class="style1">n/a</span></td>

<td align="center"><span class="style1">n/a</span></td>
</tr>
<tr onmouseover="return escape('Daintree/Cape Tribulation/4WD Bloomfield Track')">
<th align="right"><span class="style1">One Day Safari</span></td>
<td align="center"><span class="style1">$ 145</span></td>
<td align="center"><span class="style1">$ 95</span></td>
<td align="center"><span class="style1">$ 440</span></td>

</tr>
<tr>
<th align="right"><span class="style1">One Day Safari ex Port Douglas</span></td>
<td align="center"><span class="style1">$ 145</span></td>
<td align="center"><span class="style1">$ 95</span></td>
<td align="center"><span class="style1">$ 440</span></td>
</tr>
</table>

</div>
</radTS:PageView>
</radTS:RadMultiPage>

</asp:Panel>


<asp:Panel ID="PanelPopupShortlist" runat="server" style='display:none;' CssClass='Popup'>
<h3>
Trip added!
<asp:Button ID="ButtonPopupShortlistClose" runat="server" Text="Close" style='float:right' />
</h3>
<h4>Your shortlist is as follows:</h4>
<ul>
<asp:Label ID="LabelPopupShortlistDynamic" runat="server" />
</ul>
</asp:Panel>

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:MyGossipConnectionString %>"
ProviderName="<%$ ConnectionStrings:MyGossipConnectionString.ProviderName %>"
SelectCommand="SELECT [name], [description], [duration], [departs], [price], [no_days], [rating] FROM [Tour] WHERE (([rating] >= @dotnet.itags.org.rating) AND (@dotnet.itags.org.price = 0 OR [price] <= @dotnet.itags.org.price))">
<SelectParameters>
<asp:ControlParameter ControlID="RatingMinRating" DefaultValue="0" Name="rating"
PropertyName="CurrentRating" Type="Decimal" />
<asp:ControlParameter ControlID="TextBoxMaxCost" DefaultValue="0" Name="price"
PropertyName="Text" Type="Decimal" />
</SelectParameters>
</asp:SqlDataSource>

</form>

</body>
</html>

Any help appreciated.

Mike

Hi,

since the code is working on the local environment, it doesn't seem a problem related to the Slider, but instead to the production environment. Please check that all the client files are correctly sent to the browser.


I pointed an HTTP sniffer at requests made to both the local and remote sites, but as far as I can see, the same AXD requests are successfully made both on the local and remote machines. A total of 13 MS Ajax / Atlas control kit files are downloaded from h my test server and the production server:

MS client side library (beginningfunction WebForm_PostBackOptions...)

Hi,

there seems to be a problem with the markup rendered by the extender:

<control id="SliderMaxCost"> <behaviors> <slider:SliderBehavior ... /> </behaviors></control>
This is strange because it should render a textBox element rather than a control (the extender base class takes care of this). Rendering a control means that that the text property is not defined, and it crashes. I'll investigate and follow-up as soon as possible.

Hi,

please check if you' ve got an older version of the Control Toolkit on your production machine. You must have the September release assembly in order to use the Slider extender.


I just file copied the entire project folder structure from the development machine to the production server. The fact that the HTTP sniffer shows the slider behaviour javascript file being downloaded surely indicates that the correct version is installed.

Any other ideas?

Mike


Hi,

it can happen when embedding a new extender in a previous version of the Control Toolkit and then recompiling, for example. However, it seems not your case. I'll continue to investigate.


Thanks for taking the time with this. I simplified the problem and posted it as a new question, which may make your investigations easier:

http://forums.asp.net/thread/1420009.aspx

Cheers,

Mike

Compilation Errors

I installed the atlas site template from this location:

http://msdn.microsoft.com/asp.net/info/future/atlastemplate/

I'm working on this tutorial: http://atlas.asp.net/quickstart/atlas/doc/services/default.aspx#simple

and when I compile I get these warnings/errors:

Warning 1 Validation (ASP.Net): Attribute 'EnableScriptComponents' is not a valid attribute of element 'ScriptManager'. C:\Projects\AtlasWebSiteTest\Simple.aspx 6 60 C:\Projects\AtlasWebSiteTest\

Error 2 Validation (Internet Explorer 6): Element 'services' is not supported. C:\Projects\AtlasWebSiteTest\Simple.aspx 7 10 C:\Projects\AtlasWebSiteTest\

Error 3 Element 'ServiceReference' is not a known element. This can occur if there is a compilation error in the Web site. C:\Projects\AtlasWebSiteTest\Simple.aspx 8 20 C:\Projects\AtlasWebSiteTest\

Error 4 Type 'Microsoft.Web.UI.ScriptManager' does not have a public property named 'EnableScriptComponents'. C:\Projects\AtlasWebSiteTest\Simple.aspx 6

I've tried reinstalling the template as well as rebooting to make sure everything was opertating correctly.

Does anyone know why I might be receiving these errors?

Thanks
http://weblogs.asp.net/wallym/archive/2005/12/22/433873.aspx
This might be helpful. I had to update my web.config to get things to work.

Wally

wrote in message news:1149845@.66.129.67.203...
>I installed the atlas site template from this location:
>
> http://msdn.microsoft.com/asp.net/info/future/atlastemplate/
>
> I'm working on this tutorial:
> http://atlas.asp.net/quickstart/atlas/doc/services/default.aspx#simple
>
> and when I compile I get these warnings/errors:
>
> Warning 1 Validation (ASP.Net): Attribute 'EnableScriptComponents'
> is not a valid attribute of element 'ScriptManager'.
> C:\Projects\AtlasWebSiteTest\Simple.aspx 6 60
> C:\Projects\AtlasWebSiteTest\
>
> Error 2 Validation (Internet Explorer 6): Element 'services' is not
> supported. C:\Projects\AtlasWebSiteTest\Simple.aspx 7 10
> C:\Projects\AtlasWebSiteTest\
>
> Error 3 Element 'ServiceReference' is not a known element. This can
> occur if there is a compilation error in the Web site.
> C:\Projects\AtlasWebSiteTest\Simple.aspx 8 20
> C:\Projects\AtlasWebSiteTest\
>
> Error 4 Type 'Microsoft.Web.UI.ScriptManager' does not have a public
> property named 'EnableScriptComponents'.
> C:\Projects\AtlasWebSiteTest\Simple.aspx 6
>
> I've tried reinstalling the template as well as rebooting to make sure
> everything was opertating correctly.
>
> Does anyone know why I might be receiving these errors?
>
> Thanks
>

What changes do you recommend that i make? What did you do to get it running?

Thanks!


I think you don't have the December release. Try downloading it again.
I had to go back and delete the old files. Re install the new ones. It still didnt work.

Then I shut everything down, deleted the files. Rebooted, reinstalled the files and then started VS.NET 2005 and it worked finally.

Thanks for the help. It baffles me why the application was acting like this.

Thanks again!
I am sure that I am missing something obvious, but I cannot get this demo to work.

In case it matters, I am working with Windows 2003 Server (SP1) and VS2005. I have also tried the same thing under Windows XP (SP2). When I click the button in IE 6, I get the JScript error pop-up window with the following message:

"'Quickstart' is undefined"

Has anyone else encountered this problem? If so, did you find a solution? I am sure that it is going to be a "head slap" type of answer, but I cannot figure it out for the life of me.

Thanks,
Jim.
Okay, after checking my system again, I realized that I had not installed the December release. I could have sworn that I had, but once I installed the December release and created a new website using the Atlas Templates, the JScript error message went away.

Thanks,
Jim.