Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Multiple Handles and/or Actions?Multiple Handles and/or Actions?
Previous
 
Next
New Post
8/16/2007 11:30 AM
 



Very well!
Now that makes more sense.

Probably the last question I have regarding this thread topic is regarding the event code itself.
Using this method for building custom functions works. Only problem is,I am using code to refresh data by selecting all the data 
and arranging according to client name, which is all being displayed within a listbox.
But each time I click refresh button (which is runing function) it seems to grab twice the data and place another clicks worth of data in listbox.
So for example, lets say I have 4 rows of data. Upon page_init or first click, the listbox has 4 rows of data.
Then I input one more row of data, then click the refresh button, then the listbox displays 6 rows??? Keeps adding to listbox, not database.

Maybe its something within my code. Otherwise, how do I get to not repeat and display false information?

Private Sub MyFunc(ByVal sender As Object, ByVal e As System.EventArgs)
Dim mySqlString As New StringBuilder()
mySqlString.Append(
"SELECT ClientName ")
mySqlString.Append(
"FROM {databaseOwner}{objectQualifier}ModuleName ")
mySqlString.Append(
"ORDER BY ClientName ASC")
Me.ListBox1.DataSource = CType(DataProvider.Instance().ExecuteSQL(mySqlString.ToString(), Nothing), IDataReader)
Me.ListBox1.DataBind()
End Sub

-machina12

 
New Post
8/16/2007 1:22 PM
 



Hello!
The answer was simple.
Hydrate the listbox before pulling values again:

 

Private Sub MyFunc(ByVal sender As Object, ByVal e As System.EventArgs)
Me
.ListBox1.Items.Clear()
Dim mySqlString As New
StringBuilder()
mySqlString.Append(
"SELECT * "
)
mySqlString.Append(
"FROM {databaseOwner}{objectQualifier}iSTORE "
)
mySqlString.Append(
"ORDER BY ClientName ASC"
)
Me.ListBox1.DataSource = CType(DataProvider.Instance().ExecuteSQL(mySqlString.ToString(), Nothing
), IDataReader)
Me
.ListBox1.DataBind()
End 
Sub


Although this last question was specific to my scenario (with a listbox), this post covers how to setup multiple handles and/or actions.
Thanks for everyone's feedback.

-machina12

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Multiple Handles and/or Actions?Multiple Handles and/or Actions?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out