Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > how to parse changes to control attributes by javascript at post back

Reply
Thread Tools

how to parse changes to control attributes by javascript at post back

 
 
Jeremy Chapman
Guest
Posts: n/a
 
      02-28-2006
I've created a custom control which outputs html at runtime like <span
id="controlid" value="myvalue"></span>. On my page I have javascript that
changes the value of the value attribute. On post back I want to parse the
html changed by the javascript and update a server side variable. I thought
this could be done in by the adding IPostBackDataHander interface to my
classes inheritance, and adding the IPostBackDataHandler.LoadPostData to my
class, and in the OnPreRender of my control calling
Page.RegisterRequiresPostBack(this);. My LoadPostData method gets called on
the postback but I still cant seem to get the new value of the value
attribute from the NameValueCollection. What am I doing wrong?


 
Reply With Quote
 
 
 
 
Raymond
Guest
Posts: n/a
 
      02-28-2006
The span element isn't a form field.
Add the value to a hidden form field besides span.


"Jeremy Chapman" <please@Idontlikespam> wrote in message
news:(E-Mail Removed)...
> I've created a custom control which outputs html at runtime like <span
> id="controlid" value="myvalue"></span>. On my page I have javascript that
> changes the value of the value attribute. On post back I want to parse

the
> html changed by the javascript and update a server side variable. I

thought
> this could be done in by the adding IPostBackDataHander interface to my
> classes inheritance, and adding the IPostBackDataHandler.LoadPostData to

my
> class, and in the OnPreRender of my control calling
> Page.RegisterRequiresPostBack(this);. My LoadPostData method gets called

on
> the postback but I still cant seem to get the new value of the value
> attribute from the NameValueCollection. What am I doing wrong?
>
>



 
Reply With Quote
 
 
 
 
Jeremy Chapman
Guest
Posts: n/a
 
      02-28-2006
Ok, thanks. that works. What controls are considered form fields?

"Raymond" <(E-Mail Removed)> wrote in message
news:y70Nf.31422$pE4.18410@trnddc04...
> The span element isn't a form field.
> Add the value to a hidden form field besides span.
>
>
> "Jeremy Chapman" <please@Idontlikespam> wrote in message
> news:(E-Mail Removed)...
>> I've created a custom control which outputs html at runtime like <span
>> id="controlid" value="myvalue"></span>. On my page I have javascript
>> that
>> changes the value of the value attribute. On post back I want to parse

> the
>> html changed by the javascript and update a server side variable. I

> thought
>> this could be done in by the adding IPostBackDataHander interface to my
>> classes inheritance, and adding the IPostBackDataHandler.LoadPostData to

> my
>> class, and in the OnPreRender of my control calling
>> Page.RegisterRequiresPostBack(this);. My LoadPostData method gets called

> on
>> the postback but I still cant seem to get the new value of the value
>> attribute from the NameValueCollection. What am I doing wrong?
>>
>>

>
>



 
Reply With Quote
 
Raymond
Guest
Posts: n/a
 
      02-28-2006
The various input types, textarea, and select.
The html button type, may be, may be not, best not
use that one as a form field.

"Jeremy Chapman" <please@Idontlikespam> wrote in message
news:OKNq$(E-Mail Removed)...
> Ok, thanks. that works. What controls are considered form fields?
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
UpdatePanel ( url rewrite) 2nd post back url changes Martin ASP .Net 0 04-28-2010 11:47 AM
How does a dynamic control load post back data across post back?? =?Utf-8?B?Z29yaWxsYQ==?= ASP .Net 1 05-25-2007 05:02 AM
IE doesn't preserve changes made by javascript when Back button is clicked lucyh3h@gmail.com Javascript 6 04-05-2007 06:04 AM
Parse reserved attributes as normal attributes Max XML 1 09-22-2006 12:04 PM
Detecting values that have changes on a post back Simon Harvey ASP .Net 2 04-29-2004 09:12 AM



Advertisments