Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional 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 February 16th, 2007, 11:11 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

....I have no idea what you mean. On post back you need to populate other fields in the form but what is the problem you are having? I don't understand with this means: "doesnt work on the drop down."

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
 
Old February 16th, 2007, 11:16 AM
Authorized User
 
Join Date: Dec 2006
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The postback stops working when i use the custom controls or java script on the drop down.
I have data grids,other dropdowns that populates because of postback on this drop down.But with these scripts and custom controls that is not happening.

 
Old February 16th, 2007, 11:24 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

You mean the custom control doesn't implement the Auto Postback feature?

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
 
Old February 16th, 2007, 11:31 AM
Authorized User
 
Join Date: Dec 2006
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Exactly ! And even if i use just plane java script on drop down for type ahead, the script doesnt work or postback doesnt work.
I tried including this code in script too...

if(keyCode==13)
_doPostBack(clientid,' ')

It still doesnt work on Enter key or selecting theselection.
But postback is working otherwise if i select any entry in drop down list without using type ahead,you know just the normal way.

Thanks
Kamal

 
Old February 16th, 2007, 11:56 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Hmm. If you are inherting from a Dropdownlist you should be able to access the AutoPostBack property through your control? You can't do this?

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
 
Old February 16th, 2007, 12:05 PM
Authorized User
 
Join Date: Dec 2006
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thats what i thought when i started ...but looks like i always have to work around hard way ....:-(.
I have also tried creating web base combo box thats where meta builders come into picture but in there combo box the type ahead doesnt work.Then i tried ProgStudio Combo Box http://www.codeproject.com/aspnet/combobox.asp

But in this one lots of basic properties havent been defined ...like SelectedValue,SelectedItem and so on...So its very difficult to use it in web application.

Any work around will help me...

Thanks for helping me

Kamal


 
Old February 16th, 2007, 12:13 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Ahh yes thats right, since you are inheriting from the control you can access the autopost back property but YOUR control must implement the Postback interface and wire up their methods:

RaisePostDataChangedEvent and LoadPostData.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
 
Old February 16th, 2007, 12:17 PM
Authorized User
 
Join Date: Dec 2006
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok....I think i am talking to someone who knows what he is into.You are just terific.

It makes little sense to me know about Why not postback..But do you think there is a work around this or we can do something to make my situation work...

Thanks again.
Kamal

 
Old February 16th, 2007, 12:33 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

I would just say that I know enough ;]

In so far as a work around for this, you will need to implement that interface and those methods in your control to get it to post back. Unfortunately I am extremely busy atm to write the code out for you. Head to google and search for examples of how to implement the Iterface IPostBackDataHandler that will put you on the right track.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
 
Old February 16th, 2007, 01:51 PM
Authorized User
 
Join Date: Dec 2006
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I understand that and i have been trying to do this but being a fresher in .Net i am having troubles.
Do you think this block of code should work considering that i am working in VS.Net 2003 using C#.

bool IPostBackDataHandler.LoadPostData(string postDataKey, System.Collections.Specialized.NameValueCollection postCollection)
        {
        // No need to check for the text portion changing. That is handled automagically

            bool listIndexChanged = false;

            if( TextIsInList )
            {

                ListItem selectedItem = this.Items.FindByText(Text);
                Int32 selectedIndex = Items.IndexOf( selectedItem );

                if ( this.SelectedIndex != selectedIndex )
                {
                    listIndexChanged = true;
                    this.SelectedIndex = selectedIndex;
                }
            }
            else
            {
                if ( this.SelectedIndex != -1 )
                {
                    listIndexChanged = true;
                    this.SelectedIndex = -1;
                }
            }
            isLoaded = true;
            return listIndexChanged;
        }


public virtual void RaisePostDataChangedEvent()
        {
        EventHandler handler = (EventHandler) this.Events[this.EventServerChange];
            if (handler != null)
                handler.Invoke(this, e);
        }
void IPostBackDataHandler.RaisePostDataChangedEvent()
        {
            OnSelectedIndexChanged(System.EventArgs.Empty);
        }

Thanks
Kamal






Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting ahead of IDataReader? technimedia BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 13 July 31st, 2007 11:34 AM
drop down list values based on another drop down noor ASP.NET 1.0 and 1.1 Basics 3 July 5th, 2005 09:57 AM
Drop Down List mrideout BOOK: Beginning ASP.NET 1.0 6 March 18th, 2005 03:32 AM
Drop Down List Beginner123 VB How-To 2 March 7th, 2005 01:56 PM





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