Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AspDotNetStoreFront
  Ads  
Engage Software - Training Partner for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
OnyakTech
CrystalTech Web Hosting™
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Multiple Handles and/or Actions?
Previous Previous
 
Next Next
New Post 8/10/2007 10:03 AM
User is offline old Mac
153 posts
9th Ranked


Multiple Handles and/or Actions? 



Have a feature that updates/refreshes data on page_init.
Ofcourse this event's handle command is:   Handles Me.Init

I obviously have a need for the data to refresh upon page load.
But also I want to have data refresh when inserting or deleting.
I could copy and paste same connection code for each event, but I know that is not the efficient answer.
Using less code smatter is the key.

How can I manage to only use refresh code within page_init event & tell buttons to run the same event?

FYI:
Tried method of "OnClientClick" within .ascx, and input page_init & init...no luck
Not sure if will be telling buttons to run page_init event, or add tags to the handle of page_init.


Feedback Appreciated,

-machina12

 
New Post 8/12/2007 10:29 PM
User is offline Wes Tatters
410 posts
8th Ranked




Re: Multiple Handles and/or Actions? 

Create a DataBind() subroutine or some other name and put your data refresh code in there.

Then call this DataBind() subroutine from any methods / events that need it.

 

 
New Post 8/13/2007 11:17 AM
User is offline old Mac
153 posts
9th Ranked


Re: Multiple Handles and/or Actions? 

Appreciate the response. 
Realized I already have a DataBind() command created within Page_Init.
So it is structured correctly, simply because it refreshes upon Page_Init.

Although, when I add the: Me.ListBox1.DataBind() , the module throws this error:

A critical error has occurred.
Invalid attempt to FieldCount when reader is closed.



Should I be calling it a different way?

-machina12

 
New Post 8/13/2007 5:14 PM
Online now... Baatezu
195 posts
9th Ranked


Re: Multiple Handles and/or Actions? 

 machina12 wrote

How can I manage to only use refresh code within page_init event & tell buttons to run the same event?

The way I'd do this is to take the code out of the Page_Init function put it into it's own function and call that function from all the places that need to run that code.

I'm not sure exactly what you are doing, so there might be something restricting it, but that'd be my first attempt.

 
New Post 8/13/2007 7:05 PM
User is offline Wes Tatters
410 posts
8th Ranked




Re: Multiple Handles and/or Actions? 

You dont want at do any of that sort of coding in page_init.

CREATE a seperate function called MyDataBinding.

Put any code that you need for handling the databinding in that function.

THEN call that function MyDataBinding - when you want to rebind the data.

 

Westa

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Multiple Handles and/or Actions?
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


"SalarO" Skinning Graphic Design Branding Services
SalarO develops packaged & custom skins for your DNN at prices you can afford. SalarO is also developing Module development, Hosting, Branding/Logo design as well as Content Transfer Services to complement the core skinning solutions.
www.salaro.com
Data Springs Inc. - Module Development
Data Springs is a leader in the DNN community offering high quality modules, custom module development, enhancements to the DNN core product and overall DNN support.
www.datasprings.com
XCESS expertise center b.v.
Custom made modules and complete solutions for the DNN framework. Maatwerk modules en complete webtoepassingen gebaseerd op het DNN framework.
www.xcess.nl

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP