Accessing dynamically created client-side controls via Request.Form.GetValues

Hi all,

am trying to retrieve the values of a set of dynamically created client-side controls via
Request.Form.GetValues ... is it possible? cuz am getting a NullReferenceException
When i execute Request.Form.GetValues("textBox") , and if it's impossible can i get an alternative?
var newRow = document.getElementById("table1").insertRow();
var newCell = document.createElement("TD");
newCell.innerHTML = "<input type='text' id='newText' value='blabla'>";
on the server-side,
it goes like this:
string[] values = Request.Form.GetValues("newText");
thank you,

The best glimpse of heaven is on the way into hell ;)
10/12/2004 3:55:36 PM 24353 articles. 2 followers. Follow

4 Replies

Similar Articles

[PageSpeed] 9

the call for retrieve value from the form is all right, you will get the form values after the submit event...

then you can organize the string array for display or your procedure...

Guillermo del Castillo

10/12/2004 4:45:24 PM
IIRC, the form inputs will be posted back by name.  So, you should be able to change:

newCell.innerHTML = "<input type='text' id='newText' value='blabla'>";
newCell.innerHTML = "<input type='text' id='newText' name='newText' value='blabla'>";
10/12/2004 5:28:34 PM
Thanx alot stiletto , one more thing ?

how can I get the value of the selected-item in a client-side dropdown list using Request.Form.GetValues, like we get on the client-side:
and how can i determine the type of the control its values is retreived using Request.Form.GetValues ,
Lets say we have:
<input type="text" name="ctrl1" id="ctrl1" value="helloWorld"> and
<select id="ctrl1" name="ctrl1">
<option value="1">hello</option>
<option value="2">bye</option>
The best glimpse of heaven is on the way into hell ;)
10/13/2004 7:34:29 AM
You can't name the inputs the same, but, otherwise, if you change the name of the text input:

string selectedValue = Request.Form["ctrl1"];
Should return the selected value for the given code.
10/13/2004 5:35:04 PM

Similar Artilces:

How to access dynamically Html controls (client side controls) using C# server side scripts
Folks,I have problem try to to access dynamically Html controls (client side controls) using C# server side scripts. Please give me helps.     The error is as follows Exception Details: System.InvalidCastException: Specified cast is not valid.Source Error: Line 79: { Line 80: Control c = Page.FindControl("ddlTC" + i); Line 81: ((DropDownList)c).DataSource = mdt; Line 82: ((DropDownList)c).DataTextField = "ClassID"; Line 83: ((DropDownList)c).DataValueField = "Course"; My aspx page source codes: ...<...

I'm having a problem with creating dynamic control (dropdown) on client side & accessing that control on code behind.
Hi Team, In page load default I’m showing "start time" dropdown,” End time" dropdown. I'm giving one checkbox option to user, if user checks I’m enabling the button. On that button click, I want to create client side dynamic controls for adding on start time, end time. Start Time with 3 dropdown Hours, Mint, Unit (AM, PM). End Time with 3 dropdown Hours, Mint, Unit (AM, PM). This scenario is for measuring "SAMPLE “multiple start time, end time. I want to calculate the duration of start, end time & show to user. Can any one give me the idea or ...

List of client side function of extenders and controls for client side
Hello All,I am using AJAX control toolkit for my current project. Now I need to find out what client side functions I can call on an extender. Lets say I am using a PopControlExtender. Now I want to show the popup from a JS funtions.If I can do a guess then it would be something like this$find('ppce').show();From where I can find what client side functions I can call on those extensders. This is really a frusterating thing. I learn about extenders only from Learn tutorials, no help here and there. Can anybody please tell me where are documentations about all the extenders in the tool...

Validation Controls in .NET ( Client side or server side?)
 i have a very basic question. We have all these validation controls in ( required field, range validator and others) question is the required field validator is a server side control. So does that mean that it does a post back? it client side or server side control  The only controls that post back are buttons and other inputs where you set AutoPostback="True", such as a dropdownlist or a textbox.  Another way of posting back is using an UpdatePanel and placing a trigger in it for a specified control and/or event. All controls are considered clien...

