Showing posts with label sample. Show all posts
Showing posts with label sample. Show all posts

Monday, March 26, 2012

AJAX toolkit without asp

Hi,

Are there any examples of using some of the basic controls in the toolkit, without asp. Any sample would be appreciated.

vaidhy

see Online DEMO athttp://ajax.asp.net/ajaxtoolkit/

Ajax Toolkit Issues...

Hi,

i've been using ASP.net AJAX (and Atlas) for awhile and now i wanted to upload it to my site.

So, I wrote some sample Ajax app the uses the toolkit - just to see if it works at my website hoster.

First we had to install the extensions (10x for my hoster to be so nice - he installed it real quick for me)

So, all Ajax extensions works...

Now i've added just a watermark to a textbox... works greate at my dev enviroment but... nothing at my hoster/website.

it's not working, and i don't even see an error... it's like i didn't even added it...

Please, HELP!

Try view source on both versions to see if you can tell what's different in the version from from your hosting site.

Well... at the problematic site the script tags are:

<script src="http://pics.10026.com/?src=http://forums.asp.net/WebResource.axd...

at the working site the script tags are:

<script src="http://pics.10026.com/?src=http://forums.asp.net/ScriptResource.axd...

and i have:

<addverb="GET"path="ScriptResource.axd"type="Microsoft.Web.Handlers.ScriptResourceHandler"validate="false"/>

at my web config...

any clue?!?!

Thanks,

Amit


Then ASP.NET AJAX isn't configured properly. If you've followed their release notes, then you'll probably want to ask this question on their forums. One thing is to make sure you've modified the web.config correctly - there are now sections for IIS6 and IIS7 and maybe you modified the wrong one?


Speaking of which, see the last post here for what I was talking about:http://forums.asp.net/thread/1482249.aspx

Saturday, March 24, 2012

AJAX timer and updatepanel updates entire page!

Hi,

Below is a sample of a very simple page:

<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="Data_test" Title="Untitled Page" %>
<%@dotnet.itags.org. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@dotnet.itags.org. Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>Timers</title>
</head>
<body>sdfsdf
<form id="form1" runat="server">sdsdf
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:Timer runat="server" id="UpdateTimer" interval="5000" ontick="UpdateTimer_Tick" />
<asp:UpdatePanel runat="server" id="TimedPanel" updatemode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger controlid="UpdateTimer" eventname="Tick" />
</Triggers>
<ContentTemplate>
<asp:Label runat="server" id="DateStampLabel" />
</ContentTemplate>
</asp:UpdatePanel>
</form>
</body>
</html>

and the codebehind:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using System.Xml;
using AjaxControlToolkit;

public partial class Data_test : BasePage
{

protected override void Page_Load(object sender, EventArgs e)
{
// Run common functionality in Base page
base.Page_Load(sender, e);

if (User.Identity.IsAuthenticated == false)
{
Server.Transfer("~/Default.aspx");
}

Page.MaintainScrollPositionOnPostBack = true;
}

protected void UpdateTimer_Tick(object sender, EventArgs e)
{
DateStampLabel.Text = DateTime.Now.ToString();
}

}

When I run this, the whole page is refreshed, not just the label in the updatepanel!!!

Why is this??

Thanks,

Kreid

Hey,

Just to be safe, try adding EnablePartialRendering="true" to the script manager. Also, you may want to try putting the timer within the update panel, and see if that is the issue.


Thanks for your reply.

EnablePartialRendering was set to to true. I also just tried to put the timer inside the updatepanel, and set updatemode = Always. No change - the whole page is still updated.

:( Any more ideas?

bmains:

Hey,

Just to be safe, try adding EnablePartialRendering="true" to the script manager. Also, you may want to try putting the timer within the update panel, and see if that is the issue.


Keep in mind the code in your Page_Load is going to be executed in partial postbacks. Wrap that Page_Load code in if (!IsPostBack) { }, and it should work as expected.

AJAX TaskList example and ASPNETDB.MDF

I have downloaded and installed ASP.NET Ajax Sample applications from

http://ajax.asp.net/default.aspx?tabid=47&subtabid=471

I am trying to run the AJAX TaskList example under C:\Program\Microsoft ASP.NET\ASP.NET AJAX Sample Applications\v1.0.61025\TaskList

First I moved the content of the TaskList folder to a virtual IIS directory, making it possible to debug the website on my local IIS server.

When I run the example I get prompted to Login or register as a new user. When I submit the registration form I receive the following error message:

Failed to update database "C:\INETPUB\WWWROOT\TASKLIST\APP_DATA\ASPNETDB.MDF" because the database is read-only.

I would appreciate some assistance. Is it possible for me to change the permissions forASPNETDB.MDF in order to run the TaskList example?

Thanks

Additional information:

I have installed SQL Server Management Studio Express as I figured this tool might help me to change the permissions. It did not help. I also tried to delete ASPNETDB.mdf, and recreate it by going Website -> Asp.net configuration by adding a new user. I still receive the same error message.

When I point the connection string to a remote SQL database of mine it is possible to register users in ASPNETDB.mdf. But I havn't figured out how to add users using a local version of ASPNETDB.mdf.

I am running Visual Studio on Windows XP. In windows XP you can't just modify permissions for folders as far as I know. I have recently installed SQL Server Management Studio Express as I said before.

I read somewhere that the read/write property for ASPNETDB.mdf may be enabled by checking a box somewhere.

But in SQL Server Management Studio Express tried the following:

*Right click on databases and click attach

*Click Add and select the database ASPNETDB.mdf

*Click OK

*Right Click on the path for ASPNETDB.mdf and click properties

When I click 'Options' under select a page Database Read-Only is already set to false.

If there is no way to use a local version of ASPNETDB.mdf (located to the App_Data folder) I simply have to put up with my remote MS SQL 2005 database. But the subscription fee for this database is outrageous, and therefore I hope that someone might help me and everyone else by providing the appropriate steps to use ASPNETDB.mdf located to the App_Data folder.

Thanks
Svenbro

Wednesday, March 21, 2012

AJAX Tab Control

Hi,

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

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

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

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

Test 1

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

Test 2

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

Test 3


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

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