When building a form using Infopath, you can define a repeating
section and stick form fields in that section. I'm curious if ASP.NET
has a similar control to make it easy to design something similar
using just ASP.NET (and not Infopath)? I'd hate to think that I'll
need to write all the javascript/dhtml to mimic that functionality and
I don't really feel the need to re-invent the wheel.
Has MS designed such a control? A 3rd party?
Thanks for your time and assistance!
Christoph 11 4137
That's one of the best reasons for learning C# as the task of using
JavaScript becomes much less of a syntax and grammar burden.
So I may have to practice what I preach as I need a form with a textbox
control that gets filled out multiple times which seems to be the only
reasonable way to build nodes in an XML document using a client-side
application.
I don't like the idea of giving away this code. I wouldn't mind so much
but I have a competitor that wants everything I have the way it is so
I was thinking about building he XML document in the ViewState
where the code could run on the server while still allowing the operator
to review and revise before a final commit.
--
<%= Clinton Gallagher
A/E/C Consulting, Web Design, e-Commerce Software Development
Wauwatosa, Milwaukee County, Wisconsin USA
NET csgallagher@ REMOVETHISTEXT metromilwaukee. com
URL http://www.metromilwaukee.com/clintongallagher/
"Christoph Boget" <jc*****@yahoo. com> wrote in message
news:uz******** ******@TK2MSFTN GP11.phx.gbl... When building a form using Infopath, you can define a repeating section and stick form fields in that section. I'm curious if ASP.NET has a similar control to make it easy to design something similar using just ASP.NET (and not Infopath)? I'd hate to think that I'll need to write all the javascript/dhtml to mimic that functionality and I don't really feel the need to re-invent the wheel. Has MS designed such a control? A 3rd party?
Thanks for your time and assistance!
Christoph
"Christoph Boget" <jc*****@yahoo. com> wrote in message
news:uz******** ********@TK2MSF TNGP11.phx.gbl. .. When building a form using Infopath, you can define a repeating section and stick form fields in that section. I'm curious if ASP.NET has a similar control to make it easy to design something similar using just ASP.NET (and not Infopath)? I'd hate to think that I'll need to write all the javascript/dhtml to mimic that functionality and I don't really feel the need to re-invent the wheel. Has MS designed such a control? A 3rd party?
Are you familiar with the Repeater and DataList controls? They can repeat
arbitrary sets of controls for you, one set per input data item.
--
John Saunders
johnwsaundersii i at hotmail
> > When building a form using Infopath, you can define a repeating section and stick form fields in that section. I'm curious if ASP.NET has a similar control to make it easy to design something similar using just ASP.NET (and not Infopath)? I'd hate to think that I'll need to write all the javascript/dhtml to mimic that functionality and I don't really feel the need to re-invent the wheel. Has MS designed such a control? A 3rd party? Are you familiar with the Repeater and DataList controls? They can repeat arbitrary sets of controls for you, one set per input data item.
I've looked at both of these and yes, they are really great for repeating
data coming from a datasource. However, what I need is something
that will repeat controls that will contain user input that will be posted
back to the server and ultimately inserted into a datastore. These are
the two things I can't figure out from reading (what little) documentation
on the repeating control:
* How to repeat a set of empty controls on the client side. For example,
let's say I have 3 input text boxes. Say, for 'First Name', 'Middle Name',
'Last Name'. And these text boxes appear on a form used to add people
to a table in the data store. I can display the first row of those blank
boxes
no problem. But I'm not show how I can make it so that the end user can
make it so that another, blank, row appears so they can add multiple people
in one shot.
* Related to the above, assuming it is possible, how would those new
controls be referenced in the code on the back end. It's easy enough to
reference the initial set of controls as I would just reference them by
name.
What would be the names of the new, dynamically generated controls (ie
the 3 input text boxes)?
The above is the context with which I was asking my original question.
I apologize for not being more clear.
Thank you for your time and assistance!
Christoph
"Christoph" <jc*****@yahoo. com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. When building a form using Infopath, you can define a repeating section and stick form fields in that section. I'm curious if ASP.NET has a similar control to make it easy to design something similar using just ASP.NET (and not Infopath)? I'd hate to think that I'll need to write all the javascript/dhtml to mimic that functionality and I don't really feel the need to re-invent the wheel. Has MS designed such a control? A 3rd party? Are you familiar with the Repeater and DataList controls? They can
repeat arbitrary sets of controls for you, one set per input data item.
I've looked at both of these and yes, they are really great for repeating data coming from a datasource. However, what I need is something that will repeat controls that will contain user input that will be posted back to the server and ultimately inserted into a datastore. These are the two things I can't figure out from reading (what little) documentation on the repeating control:
* How to repeat a set of empty controls on the client side. For example, let's say I have 3 input text boxes. Say, for 'First Name', 'Middle
Name', 'Last Name'. And these text boxes appear on a form used to add people to a table in the data store. I can display the first row of those blank boxes no problem. But I'm not show how I can make it so that the end user can make it so that another, blank, row appears so they can add multiple
people in one shot.
* Related to the above, assuming it is possible, how would those new controls be referenced in the code on the back end. It's easy enough to reference the initial set of controls as I would just reference them by name. What would be the names of the new, dynamically generated controls (ie the 3 input text boxes)?
The above is the context with which I was asking my original question. I apologize for not being more clear.
Ok, no, ASP.NET doesn't do this. It's possible that you could do something
like this with ASP.NET 2.0, though I think you'd still wind up creating your
own control. See the most recent issue of MSDN Magazine for a discussion of
the new GridView control and how it works with the new DataSource controls.
It seems to me that one could have a DataSource control which would allow
you to add data client-side (perhaps as XML stored in a hidden field), but
which would then actually insert the changes into the database once the form
posted back.
--
John Saunders
johnwsaundersii i at hotmail
What you are trying to do is definitely possible in ASP.Net. It's not
exactly trivial but it also isn't terribly difficult once you get the hang
of the controls and classes involved. Undoubtedly, there are as many
possible ways to do it as there are readers of this board but if I were
doing what you're doing, I'd probably go like this:
You could create a DataSet and a Repeater. Assign a table in the DataSet as
the DataSource property of your Repeater using myRepeater.Data Source =
ds.Tables["myTable"];
Create a new row by using the NewRow method of the table and add it to the
table with ds.Tables["myTable"].Rows.Add(newRo w);
Then use myRepeater.Data Bind() to bind the table to your repeater. Now you
have a blank row and it will display the same template as your populated
rows but the values will be null. Make sure you test for IsDbNull and
handle that in your repeater templates.
In your ItemCommand handler of the repeater, you can save or cancel the new
row on postback and, if appropriate, create a new blank row for the next
cycle.
You could create your own repeater and inherit the
System.Web.UI.W ebControls.Repe ater and create your own template inheriting
the ITemplate interface.
You can find a simple example of creating your own repeater at http://coltkwong.com/blogs/juliet/posts/467.aspx. The key thing on that
site is not her exact control but rather how simple it is to create a custom
repeater. There are probably hundreds of other custom repeater examples on
the net. I just know that I used her example as the starting point for
creating the repeater I am using in my current project at work and it has
made my life a lot easier.
Some keywords you may want to look up on google and MSDN are IsDbNull,
ITemplate, Templated Controls, DataBind, TemplateItem,
Repeater.OnData Binding.
Hope that helps some,
Dale
"Christoph" <jc*****@yahoo. com> wrote in message
news:#N******** ******@TK2MSFTN GP10.phx.gbl... When building a form using Infopath, you can define a repeating section and stick form fields in that section. I'm curious if ASP.NET has a similar control to make it easy to design something similar using just ASP.NET (and not Infopath)? I'd hate to think that I'll need to write all the javascript/dhtml to mimic that functionality and I don't really feel the need to re-invent the wheel. Has MS designed such a control? A 3rd party? Are you familiar with the Repeater and DataList controls? They can
repeat arbitrary sets of controls for you, one set per input data item.
I've looked at both of these and yes, they are really great for repeating data coming from a datasource. However, what I need is something that will repeat controls that will contain user input that will be posted back to the server and ultimately inserted into a datastore. These are the two things I can't figure out from reading (what little) documentation on the repeating control:
* How to repeat a set of empty controls on the client side. For example, let's say I have 3 input text boxes. Say, for 'First Name', 'Middle
Name', 'Last Name'. And these text boxes appear on a form used to add people to a table in the data store. I can display the first row of those blank boxes no problem. But I'm not show how I can make it so that the end user can make it so that another, blank, row appears so they can add multiple
people in one shot.
* Related to the above, assuming it is possible, how would those new controls be referenced in the code on the back end. It's easy enough to reference the initial set of controls as I would just reference them by name. What would be the names of the new, dynamically generated controls (ie the 3 input text boxes)?
The above is the context with which I was asking my original question. I apologize for not being more clear.
Thank you for your time and assistance!
Christoph
> Ok, no, ASP.NET doesn't do this. It's possible that you could do something like this with ASP.NET 2.0, though I think you'd still wind up creating
your own control. See the most recent issue of MSDN Magazine for a discussion
of the new GridView control and how it works with the new DataSource
controls. It seems to me that one could have a DataSource control which would allow you to add data client-side (perhaps as XML stored in a hidden field), but which would then actually insert the changes into the database once the
form posted back.
Ok So I guess I'm just going to have to do this the old fashioned way with
DHTML, which is fine as I've done it often enough in the past. But if I do
it this way, I'm still left with my second issue/question -- how do I access
these new, dynamically created HTML form elements in the back end code?
In PHP, this was easy as I could just iterate through the $_POST (or the
$_REQUEST) arrays and just grab all the keys that matched the base name
of the control. It doesn't seem as if ASP.NET has anything close to that
for me to use. As such, I'm not sure how I'd be able to access the values
of those controls.
Just wanted to make a quick comment that I'd rather not post back to the
server to create the new row of form elements and instead create them
dynamically via the client. If I post back to create the form, accessing
the
new form elements/controls is a no brainer.
Thanks again for your time and assistance!
Christoph
"Christoph" <jc*****@yahoo. com> wrote in message
news:uE******** ******@TK2MSFTN GP12.phx.gbl... Ok, no, ASP.NET doesn't do this. It's possible that you could do
something like this with ASP.NET 2.0, though I think you'd still wind up creating your own control. See the most recent issue of MSDN Magazine for a discussion of the new GridView control and how it works with the new DataSource controls. It seems to me that one could have a DataSource control which would
allow you to add data client-side (perhaps as XML stored in a hidden field),
but which would then actually insert the changes into the database once the form posted back.
Ok So I guess I'm just going to have to do this the old fashioned way
with DHTML, which is fine as I've done it often enough in the past. But if I
do it this way, I'm still left with my second issue/question -- how do I
access these new, dynamically created HTML form elements in the back end code? In PHP, this was easy as I could just iterate through the $_POST (or the $_REQUEST) arrays and just grab all the keys that matched the base name of the control. It doesn't seem as if ASP.NET has anything close to that for me to use. As such, I'm not sure how I'd be able to access the values of those controls. Just wanted to make a quick comment that I'd rather not post back to the server to create the new row of form elements and instead create them dynamically via the client. If I post back to create the form, accessing the new form elements/controls is a no brainer.
ASP.NET has the Request.Form and Request.QuerySt ring collections, which you
can use.
You know, if you get into writing ASP.NET custom controls, you could
probably create a control which would do exactly what you want. The user
would create as many repeats of the section(s) as he wants. Then, on the
eventual postback (once per Save, perhaps), when the control loads its
postback data, it would see the number of repeats, and would be able to
create that many copies of the repeating section. It could then load the
postback data into each repeat, producing on the server a copy of the data
which was gathered on the client.
In other words, good luck, and if you get it working, please post the source
code!
--
John Saunders
johnwsaundersii i at hotmail
I agree.
I did this with a DataGrid control and a custom collection.
I have a button that says Add NewRecord.
When it is clicked I add a blank row to my collection and re-bind it to the
grid.
This works perfectly!
Joe Fallon
"Dale" <da************ @msndotcomNot.N et> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. .. What you are trying to do is definitely possible in ASP.Net. It's not exactly trivial but it also isn't terribly difficult once you get the hang of the controls and classes involved. Undoubtedly, there are as many possible ways to do it as there are readers of this board but if I were doing what you're doing, I'd probably go like this:
You could create a DataSet and a Repeater. Assign a table in the DataSet
as the DataSource property of your Repeater using myRepeater.Data Source = ds.Tables["myTable"];
Create a new row by using the NewRow method of the table and add it to the table with ds.Tables["myTable"].Rows.Add(newRo w);
Then use myRepeater.Data Bind() to bind the table to your repeater. Now
you have a blank row and it will display the same template as your populated rows but the values will be null. Make sure you test for IsDbNull and handle that in your repeater templates.
In your ItemCommand handler of the repeater, you can save or cancel the
new row on postback and, if appropriate, create a new blank row for the next cycle.
You could create your own repeater and inherit the System.Web.UI.W ebControls.Repe ater and create your own template inheriting the ITemplate interface.
You can find a simple example of creating your own repeater at http://coltkwong.com/blogs/juliet/posts/467.aspx. The key thing on that site is not her exact control but rather how simple it is to create a
custom repeater. There are probably hundreds of other custom repeater examples
on the net. I just know that I used her example as the starting point for creating the repeater I am using in my current project at work and it has made my life a lot easier.
Some keywords you may want to look up on google and MSDN are IsDbNull, ITemplate, Templated Controls, DataBind, TemplateItem, Repeater.OnData Binding.
Hope that helps some,
Dale
"Christoph" <jc*****@yahoo. com> wrote in message news:#N******** ******@TK2MSFTN GP10.phx.gbl... > When building a form using Infopath, you can define a repeating > section and stick form fields in that section. I'm curious if
ASP.NET > has a similar control to make it easy to design something similar > using just ASP.NET (and not Infopath)? I'd hate to think that I'll > need to write all the javascript/dhtml to mimic that functionality
and > I don't really feel the need to re-invent the wheel. > Has MS designed such a control? A 3rd party? Are you familiar with the Repeater and DataList controls? They can repeat arbitrary sets of controls for you, one set per input data item.
I've looked at both of these and yes, they are really great for
repeating data coming from a datasource. However, what I need is something that will repeat controls that will contain user input that will be
posted back to the server and ultimately inserted into a datastore. These are the two things I can't figure out from reading (what little)
documentation on the repeating control:
* How to repeat a set of empty controls on the client side. For
example, let's say I have 3 input text boxes. Say, for 'First Name', 'Middle
Name', 'Last Name'. And these text boxes appear on a form used to add people to a table in the data store. I can display the first row of those
blank boxes no problem. But I'm not show how I can make it so that the end user can make it so that another, blank, row appears so they can add multiple people in one shot.
* Related to the above, assuming it is possible, how would those new controls be referenced in the code on the back end. It's easy enough to reference the initial set of controls as I would just reference them by name. What would be the names of the new, dynamically generated controls (ie the 3 input text boxes)?
The above is the context with which I was asking my original question. I apologize for not being more clear.
Thank you for your time and assistance!
Christoph
"Joe Fallon" <jf******@nospa mtwcny.rr.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. .. I agree. I did this with a DataGrid control and a custom collection. I have a button that says Add NewRecord. When it is clicked I add a blank row to my collection and re-bind it to
the grid. This works perfectly!
Note that this isn't what the OP wanted. He wanted the added data to be
client-side until the user was done with the entire form. Also, he wasn't
talking about the typical datagrid. He was talking about a group of controls
which would repeat, once per input, but which could have new repeats added
to it on the client.
--
John Saunders
johnwsaundersii i at hotmail
"Dale" <da************ @msndotcomNot.N et> wrote in message news:%2******** ********@TK2MSF TNGP12.phx.gbl. .. What you are trying to do is definitely possible in ASP.Net. It's not exactly trivial but it also isn't terribly difficult once you get the
hang of the controls and classes involved. Undoubtedly, there are as many possible ways to do it as there are readers of this board but if I were doing what you're doing, I'd probably go like this:
You could create a DataSet and a Repeater. Assign a table in the
DataSet as the DataSource property of your Repeater using myRepeater.Data Source = ds.Tables["myTable"];
Create a new row by using the NewRow method of the table and add it to
the table with ds.Tables["myTable"].Rows.Add(newRo w);
Then use myRepeater.Data Bind() to bind the table to your repeater. Now you have a blank row and it will display the same template as your populated rows but the values will be null. Make sure you test for IsDbNull and handle that in your repeater templates.
In your ItemCommand handler of the repeater, you can save or cancel the new row on postback and, if appropriate, create a new blank row for the next cycle.
You could create your own repeater and inherit the System.Web.UI.W ebControls.Repe ater and create your own template
inheriting the ITemplate interface.
You can find a simple example of creating your own repeater at http://coltkwong.com/blogs/juliet/posts/467.aspx. The key thing on that site is not her exact control but rather how simple it is to create a custom repeater. There are probably hundreds of other custom repeater examples on the net. I just know that I used her example as the starting point for creating the repeater I am using in my current project at work and it
has made my life a lot easier.
Some keywords you may want to look up on google and MSDN are IsDbNull, ITemplate, Templated Controls, DataBind, TemplateItem, Repeater.OnData Binding.
Hope that helps some,
Dale
"Christoph" <jc*****@yahoo. com> wrote in message news:#N******** ******@TK2MSFTN GP10.phx.gbl... > > When building a form using Infopath, you can define a repeating > > section and stick form fields in that section. I'm curious if ASP.NET > > has a similar control to make it easy to design something similar > > using just ASP.NET (and not Infopath)? I'd hate to think that
I'll > > need to write all the javascript/dhtml to mimic that functionality and > > I don't really feel the need to re-invent the wheel. > > Has MS designed such a control? A 3rd party? > Are you familiar with the Repeater and DataList controls? They can
repeat > arbitrary sets of controls for you, one set per input data item.
I've looked at both of these and yes, they are really great for repeating data coming from a datasource. However, what I need is something that will repeat controls that will contain user input that will be posted back to the server and ultimately inserted into a datastore. These
are the two things I can't figure out from reading (what little) documentation on the repeating control:
* How to repeat a set of empty controls on the client side. For example, let's say I have 3 input text boxes. Say, for 'First Name', 'Middle Name', 'Last Name'. And these text boxes appear on a form used to add people to a table in the data store. I can display the first row of those blank boxes no problem. But I'm not show how I can make it so that the end user
can make it so that another, blank, row appears so they can add multiple people in one shot.
* Related to the above, assuming it is possible, how would those new controls be referenced in the code on the back end. It's easy enough
to reference the initial set of controls as I would just reference them
by name. What would be the names of the new, dynamically generated controls (ie the 3 input text boxes)?
The above is the context with which I was asking my original question. I apologize for not being more clear.
Thank you for your time and assistance!
Christoph
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: suresh |
last post by:
Namasivayah,
Stroustrup says when indirect array is used for reordering a valarray
the index cannot be repeated twice(page 679). But Nicolai Josuttis in
his book on C++ standard library, page 567, says, index may occur
twice.
g++ version 3.3.5 compiles code with repeated index without any
complaint.
|
by: Brian W |
last post by:
Hi All,
I have a web user control that, among other things, provides Print this
page, and Email this page functionality I have this script that is to
execute on the click of the asp:hyperlinks
I have a function in a <SCRIPT> block that I want in the <head></head>
section of the page. Unfortunately, RegisterClientScriptBlock,...
|
by: Ken Varn |
last post by:
I want to add my own custom <STYLE> section in the <HEAD> section of my
ASP.NET page within a custom control. Can someone tell me how I can have my
custom control add tags to the <HEAD> section of the page dynamically when
the page is rendered?
--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.
|
by: Christoph |
last post by:
When building a form using Infopath, you can define a repeating
section and stick form fields in that section. I'm curious if ASP.NET
has a similar control to make it easy to design something similar
using just ASP.NET (and not Infopath)? I'd hate to think that I'll
need to write all the javascript/dhtml to mimic that functionality and
I...
|
by: jparulan |
last post by:
Hi
Is it possible to parse a particular element (SECTION) from a repeating set of xml element tags. See Example below:
Using XMLDOM parser. Can I achieve to get all the set of element tags under i.e. CUSTOMER_ID=201?? (see below)
<name>Johnny</name>
<address>200 Lexington Ave</>
<zip>70340</zip>
<phonenumber>800-456-0003</phonenumber>...
| |
by: HockeyFan |
last post by:
I've used a repeater many times to display data bound to a source.
However, in my case, the source is the user, and so I'm wondering what
control should be used? I've got a series of questions to ask the
user for each 'contact' person that they're filling out information
on. There can be any number of contacts, so after asking the...
|
by: mauiboy |
last post by:
programming newbie. I'm work on a program that post characters into foreground application. everything is working nicely except for repeating characters. I thought using a task timer was the way to go but it seems that as the JVM cleans its garbage the time tries to catchup therefore posting more cycles in it preset duty cycle.
any hints on...
|
by: marcellus7 |
last post by:
Hows it going everyone. Im pretty new to Crystal Reports, and am in the process of trying to setup my first Crystal Report in my windows app. I am loading data from a DataSet, and am finally getting all the data loaded correctly, but the problem is it just keeps repeating the details section. I have 5 sub reports, each with their own table of data...
|
by: Bruce |
last post by:
I have a form with repeating section using wForms
(http://www.formassembly.com/blog/?p=5). I need help with the PHP to
process and display multiple repeating elements if requested. PHP should
send to email. See front end example at:
http://www.bearzilla.net/test/Untitled-1.html
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |