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  |  

telerik -- supercharge your DNN websites
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Aspose - The .NET & Java component publisher
 


  Sponsors  

Meet Our Sponsors

The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  ClientAPI Compo...  RegisterClientVariable query. Please advise
Previous Previous
 
Next Next
New Post 2/19/2007 1:53 AM
User is offline John Braga
73 posts
10th Ranked


RegisterClientVariable query. Please advise 

I am trying a simple ClientAPI callback app, but have come unstuck with sharing a variable between Clientside and serverside. 

I am trying to pass a string variable from the onclick method of a button to the server RaiseClientAPICallBackEvent.  I code

dim szPrev as string
dim startdate as datetime

then in the Page Load I say

   ClientAPI.RegisterClientVariable( Page, szPrev, startdate.AddMonths(-1).ToString(), True )

but I find this has NOT set the value of szPrev as I expected, so I add

   szPrev = startdate.AddMonths(-1).ToString()

Still in the Page_Load I add

 

Me.btPrev.Attributes.Add("onclick", ClientAPI.GetCallbackEventReference(Me, _
"dnn.getVar('szPrev')""successFunc""'" & Me.ClientID & "'""errorFunc"))

 but on the serverside event, I find that eventArgument is undefined.

Am I missing something simple?  TIA!

 

 
New Post 2/19/2007 2:31 AM
User is offline John Braga
73 posts
10th Ranked


Re: RegisterClientVariable query. Please advise 

To answer my own question, I have misunderstood how RegisterClientVariable works.  I should NOT have defined szPrev on the serverside, so I:

a.  removed the 'dim szPrev as string' statement

b.  changed the registerClientVariable statement to:

    ClientAPI.RegisterClientVariable( Page, "szPrev", startdate.AddMonths(-1).ToString(), True )

c.  removed the szPrev = statement

and then the callback worked perfectly!!

 

 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  ClientAPI Compo...  RegisterClientVariable query. Please advise
 


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.

 


ADefWebserver.com
DotNetNuke® Module Development Help Website
ADefWebserver.com
Get Smarter Mail, SmarterStats, SmarterTickets
Windows mail server, web log analytics, and customer service management software - Free Editions Available!
www.smartertools.com
DotNetNuke Modules, Skins, Training and Consulting
If you want DotNetNuke done right then look no further. Developed Solutions provides module development, skin design, user and developer training and consulting. Based in Adelaide, Australia, we offer our services worldwide.
www.developedsolutions.com.au

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