AllExperts > Experts 
Search      

VB.NET

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More VB.NET Answers
Question Library

Ask a question about VB.NET
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Syed Rizwan Muhammad Rizvi
Expertise
I can answers questions regarding web based and desktop based programming in VB.Net. Which can include SOAP, XML, Custom Controls, COM Interoperability etc.

Experience
Have been working in this specific area for last 2 years previously I was a VB 6 Developer with experties in other languages as well. Total 10 years of programming experience.

 
   

You are here:  Experts > Computing/Technology > Basic > VB.NET > VB.NET Project (some code to help)

Topic: VB.NET



Expert: Syed Rizwan Muhammad Rizvi
Date: 6/2/2006
Subject: VB.NET Project (some code to help)

Question
Hello Syed,

Thanks for the assistance. I set AutoPostBack to true, but upon execution of the program got the following error(I got the error even when AutoPostBack was not set to true):

Error   1   Method 'Protected Sub DropDownList1_SelectedIndexChanged(sender As Object, e As System.Web.UI.WebControls.GridViewCommandEventArgs)' does not have the same signature as delegate 'Delegate Sub EventHandler(sender As Object, e As System.EventArgs)'.   

My expectation for webform three is that the GridView appears upon selecting a state in the dropdown list.  Both the gridview and dropdownlist are connected to the PUBS database in SQL Server 2000. Would it be possible to show you the webform by zipping the file and emailing to you? If so then perhaps doing that could offer clarification on what I am trying to accomplish.

Sachin
-------------------------

Followup To

Question -
Hi Syed,

I have the code from the third web form here.  Hopefully it  may clarify what I was talking about in my last email.

Here is the VB:

Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs)
       Session("state") = e.CommandArgument
       If GridView1.Rows.Count > 0 Then
           GridView1.Visible = True
       End If

Also here is a custom SQL statement that I created for the Gridview1 so that it would display the data as soon as I chose a state from the dropdown list:

select * from authors where au_id IN (select au_id from titleauthor where state=@state)

Hope this helps. Thanks again!

Sachin

Answer -
By default the DropDownLists AutoPostBack property is set to false, pls. ensure that its set to true.

if thats not the problem then please explain what do you expect and where is it failing your question is quite vague otherwise.


Answer
you cant modify the signature of the DropDown's SelectedIndex change event.

The header for the event handler should be
(sender As Object, e As System.EventArgs)
and not
(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs)

Please modify the signature.

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.