Client Side Dynamically Created Controls
All, I hope someone can help me solve this issue.  I am creating a page that dynamically inserts a row in a HTML table and puts dymamically created controls in the cells.  This is all done on the client via JavaScript.  My problem is that i cannot apply style attributes to the dynamically created controls.  My code is as follows: function clickAddPicture(){    objFileUpload = window.showModalDialog("upload_file_edit.aspx", objFileUpload, "dialogHeight:220px; dialogWidth:600px;");     if (objFileUpload.Cancelled == fals...

Create ModalPopupExtender control dynamically client side
I know this is a long shot and most probably not possible but i figured it wont hurt to try.I have a web page that a table and each table row has a couple of buttons. On the server, these rows and controls get dynamically generated and a modalextender control is then supplied to each of the buttons, so that each button is tied to an extender control.So basically when user clicks on the button within the row the pop up occurs. This application is mainly a DHTML application, so there is a HTML button that allows the user to add additional rows to the table. This is done all client side, s...

How to access Client Side control in server side button click event?
Hi all, I need to access client side control from server side code. For an example <form id="form1" runat="server"> <table> <tr> <td>UserName:</td> <td><input type="text" id="textBoxUserName" /></td> <td><asp:Button ID="buttonShow" runat="server" Text="show" OnClick="buttonShow_Click" /></td> </tr> </table>   </form> I need to access the textBoxUsername in the server side button click event. How to do that? Than...

Is it possible to call client side function from server side code without initial client request?
Atlas is great. I'm using timer to periodically check database changes on server to populate client side controls with new data. Is it possible to do it without a lot of client requests to server which takes a huge useless network traffic? Server should call client side function on all connected clients when, for example, 'database updated' event occurs on server. Thanks. Hi~ Just for your interest, I think you could have a look at Comet, many web IM like Gmail's embeded Gtalk and are built on this architecture你好! Just FYI o_O...

What are diff Server-side control and Client-side control ?
What are diff Server-side control and Client-side control ? and diff server -side coding and client -side coding ? please help I have answered the first part of your question in your previous posting. Server-side coding languages are ASP, ASP.NET, PHP, CGI (Perl) and many, many more. They are used to create dynamic web content (based on additional information that is attached to the request) and are often used to extract information from databases. Client-side coding languages are JavaScript, VBScript, EMACScript and are used to create dynamic content that responds to the u...

Combining a server-side control with a client-side control!
Hi all, I am trying to combine a server-side control with a client-side control. I have created a listbox in both sides, the client-side control's code is: <select size="4" name="lstFruit" id="Select1" ondblclick="lst_dblClick" visible="false"> <option value="Banana">Banana</option> <option value="Apple">Apple</option> <option value="Mango">Mango</option> <option value="Orange">Orange</option> </select> The other one is the server-side control which has this code:   I wanted to add the ondblClick attribute to the se...

Accessing server-side control in client-side javascript function; on Content page
I am trying to set an asp:textbox value in the Client side javascript function. It works fine on the standalone page. But when i try to do this the Content page, it’s giving the follwoing error message. document.getElementByID[...] is null of not an object  Any idea? Thanks, Riz   Hi, are you using ClientID property of that server control, to get its ID (which is rendered at the client and can be used with document.getElementById )?Thanks,Teemu KeiskiFinland, EU Thank you my problem is solved....

How to access HTML controls created at runtime by client side jscript?
I have a webform that uses some javascript to add extra tablerows, cells, and some HTML input controls like radios and checkboxes. Is there a way for the code behind files to access these dynamically created HTML controls once the page is posted back to the server? Right now i am finding the controls created client side are not being rendered back on the server. add runat="server" on those controlsCheersAlMy BlogMapStats.NETPlease click on 'Mark as Answer' if this post answered your question! Hi Jimmy, That's a tough one. It would be possible but only with some significant dev...

How to Access/Pass Server Side Array Variable at Another Web Form's Client Side
Hi All,I struck up with some intrested senario at my application development...hope some body will guide me or sends me some code snippets....Thanks in advance.Senario is like A.aspx (using C# .net 2.0 as code behind) I am going to have a array variable basically it is an TWO Dimensional array after populating the values in array I need to redirect/ reload another web form B.aspx, here i need to access the array in B.aspx client side JavaScript.How can I do this...Thanks AgainRaju Dont do a redirect but use server.transfer. That way the previous page will still hold its value, ...

Is there a correspondance for each server side control to be equivalent to a client side html control
Where can find the list and can use that equivalence and what is its usage plsThanksThanks a lot, I appreciate your taking the time to help me. What exactly do you mean? A correspondence of what?All controls have a ClientID property, which for most controls tells the DOM element ID that will be used in the HTML rendering. Aside from that certain controls might offer additional client-side functionality, but there's no one standard.Thanks,EilonBlog: I mean. When I am using html control in my aspx page like:  <input type=text ..>  and...

Web resources about - Accessing dynamically created client-side controls via Request.Form.GetValues -

iPhone 5 A6 chip to dynamically up-clock up to 1.3GHz (and downclock too)?
Interesting video from our friends at TLDToday: If this is not just a Geekbench app glitch, it could indicate why that A6 processor is so 2X ...

Apple's Lightning port dynamically assigns pins to allow for reversible use
... a closer look at how Apple's new Lightning connector works, and has come to the conclusion that the 8 pins on each side of the plug are dynamically ...

iPhone 5 Lightning port dynamically reassigns pins
... of Apple's Lightning USB cable shows that the pins on the plug aren't arranged symmetrically, suggesting that the Lightning port can dynamically ...

Urlbox Launches Screenshots-as-a-Service Platform to Dynamically Update Galleries
... changes. Launched yesterday, Urlbox allows anyone with a gallery displaying website screenshots to automate the process and keep them dynamically ... launcher dynamically adapts to what you’re doing right now
... phone according to what you’re doing. Perform a search for ‘football’ and your background will change to the NFL logo. A launcher that dynamically ...

A YouTube Experiment Resizes the Player Dynamically
There's a new YouTube experiment that changes the video player's size, depending on the browser window's size. When resizing Chrome's window, ...

Apple Granted “Dynamically Changing Cursor for User Interface” Patent, Originally Filed in 2003
... a utility patent that covers the use of the mouse cursor that changes according to the context of the task it is engaged in. Called a “Dynamically ...

Atmel's FPSLIC II Dynamically Reconfigurable SoC Supports "Silicon-Sharing" For Peripherals & Interfaces ...
Silicon-Sharing Fits 200K Gate Design into 40K Gate FPSLIC II's, Cuts Power Drain by 97% Launcher Wants to Dynamically Change Phones Based on Location, Interests, and Mental State ...
What if your phone’s launcher dynamically changed based upon interests, your location, or topics you had in mind at a specific moment? A new ...

Resources last updated: 12/22/2015 1:55:38 PM