Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 23rd, 2004, 12:19 AM
Authorized User
 
Join Date: Mar 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default Facing problem with coding

I'm facing a problem with this error: -

Parser Error Message: '<%=opt%>' is not a valid identifier.

__________________________________________________ ___________________
and my coding is like this: -

<asp:dropdownlist id="selection" runat="server" AutoPostBack="true" OnSelectedIndexChanged="SelOption">
                                    <asp:listitem Value="HomeAddr" Text="Home Address"/>
    <asp:listitem Value="BusinessAddr" Text="Business Address"/>
    <asp:listitem Value="OtherAddr" Text="Other Address"/>

</asp:dropdownlist>

<Acme:Address id="<%=opt%>" Caption="Address" runat="server"/>

__________________________________________________ __________________

I just want the id the change dynamically each time i select an item in my dropdownlist. Can anybody help me with these codes or is there any better code that i can refer to do same thing? Any help will be appreciated...



 
Old March 23rd, 2004, 10:18 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

I don't think it quite works that way, using <%= %>. You can use the SelectedIndexChanged event for when the selected item changes, but I don't know if you want to change the ID field; what are you trying to achieve?
 
Old March 23rd, 2004, 09:01 PM
Authorized User
 
Join Date: Mar 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I just want to create a form which users can add their address of home, business or other address without showing out all 3 textbox in a same time. so, i use a dropdownlist to let the users to choose which address that they would like to input.

 
Old March 24th, 2004, 09:27 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

How about having three textboxes (two hidden and one visible), so that when the user switches values in the drop-down list, the appropriate textbox is visible.
 
Old March 24th, 2004, 03:10 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

If you are posting back each time the dropdownlist selection changes, you shouldn't need to have 3 textboxes. Just create the textbox in your code behind file and set it's ID there.

J
 
Old March 24th, 2004, 08:57 PM
Authorized User
 
Join Date: Mar 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks bmains, i succeeded to use this method. but another way, katsarosj; can i know what do we mean as code behind file? I'm just a beginner. maybe this question sounds stupid to you guys, but can you tell me what is this code behind file? is this file save as file.ascx?

 
Old March 25th, 2004, 09:12 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

The @Page directive has an attribute specified as CodeBehind, which specifies a separate file for which you can put your server-side code in it.
 
Old March 25th, 2004, 03:40 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

See if this article clears it up for you.

http://www.eggheadcafe.com/articles/20030518.asp

J





Similar Threads
Thread Thread Starter Forum Replies Last Post
Facing Problem in WSAD mvharish J2EE 0 May 25th, 2007 04:24 AM
i am facing a problem mkazim85 SQL Language 2 April 20th, 2007 07:28 AM
facing big problem Manish Malhotra Classic ASP Basics 1 June 19th, 2006 01:35 PM
Facing problem with commandtimeout altaf SQL Server ASP 0 June 27th, 2003 08:33 AM
Facing problem with commandtimeout altaf Classic ASP Databases 0 June 27th, 2003 08:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.