473,322 Members | 1,911 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,322 software developers and data experts.

Custom server control: Retrieving individual posted values

Hi, I am playing around with creating custom server controls for use within
a ASP.NET page.

I am creating a contact form and have the following question

I am capturing the form postback data in a routine called LoadPostData that
has the following signature and which implements the IPostBackDataHandler
event handler

public bool LoadPostData(string postDataKey,
System.Collections.Specialized.NameValueCollection postCollection)
{

}

If I examine the postCollection collection and pass in the uniqueID
(postDataKey) of my control, I do in fact retrieve the information entered
in the contact form, delimited by a "," character.

e.g my custom control has input fields

txtName
txtPhone
txtEmail

As a test I entered the following data in the control and pressed the submit
button

Mark
06123456
ma**@hhhh.com

In the routine LoadPostData if I do the following

string sData = postCollection[postDataKey];

sData becomes "Mark,06123456,ma**@hhhh.com"

so the information is captured correctly.

What I would like to be able to do is query each of the text objects
(txtName, txtPhone, txtEmail) and retrieve their individual values (Like
Request.Form("txtName") in classic ASP).

Failing that, I was thinking that I could just do a split on the returned
data ("Mark,06123456,ma**@hhhh.com" in the above example) using the ","
character and then examine the array. The problem with this is if someone
enters a "," character in any of the textfields then the split would not be
accurate.

Is there a way that I can suggest the delimiter ("|" for example) used
instead of a "," character?

e.g
Data is returned as "Mark|06123456|ma**@hhhh.com"

Thanks in advance
Cheers
Mark

Nov 18 '05 #1
0 1170

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

Similar topics

19
by: laurenq uantrell | last post by:
I'm using Access 2K. I'm hoping someone can tell me which method performs faster- (currently I'm using a mix of both methods) a.) creating custom properties and then calling functions to set and...
0
by: Mark | last post by:
Hi, I am playing around with creating custom server controls for use within a ASP.NET page. I am creating a contact form and have the following question I am capturing the form postback data...
3
by: Joe Bloggs | last post by:
Does anyone know if its possible to pass parameters or the values of Request.QueryString from a web page to a custom control class? I'm using a C# Web Application. For Example I have Web Page1...
21
by: One Handed Man \( OHM - Terry Burns \) | last post by:
When using a custom control. In order to check and see if values have changed one has to implement the IPostBackDataCollection interface. The values returned for the control seem to be simply a...
3
by: The Developer | last post by:
Hi All, I have a web application where I am adding a custom attribute to my ASP.NET text box control and changing value of that attribute at client side using JavaScript. My problem is that...
1
by: Martin | last post by:
Hi, I have produced a custom server control that simple outputs a row of 26 buttons, one button for each letter of the english alphabet. now what I would like to do is catch the button click...
0
by: Pavan | last post by:
My name is Pavan and I am a software engineer working on ASP .Net web development. Currently I am using .Net 2.0 Professional Edition to develop my web pages. I have a problem
9
by: Jaybuffet | last post by:
my aspx has something like this <asp:Repeater id="Repeater1" runat="server"> <ItemTemplate> <mycontrol:ctl id="ctlId" obj='<%# Container.DataItem %>' showItem="true"/> </ItemTemplate>...
2
by: J R M | last post by:
I've developed a custom control (it's basically a drop-down list and then a couple of textboxes to include meta-data for the selection) that I'm embedding into another custom control (the idea is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.