Showing posts with label create. Show all posts
Showing posts with label create. Show all posts

Wednesday, March 28, 2012

very basic question about the atlas samples

I went thru the instructions exactly (well almost...the create new item for the webservice in VS2005 is incorrect in the tutorial, it should be Create new website)

http://atlas.asp.net/docs/Walkthroughs/GetStarted/Basic.aspx

But i keep getting aError: Samples is undefined

I tried this in an attempt to fix it..but it failed too (this URL i put in the Start URL in the webservice)..I wasnt sure

<atlas:servicereferencepath="http://localhost:1169/AtlasWebService/HelloWorldService.asmx"/>

What dumb thing am i missing?

Thanks!

What do you get when you go tohttp://localhost:1169/AtlasWebService/HelloWorldService.asmx/js

Executing:

http://localhost:1169/AtlasWebService/HelloWorldService.asmx/js

Gives:

Server Error in '/AtlasWebService' Application.


Request format is unrecognized for URL unexpectedly ending in '/js'.


That is why you are getting the 'undefined Samples' javascript error. Atlas will generate the javascript objects for your webservice if you have it configured correctly. Using /js after your webservice is a good way to test if this is working.

I would recommend taking the following steps to debug this issue:

1) Double check that you are using the April CTP of Atlas. You may want to uninstall your current version and re-install the version found by going to http://atlas.asp.net/ and clicking the 'Download' button.

2) When you create your website, make sure the template you select is called _"Atlas" Web Site_. This template will give you a web.config to start from that has the appropriate configuration settings to enable generation of javascript for your web service.

3) Follow the steps in the walkthrough to create the web service. Note that the instructions are correct. Make sure you right-click on the web project (not the solution) and select 'Add New Item'. Web Service will be one of the options.

4) Test your web service by setting it as the start page and pressing F5. You should get the standard web service test page - click on the web service and make sure it works. If it does, then add '/js' to the path and see if Atlas generates javascript.

5) Follow the steps in the walkthrough to create the test page.

My guess is that your problem is caused by a configuration error. By following the steps above, you should discover what was causing the problem.
Regards,
Kyle

I'm going to assume you are using one of the wallkthroughs like this one,"Walkthrough: Creating a Basic ASP.NET 'Atlas' Web Application"

I ran into this same problem you did and the fix went like this:

When i created the new "Atlas Website", i right clicked on the root and chose "Add New", then "WebService", and put "HelloWorldService.asmx"

This did two things:
- Created "HelloWorldService.asmx" in the root of the directory
- Created "HelloWorldServer.vb" in the App_Code directory

I had then copied and pasted the code right from the sample walkthrough into the VB file....

But here was the catch, and the cause of the problem:
- The sample has "Namespace Samples.Atlas" or something the like wrapped around its classes

- Well, back on the asmx, it had put:
<%@. WebService Language="VB" CodeBehind="~/App_Code/HelloWorldService.vb" Class="HelloWorldService" %>

- And since we had just changed the classes namespace since we copied and pasted from the code on the walkthrough, we broke the link between the two, hence the "Samples in undefined" error

So my fix was to change the asmx file to say

<%@. WebService Language="VB" CodeBehind="~/App_Code/HelloWorldService.vb" Class="Samples.Atlas.HelloWorldService" %>

Problem = solved


Thanks Kyle, it was my error that i didnt read the docs closely enough...i had passed by the right click on the atlas website, and created a asp.net webservice thru the right click new webservice on the solution.

I assume that i can do the latter, later, by manually copying the relevant config entries for Atlas into the non-Atlas asp.net web.config...

thanks again

Very simple example... with masterpage!

I create a really simple example using atlas on a masterpage.

Ihave this code:

<

cc1:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="true"></cc1:ScriptManager><cc1:UpdatePanelID="up2"runat="server"><ContentTemplate><asp:Labelid="lbl1"runat="server"Text="Label"></asp:Label><BR/><asp:LinkButtonid="LinkButton1"runat="server"OnClick="LinkButton1_Click">LinkButton</asp:LinkButton></ContentTemplate>

</cc1:UpdatePanel>

and this:

protectedvoid LinkButton1_Click(object sender,EventArgs e)

{

lbl1.Text =

"egege";

}

the problem is that the event is raised, lbl1.Text became "egege", but the text of the label on the page it is still the same...

what can be wrong?

Can you supply a bit more code and perhaps explain how the cc1 namespace prefix got placed in front of your atlas controls?

<cc1:ScriptManager......

Instead of

<atlas:ScriptManager....

Etc.

I'm not saying that's the problem, but I'm unfamiliar with how that prefix got there.


hello.

btw, you should also start by using fiddler to see the msg that the client is receiving from the server...is there any forbidden xml chars on the head section?


Eureka!

The problem was that there was a<script language="Javascript"> block on the head of my masterpage.

I canceled it and everythigs works!

Can anybody tell me why?


hello.

well, currently, atlas packages the content of the head element in the msg that is sent from the server in response to a partial postback. since it doesn't escape those elements (say, by using a cdata section), you can't have any forbidden xml chars there (and it's really easy to get one of those inside a javascript script - for instance, this would make your document not well formed: for( ; i < 10; i++ ))

in the current version of atlas, when the returned xml document isn't well formed, the client platform discards it without giving any feedback.

Very slow and unresponsive AJAX (Calendar + Tabs)

i just installed the toolkit into Visual Studio 2005, and managed to create some sample projects

I've implemented the Tabs and Calendar onto an existing project, in the believe that Ajax would provide faster (or as fast) access then the existing solution.

in order to make the Ajax work in the project, I've copied nearly all needed elements into the web.config ( http://codebetter.com/blogs/jay.kimble/archive/2006/10/26/How-To_3A00_-Enable-Microsoft-Ajax-Beta-over-on-an-existing-site.aspx )

now - the Ajax Calendar and Tabs works, the old server side asp.net have been fitted to the new controls...

but very very slow !?!? - the calendar takes 3-4 seconds to show and a single action in it takes 1-2 seconds ?

code:

1<%@dotnet.itags.org. Control Language='vb' AutoEventWireup='false' Codebehind='ctlQuizEdit.ascx.vb'2 Inherits='SurveyFactory.ctlQuizEdit' TargetSchema='http://schemas.microsoft.com/intellisense/ie3-2nav3-0' %>3<%@dotnet.itags.org. Register TagPrefix='fcke' TagName='FckHeader' src='ctlImportDefLangHeader.ascx' %>4<%@dotnet.itags.org. Register TagPrefix='fcke' TagName='FckFooter' src='ctlImportDefLangFooter.ascx' %>5<%@dotnet.itags.org. Register TagPrefix='cc1' TagName='HeaderFooter' src='ctlHeaderFooter.ascx' %>6<%@dotnet.itags.org. Register TagPrefix="cc1" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" %>789<cc1:TabContainer Height="250px" Width="600px" ID="TabContainer1" runat="server">10 <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Survey">11 <ContentTemplate>12 <table id="editQuizData" runat="server" width="100%" cellspacing="1" cellpadding="2" border="0" height="10">13 <tr>14 <td align="left" colspan="2">15 <asp:Label ID="lblQuizAction" Text="Edit" Font-Bold="True" runat="server" /><br>16 <asp:Label ID="lblError" runat="server" />17 </td>18 </tr>19 <tr>20 <td align="left">Title</td>21 <td align="left"><asp:TextBox ID="txtQuizTitle" Columns="80" runat="server"></asp:TextBox></td>22 </tr>23 <tr>24 <td align="left">Description</td>25 <td align="left"><asp:TextBox ID="txtQuizDescription" Columns="80" Rows="2" TextMode="MultiLine" runat="server"></asp:TextBox>26 </td>27 </tr>28 <tr>29 <td align="left">Created by</td>30 <td align="left"><asp:Label ID="lblCreatedBy" runat="server" />31 </td>32 </tr>33 <tr>34 <td align="left" valign="top">Interval</td>35 <td align="left">36 <table id="Table1" runat="server" width="100%" cellpadding="0" cellspacing="0" border="0">37 <tr>38 <td align="left" valign="top">From</td>39 <td align="left" valign="top">To</td>40 </tr>41 <tr>42 <td align="left">43 <asp:TextBox ID="CalendarQuizFrom" runat="server"></asp:TextBox>44 <cc1:CalendarExtender ID="CalendarExtender1" runat="server"45 TargetControlID="CalendarQuizFrom" Format="dd-MM-yyyy" />46 </td>47 <td align="left">48 <asp:TextBox ID="CalendarQuizTo" runat="server"></asp:TextBox>49 <cc1:CalendarExtender ID="CalendarExtender2" runat="server"50 TargetControlID="CalendarQuizTo" Format="dd-MM-yyyy" />51 </td>52 </tr>53 </table>54 </td>55 </tr>56 </table>57 </ContentTemplate>58 </cc1:TabPanel>59 <cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="Header">60 <ContentTemplate>61 <fcke:FckHeader runat="server" ID="FckHeader" />62 </ContentTemplate>63 </cc1:TabPanel>64 <cc1:TabPanel ID="TabPanel3" runat="server" HeaderText="Footer">65 <ContentTemplate>66 <fcke:FckFooter runat="server" ID="FckFooter" />67 </ContentTemplate>68 </cc1:TabPanel>69</cc1:TabContainer>7071<center>72 <asp:Button ID="btnSave" runat="server" Text="Save"></asp:Button> 73 <asp:Button ID="btnCancel" runat="server" Text="Cancel"></asp:Button>74</center>7576<input id="hiddenLangHeaderTxt" type="hidden" name="hiddenLangHeaderTxt">77<input id="hiddenLangFooterTxt" type="hidden" name="hiddenLangFooterTxt">78<input id="hiddenFooter" type="hidden" name="hiddenFooter" runat="server">79<input id="hiddenHeader" type="hidden" name="hiddenHeader" runat="server">80

Hi Montago,

Your program works pretty well after I removed all the UserControls. So we suggest that you should use an exclusive method that remove the controls one by one until find out the exact root cause. Also, Some helpful debugging tools will make your work easy. For example,IE WebDevelopment Helper,HttpWatch,Firebug etc.

If your problem cannot be resolved , please let me know with more information.

Best regards,

Joanthan

view images through xml

I am trying to create a slideshow that has some text and an image. I am able to scroll through the xml file and display the text elements. My problem is with the images. Can anyone help? Thanks

XML:

<?xml version="1.0" encoding="iso-8859-1" ?>
<dogs>
<info>
<name>Archer</name>
<handler>P.O. 1</handler>
<skills>Drugs</skills>
<birthday>4</birthday>
<imagesrc>Images/K9/Dogs/Archer.jpg</imagesrc>
</info>

code:

<xml src="http://pics.10026.com/?src=XML/dogs.xml" id="xmldso" async="false"></xml>

<table width="100%">
<tr>
<td style="width:50%;" align="right">
<span datasrc="#xmldso" datafld="imagesrc"></span>
</td>
<td style="width:50%;" align="left">
<table style="border: activeborder 1px solid">
<tr><td class="TableBottom" width="70">Name:</td><td class="TableBottom" width="100"><span datasrc="#xmldso" datafld="name"></span></td></tr>
<tr><td class="TableBottom" width="70">Handler:</td><td class="TableBottom" width="100"><span datasrc="#xmldso" datafld="handler"></span></td></tr>
<tr><td class="TableBottom" width="70">Skills:</td><td class="TableBottom" width="100"><span datasrc="#xmldso" datafld="skills"></span></td></tr>
<tr><td class="TableBottom" width="70">Birthday:</td><td class="TableBottom" width="100"><span datasrc="#xmldso" datafld="birthday"></span></td></tr>
<tr><td width="70"></td><td width="100"></td></tr>
</table>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<A href="http://links.10026.com/?link=JavaScript:moveprevious()"> Back</A>
|
<A href="http://links.10026.com/?link=JavaScript:movenext()"> Next</A>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<INPUT TYPE="text" WIDTH="100" NAME="Number" style="border:0; text-align:center;">
</td>
</tr>
</table>

<SCRIPT LANGUAGE="JavaScript">

function Start()
{
x=xmldso.recordset;
document.Canine.Number.value=x.absoluteposition+" of "+x.recordcount;
// document.getElementById("mypic").src =x.recordset("imagesrc") ;
}

function movenext()
{
x=xmldso.recordset;

if (x.absoluteposition < x.recordcount)
{x.movenext();}
else if (x.absoluteposition = x.recordcount)
{x.movefirst();}

document.Canine.Number.value=eval(x.absoluteposition);
document.Canine.Number.value=x.absoluteposition+" of "+x.recordcount;
}

function moveprevious()
{
x=xmldso.recordset;

if (x.absoluteposition > 1)
{x.moveprevious();}
else if (x.absoluteposition = 1)
{x.movelast();}

document.Canine.Number.value=eval(x.absoluteposition);
document.Canine.Number.value=x.absoluteposition+" of "+x.recordcount;
}

</SCRIPT>

Change this line <span datasrc="#xmldso" datafld="imagesrc"></span>

to <img datasrc="#xmldso" datafld="imagesrc" />

use the img html control instead of the span control. I tested this in my local machine and works fine

let us know

I tired that and did not work. When I scroll through the images, all I get the the missing image with the red x where the image should be.


Well, it should work. do you have the following image?

Images/K9/Dogs/Archer.jpg

right click the red icon and see the image path.


Yes, I have the image. I even moved it to the same folder as the xml file in case the path was not accurate.


Chris,

I am using IE 7 and it works fine. Which browser and what version are you using?


Forget my last comment. It did work. I did not properly refresh the xml file. Thanks for your help. It is appreciated.

Monday, March 26, 2012

VSITemplate Project

I'm attempting to create a project based on the VSITemplate project, and it works perfectly fine ..

But I want to implement a wizard (based on IWizard, as MSDN tutorials suggest) in the project so I have more control over the creation of the website.

Problem is that, if I use IWizard .. then the TemplateVSI project needs to output a library that can be put into the global assembly cache. Right now, the project file (csproj) doesn't contain any of the items needed to build the project as a library. I've added what I think is needed to get the Build target .. but still, no dll is being outputted.

Is there a better way to do this? Is this even possible? Is there another way I can do this?

Kori

Woo!! Totally figured it out. The wizard files, any forms and the IWizard implementation class, need to be in a seperate project which then can go through the whole GAC install so they can be referenced in the vstemplate. I still wish they didn't have to be installed in the GAC as it's an annoying step that will need to be done on any developer that uses these templates.

Want To create Accordion Script Like Yahoo

Hello Everyone,

I m developing a website in Asp.Net 2.0 with AjaxControlToolkit.I want Buttons To Appear and functional like yahoo Home page..

Any Help Is Appriciated.

Nitin

Which buttons on the "yahoo home page" are you talking about exactly? There are a lot.

I'm not seeing any accordions there, I am however seing some tab controls... but maybe I'm just blind... can you be a little more specific please?

Regards


Hi Nitin,

I suspect that you are saying the Buttons Like "Mail, Messenager,Radio etc". Based on my experience, you should better use TabContainer instead of Accordion.

Best regards,

Jonathan

Saturday, March 24, 2012

WaterMark and CodeBehind

Is it possible to create a watermark control programmatically in code behind? If so can some one provide me with an example?

Thanks,

Kris

Hi Kris,

I think you should check out the first part ofFAQ Item #13.

Thanks,
Ted

Wednesday, March 21, 2012

web application project and ajax

Hi, Sorry am a little confused about the whole thing, but do I need to create a ajax enabled web site to use ajax? What about a web application projects? The reason I ask is the project is already created but I would like to implement some ajax functionality into it.

If this is possible, what do I need to do?

Thanks in advance

Hi there!

After installing Microsoft's Ajax you'll find a new project template "ASP.Net AJAX Enabled Web Application". It differs from the "ASP.Net Web Application" template in some Web.config entries (e.g. it registers assemblies, asynchronous handlers, and a web module), a new Default.aspx template (with a ScriptManager on the page) and a project assembly reference. To Ajax-enable an existing web application project just duplicate these entries in your Web.config and reference System.Web.Extensions.

There happened to be a FAQ entry on the official Atlas/Ajax site dealing with this in detail, but I can't find it at the moment...

HTH and best regards,
Thomas


Hi,

Thank you for your post!

There is some detail information at theofficial MS ASP.Net AJAX site:

Installing ASP.NET AJAX