Nikolas, what is the javascript error that you are getting?

Apo pou eisai?

Greg Ewing [MVP]
www.citidc.com  

-----Original Message-----
From: Nikolas N. Demiridis [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 06, 2004 5:28 AM
To: [EMAIL PROTECTED]
Subject: [AspNetAnyQuestionIsOk] Postback not working

Hello,

I recently started using ASP.NET (C#) to build my web applications. Since I
am still at the learning proccess, please allow me the following question.

I created a simple DropDownList control with the AutoPostBack property set
to "true" and the OnSelectedIndexChanged event setted to a procedure e.g.
Selection_Changed that all it does is to get the SelectedValue property of
the ListItem and put it in the Text property of a Label Control.

[Sample Code]

<script language="C#" runat="server">
protected void Selection_Changed(Object Src, EventArgs E)
{       
        lblWineSelected.Text = ddlWinesList.SelectedValue; } </script> ...
<form runat="server">
...
<asp:label id="lblWineSelected" />
...
<asp:DropDownList ID="ddlWinesList" runat="server"
OnSelectedIndexChanged="Selection_Changed" AutoPostBack="true">
<asp:ListItem Text="Red Wine" Value="Red Wine" /> <asp:ListItem Text="White
Wine" Value="White Wine" /> <asp:ListItem Text="Rose Wine" Value="Rose Wine"
/> </asp:DropDownList> ...
</form>

The problem is that when I try to check my web form on the web browser I get
a JavaScript error on the Javascript function __doPostBack.

When I set AutoPostBack="false" and add an <asp:button> control everything
works just fine.

Why the javascript produced to postback the form is not working correctly?
What may I be doing wrong? Any ideas welcomed!

Thank you for your time.

________________________________

nikolas n. demiridis
[EMAIL PROTECTED]



____________________________________________________________________
http://www.freemail.gr - dyqe\m upgqes_a gkejtqomijo} tawudqole_ou.
http://www.freemail.gr - free email service for the Greek-speaking.


------------------------ Yahoo! Groups Sponsor --------------------~-->
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links



 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to