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  |  

$4.95 Windows Hosting at Webhost4life.com
  Ads  
Engage Software - Training Partner for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
Verndale
The Official Microsoft ASP.NET Website
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Major headache - can anyone help?
Previous Previous
 
Next Next
New Post 6/6/2006 3:09 PM
User is offline Patricia Norris
1 posts
10th Ranked


Major headache - can anyone help? 

I have a DotnetNuke control (using version 1 of DNN) where users enter visits to clients. They wanted a cumulative total as they are entering. They enter a variable number of visits per day - sometimes 3, sometimes 5, sometimes 6, etc. I made the form so it generates a set of controls as they are entering - so all the dropdowns, text boxes, are dynamically created as they need them. Everything works fine as far as the users selecting activity, client, visit duration, etc. I even have the cumulative total working, but only if a single user is entering data. When several users are entering data at the same time, the cumulative total shows all user's totals. I am posting my code, if someone can tell me where I've gone wrong, I'd really appreciate it. (Note: I tried declaring dblVisitTotal as a static variable in the text_changed code to hold the total, but it wouldn't collect the cumulative total for all the visit duration text boxes, I would only get the last duration entered, so I changed it to a Shared variable in the class. Is this the reason it's adding all user's totals when several are using it at the same time? I'm sure I've used static variables with success in the past, but not sure if it doesn't work because of the dynamic nature of the controls, etc. I'm sure I've made really stupid errors, any suggestions would be appreciated. I'm fairly new to all of this, so won't be offended at any suggestions)

Here is the code for the text_changed method for the control:

Private Sub txtVisitDuration_TextChanged(ByVal sender As Object, ByVal e As EventArgs)

If sender.GetType.ToString = "System.Web.UI.WebControls.TextBox" Then

Try

Dim ctl As New System.Web.UI.WebControls.TextBox

ctl = sender

If v13wstat3.Item(ctl.ID) Is Nothing Then

'add to view state, first time control has been populated

v13wstat3.Add(ctl.ID, ctl.Text)

'remove after testing

'Response.Write("Item " & ctl.ID & " created in View State.")

Else

'remove old value of text box, text has changed

dblActivityTotal -= Convert.ToDouble(v13wstat3.Item(ctl.ID))

'assign new value of text box

v13wstat3.Item(ctl.ID) = ctl.Text

'remove after testing

'Response.Write("Item value for " & ctl.ID & " changed in View State.")

End If

dblActivityTotal += Convert.ToDouble(v13wstat3.Item(ctl.ID))

txtCumTotal.Text = dblActivityTotal.ToString()

v13wstat3.Item("txtCumTotal") = dblActivityTotal.ToString()

'Response.Write("txtCumTotal v13wstat3 = " & v13wstat3.Item("txtCumTotal") & "<br>")

'Response.Write("<br>SubTotal: " & sngActivityTotal.ToString())

Catch ex As Exception

End Try

End If

End Sub

 

Thanks in advance for any suggestions/help/advice, I certainly need it!!!!           Miss P

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Major headache - can anyone help?
 


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.

 


WDK Solutions
Quality modules for the DotNetNuke community. Check out our 'wild' modules!
wdkns.com
UK - DotNetNuke providers
UK providers of DNN module development and skin package design. Oxford Information Labs provides cost-effective solutions for businesses and organisations specialising in Skin design and bespoke module development.
www.oxil.co.uk
TronixSoft
Hosting for local businesses that want more from their websites.
www.TronixSoft.com

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