ajax help

Sep 24 2008 5:18 PM

I have been trying to get some simple AJAX on my site but its not going so well
I am not sure what my problems is what i am trying to do is populate a text field

Here is my code


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default5.aspx.cs" Inherits="_test_Default5" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

<title>Untitled Page</title>

<script language="javascript" type="text/javascript">

function fadeout(text){

alert(text);

text.style.filter="blendTrans(duration=2)";

text.filters.item(0).Transition=12;

// doFilter(text)

}

function doFilter (text) {

filterFrom.filters.item(0).Apply();

text.filters.item(0).Transition=12; // 12 IS THE DISSOLVE FILTER

text.style.visibility = "hidden";

filterTo.style.visibility = "";

filterFrom.filters.item(0).play(14);

}

</script>

</head>

<body>

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

<asp:ScriptManager ID="ScriptManager1" runat="server">

</asp:ScriptManager>

<asp:DropDownList ID="quataty" runat="server" AutoPostBack="True"

onselectedindexchanged="quataty_SelectedIndexChanged" >

<asp:ListItem Value="25" Text="25"></asp:ListItem>

<asp:ListItem Value="50" Text="50"></asp:ListItem>

<asp:ListItem Value="75" Text="75"></asp:ListItem>

<asp:ListItem Value="100" Text="100"></asp:ListItem>

<asp:ListItem Value="200" Text="200"></asp:ListItem>

<asp:ListItem Value="300" Text="300"></asp:ListItem>

</asp:DropDownList>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">

<ContentTemplate>

<asp:Label ID="total" runat="server" Text=""></asp:Label>

</ContentTemplate>

<Triggers>

</Triggers>

</asp:UpdatePanel>

<br /><br /><br /><br /><br /><br />

<asp:Label ID="time" runat="server" Text=""></asp:Label>

</form>

</body>

</html>

 


using System;

using System.Collections;

using System.Configuration;

using System.Data;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.HtmlControls;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

public partial class _test_Default5 : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

 

time.Text = "123";

}

 

protected void quataty_SelectedIndexChanged(object sender, EventArgs e)

{

total.Text = quataty.SelectedItem.ToString();

}

}


Answers (1)