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  |  

PortalWebHosting
  Ads  
Iron Speed Designer is a software development tool for building database, reporting, and forms applications for .NET without hand-coding.
 


  Sponsors  

Meet Our Sponsors

OnyakTech
CrystalTech Web Hosting™
Webhost4life, specialists in DNN hosting
Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
SteadyRain
DataSprings - Great Ideas. Always Flowing.
 


DotNetNuke Forums
 
  Forum  DotNetNuke® Pro...  ClientAPI Compo...   Getting updated hidden input values via callback event
Previous Previous
 
Next Next
New Post 2/27/2006 7:50 AM
User is offline Scott Schecter
155 posts
scottschecter.com
9th Ranked


Getting updated hidden input values via callback event 
Bascially I have a hidden input field which contains a page number for a list view. When clicking on next or previous a xmlhttprequest is invoked and the requested page of data is rendered and I update the hidden input fields value with the new page. Now, the next time they hit next/previous the xmlhttprequest is invoked, and I need to grab the updated value serverside to use to populate the requested page. Since no postback occours during this the value I obtain via server side logic is still the old value. My question is this; how can I get the updated clientside value of the hidden input from my server code since it is never posted back. Thanks a lot for any help.
 
New Post 2/27/2006 8:05 AM
User is offline Jon Henning
1622 posts
www.codeendeavors.com
5th Ranked










Re: Getting updated hidden input values via callback event 

The only updated state information passed to the server is contained within the callback.  Thus you will need to pass any values you need in the single argument of the callback (delimited by some known character).  In the serverside code simply parse the single argument out into multiple ones.

Hopefully it is also obvious that any state information written during a callback will also not be persisted in the page, since it is not re-rendered.  Note:  this excludes Session state which would work if you chose to use it.


 
New Post 2/27/2006 8:15 AM
User is offline Scott Schecter
155 posts
scottschecter.com
9th Ranked


Re: Getting updated hidden input values via callback event 
I do understand what your saying, and it was intentional that I have avoided using state to store said variable. The part I am not quite clear on is this.

Thus you will need to pass any values you need in the single argument of the callback (delimited by some known character).

I assume your saying when adding the callback atribute to the control and setting the Argument, but I'm not sure how to do that in application. Would you write me alittle one liner to illustrate your point.

                this.cmdNext.Attributes.Add("onclick", ClientAPI.GetCallbackEventReference(this, "dnn.dom.getById('" + this.NSNext.ClientID + "').value", "nsNextSuccessFunc", "this", "nsNextErrorFunc"));

is what I have now. the additonal client control I want to grab the value for during the callback event is

   <input id="NSPage" type="hidden" runat="server" value="1" contenteditable="true" />

I am just not sure how to add that to the above assignment. I have tried a few different ways with no luck thus far. Thanks for your patience with me.



 
New Post 2/27/2006 8:30 AM
User is offline Jon Henning
1622 posts
www.codeendeavors.com
5th Ranked










Re: Getting updated hidden input values via callback event 

You could concatenate things directly like this...

this.cmdNext.Attributes.Add("onclick", ClientAPI.GetCallbackEventReference(this, "dnn.dom.getById('" + this.NSNext.ClientID + "').value + '~' + dnn.dom.getById('" + this.NSPage.ClientID + "').value", "nsNextSuccessFunc", "this", "nsNextErrorFunc"));

But I would probably code it like this...

this.cmdNext.Attributes.Add("onclick", ClientAPI.GetCallbackEventReference(this, "mynicefunctionnamehere()", "nsNextSuccessFunc", "this", "nsNextErrorFunc"));

and somewhere in the page (or separate js file) define

function mynicefunctionnamehere()
{
  return dnn.dom.getById('" + this.NSNext.ClientID + "').value + '~' + dnn.dom.getById('" + this.NSPage.ClientID + "').value;",
}

On the serverside you would parse the argument (i.e. arg.split("~"))

Note:  If you are unsure that the tilda (~) is a safe character you can use my predefined character for delimiting the string...

function mynicefunctionnamehere()
{
  return dnn.dom.getById('" + this.NSNext.ClientID + "').value + COL_DELIMITER + dnn.dom.getById('" + this.NSPage.ClientID + "').value;",
}

on the serverside the delimiter is found in the clientapi namespace.

arg.split(ClientAPI.COLUMN_DELIMITER)

 


 
New Post 2/27/2006 8:32 AM
User is offline Scott Schecter
155 posts
scottschecter.com
9th Ranked


Re: Getting updated hidden input values via callback event 
Thank you so much for your help, that makes it much clearer to me!
 
Previous Previous
 
Next Next
  Forum  DotNetNuke® Pro...  ClientAPI Compo...   Getting updated hidden input values via callback event
 


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.

 


Efficion Consulting
A premier DotNetNuke consulting firm providing complete DNN services including: custom module development, skinning and design, installation and integration services.
www.efficionconsulting.com
DotNetNuke Training by Engage Software
Specializing in customized training, architecture and module solutions for large scale implementations lead by DNN Core Team Member Christopher Hammond.
engagesoftware.com
Smart-Thinker
DNN Modules for Social Networks for as low as $69 for 6 modules! We also maintain the DotNetNuke Directory - http://DNNDir.com
www.smart-thinker.com

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