473,386 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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?
Feb 28 '06 #1
3 3274
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:OP**************@TK2MSFTNGP10.phx.gbl...
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?

Feb 28 '06 #2
Ok, thanks. that works. What controls are considered form fields?

"Raymond" <un*******@nothee.net> 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:OP**************@TK2MSFTNGP10.phx.gbl...
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?


Feb 28 '06 #3
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:OK**************@TK2MSFTNGP15.phx.gbl...
Ok, thanks. that works. What controls are considered form fields?

Feb 28 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: William Stacey [MVP] | last post by:
Anyone know of some library that will parse files like following: options { directory "/etc"; allow-query { any; }; // This is the default recursion no; listen-on { 192.168.0.225;...
15
by: Sue | last post by:
Is there such an animal as a frameset/frames server-side webcontrol or htmlcontrol? I have a frameset with two frames - one contains an aspx page with asp buttons that has to do some updating,...
7
by: moondaddy | last post by:
I have a user control being used instead of a frame page. when the user clicks on a menu item I need to send the ID (integer value) of that menu as a parameter in the postback of the user control...
8
by: Galina | last post by:
Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date. When faculty is selected, lists of lecturers and...
5
by: RA | last post by:
I have created a button dynamically; which has been added to a TableCell of a TableRow of a Table control. Is there a way to add onclick event which calls a procedure on the Server-side itself....
1
by: Jorge Ponte | last post by:
hi I have a Web User Control (ascx) - lets call it "My_WUC" - in a Web form. In that WUC I want have a textbox and a button. I want to click on the button and open a popup (I use javascript for...
9
by: UJ | last post by:
I have a page where the user can make changes to some DB stuff. It's not saved until they hit the save button. I'd like to have it so that if they attempt to navigate somewhere else, I give them a...
6
by: Ian Davies | last post by:
Hello I have found the following script php/java for dynamic menu lists. Where a selection from the first updates (filters items in) the other. I have modified it for my tables. However I am...
2
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.