Ask a Question related to ASP.NET General, Design and Development.
-
Stu #1
Passing request.form contents to a class
Hi,
I have a class that is going to format all the fileds in a form post and
send them in an html email.
How do I pass the Request.Form contenst to a class? I know I can get the raw
data by converting it to a string, but this would mean processing the
string.....which is messy!
This is what I have got so far:
Private m_FormCol As Collection
Public WriteOnly Property formCol() As String
Set(ByVal Value As Collection)
m_FormCol = Value
End Set
End Property
I get the error Specified cast is not valid can't convert VB collection into
'System.Collections.Specialized.NameValueCollectio n'. If I pass it a
NameValueCollection'...how do I iterate through the items?
Thanks in Advance,
Stu
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
Version: 6.0.507 / Virus Database: 304 - Release Date: 04/08/2003
Stu Guest
-
Passing request to service
http://www.dotnet247.com/247reference/msgs/14/70814.aspx "Chris" <Chris@discussions.microsoft.com> wrote in message... -
[PHP-DEV] help request: passing return value
Hi internals. I'm newbie here and with php extensions. Working on php extension. It should give access to librep. I have very little... -
Confused about a REQUEST.FORM and a REQUEST.QUERYSTRING
This is snipit of code, supplied by PayPal with explanation about what has to be done to access their back end. I am confused because they first... -
best way to get data: request.form, request.params, controlname.value
Hi! I think I remember somewhere that using request.form was a bad idea (I can't say I remember why). So I'm wondering: What is the best way to... -
Passing contents of a flat file to an internal variable
I want to do something like this inside a sproc: DECLARE @internalText VARCHAR(8000) SET @internalText="c:\myTestXML.XML" QUESTION: ... -
Chris Jackson #2
Re: Passing request.form contents to a class
Any of your controls that have runat=server specified you just need to
declare in your base class, and you will be able to access them. So, if you
have:
<form runat="server" id="theForm">
<input type="text" runat="server" id="text">
</form>
Your code behind can have:
protected System.Web.UI.HtmlControls.HtmlForm theForm;
protected System.Web.UI.HtmlControls.HtmlInputText text;
With this declared at the class scope, you can then either iterate through
the child controls of the form or else directly fetch the items one by one
based on your explicit declaration, depending on what your needs are.
You have to think a bit differently with ASP.NET...
--
Chris Jackson
Software Engineer
Microsoft MVP - Windows XP
Windows XP Associate Expert
--
"Stu" <stuart@ntpcl.uk.com> wrote in message
news:uqcSYkAYDHA.2484@TK2MSFTNGP09.phx.gbl...raw> Hi,
>
> I have a class that is going to format all the fileds in a form post and
> send them in an html email.
>
> How do I pass the Request.Form contenst to a class? I know I can get theinto> data by converting it to a string, but this would mean processing the
> string.....which is messy!
>
> This is what I have got so far:
>
> Private m_FormCol As Collection
> Public WriteOnly Property formCol() As String
> Set(ByVal Value As Collection)
> m_FormCol = Value
> End Set
> End Property
>
> I get the error Specified cast is not valid can't convert VB collection> 'System.Collections.Specialized.NameValueCollectio n'. If I pass it a
> NameValueCollection'...how do I iterate through the items?
>
> Thanks in Advance,
>
> Stu
>
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
> Version: 6.0.507 / Virus Database: 304 - Release Date: 04/08/2003
>
>
Chris Jackson Guest



Reply With Quote

