Showing posts with label form. Show all posts
Showing posts with label form. Show all posts

Thursday, March 29, 2012

HTML Help-Table blues

I'm trying unsuccessfully to display in one line a start date and an end date on my form. I've been trying to do this with tables but it wants to display on two lines. I've tried several col widths, nowrap, multiple cells, and am really frustrated at this point. There is plenty of room to display it so I don't know what the problem is. Please help me. This is my latest table:

<tablewidth="100%"style="font-size: 9pt; font-family: Verdana">

<tr>

<tdnowrap="nowrap"style="width: 453px"> View Shipments From<scripttype="text/javascript">DateInput('txtFromDate',true,'MM-dd-yyyy')</script></td>

<td>To<scripttype="text/javascript">DateInput('txtToDate',true,'MM-dd-yyyy')</script></td>

</tr>

</table>

Why use tables? How about:

View Shipments From <script type="text/javascript">DateInput('txtFromDate', true, 'MM-dd-yyyy')</script>, To <script type="text/javascript">DateInput('txtToDate', true, 'MM-dd-yyyy')</script>

I haven't tried this, but i can't see why it shouldn't work. Let me know!

Yours Sincerely

Jens


I'm not sure what your DateInput javascript function does, but what you have there should display 2 columns on 1 row of a table as you would expect. Is this DateInput a javascript calendar component? If so, then it could be causing the symptoms.

html help generator for asp application

I hope somebody can give me a recommendation:

I am developing an ASP application and it should have a help icon on each form. If pressed it should open up a new page displaying the help for this form. Now I need a development tool for creating the help similar to HelpNDoc. HelpNDoc itself is nice, but it seems to be very difficult to open up the help pages in a new browser window AND show the correct help page directly. So I am looking for a tool that can create such a HTML help, it would be nice of course, if it can deliver a nice printable version of the help, too.

why dont you use the free tool which will be installed when you install Visual Studio .net in C:\Program Files\HTML Help Workshop. this tool can create .chm files which you can use easily to provide help to your users

for more info of how to use the chm file in your web application see the below link

http://www.codeguru.com/cpp/w-p/help/html/article.php/c6503/

HC


Well, that thing does not generate any table of contents for a pure html view, except for the main page. So searching and navigating through the help would be almost impossible without the CHM help viewer, so this is not a help that somebody would like to use as a pure HTML help. And furthermore, that thing is very unintuitive to use, especially for someone who just wants to write help texts and organize topics and CHM will be desupported with Vista, so that almost 8 year old, never updated 'tool' is kind of obsolete.

I am looking for a nice help generated, that will generate a help page with a navigation bar on the left and probably even search capabilities in the help, where I can link directly to pages to integrate it in my application and best would be if the help can be printed as a documentation, too.

Html Help

I'm havinf a problem with the following form tag, as for some reason it doesn't allow me to go to a different page


<%@dotnet.itags.org. Page Language="C#" %>
<html>
<head>
<title>My Page</title>
</head>
<body>
<form runat="server">
<form method="POST" action="http://www.microsoft.com">
<input type="submit" value="15" name="redirect" />
</form>
</form>
</body>
</html>

Can anyone figure why?Hi,
Place HTML <form> outside the Server side <form> :


<%@. Page Language="C#" %>
<html>
<head>
<title>My Page</title>
</head
<body>
<form runat="server">
</form>

<form method="POST" action="http://www.microsoft.com">
<input type="submit" value="15" name="redirect" />
</form>
</body>
</html>

Take a look @. :
-Form-based Programming in ASP.NET
-Wilson WebForm enables Multiple Forms and Non-PostBack Forms

HTH
thanks for that, is it possible to do the same thing within a user control, coz this is where my problem occurs?

html gets deleted

I'm using visual studio and working on some webforms.
the last few forms that I have created have been very
long and after I save the form - parts of the html get
deleted and I lose the objects at the bottom of the
page. the code however is still in the code behind
module. has anyone experienced this type of behavior?Bob,

Does this help?

324440 FIX: Data Loss When You Change Views in WebForm Designer

You didn't say what version of VS.NET. This is for 2002.

Jim Cheshire [MSFT]
Developer Support
ASP.NET
jamesche@.online.microsoft.com

This post is provided as-is with no warranties and confers no rights.

-------
>Content-Class: urn:content-classes:message
>From: "bob" <compbob_2000@.hotmail.com>
>Sender: "bob" <compbob_2000@.hotmail.com>
>Subject: html gets deleted
>Date: Mon, 27 Oct 2003 13:23:35 -0800
>Lines: 6
>Message-ID: <044701c39cd0$94ad1e90$a301280a@.phx.gbl>
>MIME-Version: 1.0
>Content-Type: text/plain;
>charset="iso-8859-1"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>Thread-Index: AcOc0JSqjfELt55HSwGM+sLqEOvXIw==
>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>Path: cpmsftngxa06.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:186835
>NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>I'm using visual studio and working on some webforms.
>the last few forms that I have created have been very
>long and after I save the form - parts of the html get
>deleted and I lose the objects at the bottom of the
>page. the code however is still in the code behind
>module. has anyone experienced this type of behavior?

html forms within the server generated form tag

Ok, I'm using an XSL to generate the content div of a page. I'm using
http://script.aculo.us to do some asynch posting and getting so that I don't
actually have to have the server know what I've generated. The whole idea is
that the content is organic. That part is working. Except for one strange
thing... I'm not sure if this is an ASP.net thing, or something I just don't
know about the DOM. When I add sub-forms with just plain html form tags,
the first child form I add isn't recognized as a separate form. It's
contents are 'added' to the main form. I've worked around it by putting a
dummy do nothing form on the page in front of my other generated sub forms...
but what gives here? I know it's not my markup because if I reverse the
order of the generated forms, the FIRST sub-form on the page is always
'assimilated' in the aspNetform, I've tried everything to get this not to
happen, enclosing in divs, and even just making a page with nothing but
generated forms... same results every time. The first html form on the page
is ALWAYS added to the asp.net generated form, no matter what. Am I missing
something? (I find that every time I post here, I usually am)

html forms within the server generated form tag

Ok, I'm using an XSL to generate the content div of a page. I'm using
http://script.aculo.us to do some asynch posting and getting so that I don't
actually have to have the server know what I've generated. The whole idea i
s
that the content is organic. That part is working. Except for one strange
thing... I'm not sure if this is an ASP.net thing, or something I just don't
know about the DOM. When I add sub-forms with just plain html form tags,
the first child form I add isn't recognized as a separate form. It's
contents are 'added' to the main form. I've worked around it by putting a
dummy do nothing form on the page in front of my other generated sub forms..
.
but what gives here? I know it's not my markup because if I reverse the
order of the generated forms, the FIRST sub-form on the page is always
'assimilated' in the aspNetform, I've tried everything to get this not to
happen, enclosing in divs, and even just making a page with nothing but
generated forms... same results every time. The first html form on the page
is ALWAYS added to the asp.net generated form, no matter what. Am I missing
something? (I find that every time I post here, I usually am)

HTML Forms not working in precompiled version

Hi everybody,
on a aspx page, i have a HTML form that on submit calls the aspx page
itself.
works fine in asp, in .NET 1.1, non precompiled .Net 2.0.
In the precompiled version of the .NET 2.0, the request.form in the
request after submitting the form is empty(request.form.count=0).again,
the code runs smoothly if the page is not precompiled
any ideas apprecicated
thanks in advance
Markus

html forms in aspx pages

I can't seem to get my html form to submit properly from within a web form.
Here's my form tag syntax and some delivery hidden fields.
<form id="myForm" action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"
method="POST" onsubmit="return verify();">
<input type="hidden" name="recipient" value=me@dotnet.itags.org.mymail.net />
<input type="hidden" name="redirect"
value="http://www.xxx.org/forms/confirmation.htm" />
...............
...............
rest of form.
I have the form within <asp:content> tags of an asp web form page. Is that
the problem? Do html forms need to be in a file with an html extension and
not a web form. This web form uses a masterpage. I did try putting the html
forms in the masterpage -- but that didn't seem to affect anything.
The form recognizes the reset button and clears the form, but when I submit
it simply reloads the page -- and doesn't access the delivery.cgi file nor
send me the results nor redirect to the confirmation page.
Thanks for any help.When you say you can't get it to submit properly - what exactly do you mean
(what happens)?
I've never tried the 'old' way of doing forms in a content page, so I'm not
exactly sure what to expect - but I'd suggest writing it the ASP.Net way,
instead - I do that all the time and it works fine...
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com
"thersitz" <thersitz@.gmail.com> wrote in message
news:eiFXdmnOHHA.2232@.TK2MSFTNGP02.phx.gbl...
> I can't seem to get my html form to submit properly from within a web
form.
> Here's my form tag syntax and some delivery hidden fields.
> <form id="myForm" action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"
> method="POST" onsubmit="return verify();">
> <input type="hidden" name="recipient" value=me@.mymail.net />
> <input type="hidden" name="redirect"
> value="http://www.xxx.org/forms/confirmation.htm" />
> ...............
> ...............
> rest of form.
> I have the form within <asp:content> tags of an asp web form page. Is that
> the problem? Do html forms need to be in a file with an html extension and
> not a web form. This web form uses a masterpage. I did try putting the
html
> forms in the masterpage -- but that didn't seem to affect anything.
> The form recognizes the reset button and clears the form, but when I
submit
> it simply reloads the page -- and doesn't access the delivery.cgi file nor
> send me the results nor redirect to the confirmation page.
> Thanks for any help.
>
>
>
>
>
You can't nest HTML forms inside each other.
HTH,
Kevin Spencer
Microsoft MVP
Bit Player
http://unclechutney.blogspot.com
In case of Minimalism, break Philip Glass.
"thersitz" <thersitz@.gmail.com> wrote in message
news:eiFXdmnOHHA.2232@.TK2MSFTNGP02.phx.gbl...
>I can't seem to get my html form to submit properly from within a web form.
>Here's my form tag syntax and some delivery hidden fields.
> <form id="myForm" action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"
> method="POST" onsubmit="return verify();">
> <input type="hidden" name="recipient" value=me@.mymail.net />
> <input type="hidden" name="redirect"
> value="http://www.xxx.org/forms/confirmation.htm" />
> ...............
> ...............
> rest of form.
> I have the form within <asp:content> tags of an asp web form page. Is that
> the problem? Do html forms need to be in a file with an html extension and
> not a web form. This web form uses a masterpage. I did try putting the
> html forms in the masterpage -- but that didn't seem to affect anything.
> The form recognizes the reset button and clears the form, but when I
> submit it simply reloads the page -- and doesn't access the delivery.cgi
> file nor send me the results nor redirect to the confirmation page.
> Thanks for any help.
>
>
>
>
>
Thanks David. I am really new to asp.net, and feel I am drowning.
Well, my action attribute is suppose to go to this
<action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"> cgi file and get
read and then delivered and then send the user to a confirmation page. All
that happens in my aspx file is that the page reloads and nothing seems to
get sent anywhere.
I tried using the asp.net controls to build the form -- and still use the
delivery.cgi to parse it -- but then I was getting post back errors.
If I build the form using all asp.net controls -- and not use any regular
html form tags -- how do I get it to deliver say an email to a set of
recipients?
I appropriately have an asp for dummies book and it seems to suggest just
using html form tags -- and when doing so, the page builds fine and displays
fine. The reset button clears the form. But submitting just reloads the very
same page instead of routing to the cgi file handler.
"David Wier" <david_wier@.noSpamhotmail.com> wrote in message
news:uzZ0r%23nOHHA.3212@.TK2MSFTNGP02.phx.gbl...
> When you say you can't get it to submit properly - what exactly do you
> mean
> (what happens)?
> I've never tried the 'old' way of doing forms in a content page, so I'm
> not
> exactly sure what to expect - but I'd suggest writing it the ASP.Net way,
> instead - I do that all the time and it works fine...
> --
> David Wier
> MVP/ASPInsider
> http://aspnet101.com
> http://aspexpress.com
>
> "thersitz" <thersitz@.gmail.com> wrote in message
> news:eiFXdmnOHHA.2232@.TK2MSFTNGP02.phx.gbl...
> form.
> html
> submit
>
The problem here, is the form deal, as Kevin pointed out - - - (doah! -
wasn't thinking clearly enough)
The way this is normally done is creating the form itself (without the form
tags), and then adding a button. Then, inside the button's click event, you
create everything that you need done with the form.
Not totally sure, again, with the cgi aspect of this - but check out this
sample on crosspage posting and see if you can get it started that way:
age" target="_blank">http://quickstarts.asp.net/QuickSta...ossp
age
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com
"thersitz" <thersitz@.gmail.com> wrote in message
news:uVpBYQoOHHA.4604@.TK2MSFTNGP06.phx.gbl...
> Thanks David. I am really new to asp.net, and feel I am drowning.
> Well, my action attribute is suppose to go to this
> <action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"> cgi file and get
> read and then delivered and then send the user to a confirmation page. All
> that happens in my aspx file is that the page reloads and nothing seems to
> get sent anywhere.
> I tried using the asp.net controls to build the form -- and still use the
> delivery.cgi to parse it -- but then I was getting post back errors.
> If I build the form using all asp.net controls -- and not use any regular
> html form tags -- how do I get it to deliver say an email to a set of
> recipients?
> I appropriately have an asp for dummies book and it seems to suggest just
> using html form tags -- and when doing so, the page builds fine and
displays
> fine. The reset button clears the form. But submitting just reloads the
very
> same page instead of routing to the cgi file handler.
>
> "David Wier" <david_wier@.noSpamhotmail.com> wrote in message
> news:uzZ0r%23nOHHA.3212@.TK2MSFTNGP02.phx.gbl...
way,
action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"
>
Yes it does. Thanks, Kevin.
Could I do this in my masterpage:
<form id="form1" runat="server"
action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi">
And then build a web form linking that masterpage and when submitting have
the server send the results to the cgi file cited so that the cgi file
parses and delivers -- like my other html forms?
"Kevin Spencer" <unclechutney@.nothinks.com> wrote in message
news:OyRe8NoOHHA.4172@.TK2MSFTNGP04.phx.gbl...
> You can't nest HTML forms inside each other.
> --
> HTH,
> Kevin Spencer
> Microsoft MVP
> Bit Player
> http://unclechutney.blogspot.com
> In case of Minimalism, break Philip Glass.
> "thersitz" <thersitz@.gmail.com> wrote in message
> news:eiFXdmnOHHA.2232@.TK2MSFTNGP02.phx.gbl...
>
Another method is to put the "regular" HTML form outside the WebForm
(outside of the <form...>...</form> tags) in the ASP.Net page. Of course,
you would have to change your method of adding the "plain HTML" form code, a
server-side include, for example.
HTH,
Kevin Spencer
Microsoft MVP
Bit Player
http://unclechutney.blogspot.com
In case of Minimalism, break Philip Glass.
"David Wier" <david_wier@.noSpamhotmail.com> wrote in message
news:e7u7ZeoOHHA.400@.TK2MSFTNGP04.phx.gbl...
> The problem here, is the form deal, as Kevin pointed out - - - (doah! -
> wasn't thinking clearly enough)
> The way this is normally done is creating the form itself (without the
> form
> tags), and then adding a button. Then, inside the button's click event,
> you
> create everything that you need done with the form.
> Not totally sure, again, with the cgi aspect of this - but check out this
> sample on crosspage posting and see if you can get it started that way:
> spage" target="_blank">http://quickstarts.asp.net/QuickSta...os
spage
>
> --
> David Wier
> MVP/ASPInsider
> http://aspnet101.com
> http://aspexpress.com
>
> "thersitz" <thersitz@.gmail.com> wrote in message
> news:uVpBYQoOHHA.4604@.TK2MSFTNGP06.phx.gbl...
> displays
> very
> way,
> action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi"
>
I just gave you a suggestion in another post in this same thread. See if you
like it. The important thing to remember is that a WebForm is, on the client
side, an HTML form, and you can't nest HTML forms inside one another. How
you work around that is up to you, but I did make a suggestion.
HTH,
Kevin Spencer
Microsoft MVP
Bit Player
http://unclechutney.blogspot.com
In case of Minimalism, break Philip Glass.
"thersitz" <thersitz@.gmail.com> wrote in message
news:uCL49goOHHA.4172@.TK2MSFTNGP04.phx.gbl...
> Yes it does. Thanks, Kevin.
> Could I do this in my masterpage:
> <form id="form1" runat="server"
> action="https://xxx.order.net/xxx/cgi-bin/delivery.cgi">
> And then build a web form linking that masterpage and when submitting have
> the server send the results to the cgi file cited so that the cgi file
> parses and delivers -- like my other html forms?
>
> "Kevin Spencer" <unclechutney@.nothinks.com> wrote in message
> news:OyRe8NoOHHA.4172@.TK2MSFTNGP04.phx.gbl...
>

Monday, March 26, 2012

HTML FORMAT Mail and Lotus Notes

Hi every one,

Today i have very different kind of problem.. I have registeration form in which i am registered and after going through registeration process and automaically welcome mail come which in HTML format. This will workingin Outlook express, Foxmail& web mail .

But in Lotus Notes I does'nt come in proper format.

WHAT I HAVE TO DO TO MAKE PORPER FORMAT WHICH WORKING IN ALLin Outlook express, Foxmail& web mail AND LOTUS NOTES ALSO. WHAT I HAVE TO DO??

PLEASE HELP ME

check that Lotus is set to allow HTML mail. then check your email's source to see that it is well formed ( all the right tags in all the right places )

HTML Form value retrieval

Yes. If you use the action attribute, it works fine. Here's an example, from
this working page
http://www.pmaconference.com/specia...04/register.htm

<form name="form" onsubmit="return(sendReg())"
action="https://energycatalogue.acomhosting.com/orderform.aspx"
"Matt" <anonymous@dotnet.itags.org.discussions.microsoft.com> wrote in message
news:F7ED5A87-B31F-4BA8-A0A2-CFC966462174@dotnet.itags.org.microsoft.com...
> I have an aspx page whose purpose is to read a customer-provided HTML
form, display it, and reads the values from it on a postback. I cannot seem
to read the values from Request.Form when this type of form is posted back.
All I am trying to do is loop through the items in Request.Form and store
their values for later use in the application. Neither the "form" tag nor
the control tags use the runat="server" attribute since this is a
customer-created form that we would like to be standard HTML to allow full
control of the form contents, and look and feel of the form. There will
only ever be one client-side form per rendering of the page. By adding the
runat="server" attribute to the form tag, I have been able to see only one
item in the Request, _VIEWSTATE. None of the other HTML controls will
appear in the collection. Is this type of thing possible?Thanks for the reply. Even with the action on the form, I the Request.Form.Count value is also zero when I do a postback. Obviously there's something wrong, probably very basic. Below is the form that I am testing with. I've tried with and without the METHOD and ACTION attributes

<form name="autos" method="post" action="http://cregosource/privateparty/formdata.aspx"><input type="checkbox" id="check" value="checkvalue"><br><input type="checkbox" id="check2" value="checkvalue2"><br><input type="text" id="text" value="333333"><textarea id="mytextarea">asdf</textarea><input type="radio" id="myradio" value="1"><input type="radio" id="myradio" value="2"><input type="radio" id="myradio" value="3"><select id="myselect" size="5"><option>1</option><option>2</option></select><select id="myselectmultiple" size="5" multiple><option value="1">one</option><option value="2">two</option><option value="3">three</option><option value="4">four</option><option value="5">five</option></select><br><br><input type="submit" value="Submit"></form

And here's the code in a codebehind page that I'm debugging

if (Request.Form.Count>0)

foreach (string strReq in Request.Form)

oTrans.KeyAddOrReplace(PrivateParty.TranState.Sect ionType.Form,strReq,Request[strReq])

oTrans.SaveState()

Even if I omit the Count test, there are no items in the Form. Does it pose a problem if I am using usercontrols on this page? I do not specifically call out any form tags in these controls. Any additional help is much appreciated!

Html form trouble

Hi,
On my asp.net page I have an html form. I've set runat attribute to server
and filled it with server controls. All settings
are as I like them.
So here's the problem: when I perform a search for the first time, everythin
g works perfectly. If I make any changes to the
controls in the form and resubmit the page, nothing changes. That is, viewi
ng the querystring, not a single value is altered
despite my doing so in the form itself.
Is there some problem with the html form? I can't for the life of me figure
this out. Any help would be greatly appreciated.
Thanks,
RoshawnHi,
Roshawn wrote:
> Hi,
> On my asp.net page I have an html form. I've set runat attribute to
> server and filled it with server controls. All settings are as I like
> them.
> So here's the problem: when I perform a search for the first time,
> everything works perfectly. If I make any changes to the controls in
> the form and resubmit the page, nothing changes. That is, viewing the
> querystring, not a single value is altered despite my doing so in the
> form itself.
> Is there some problem with the html form? I can't for the life of me
> figure this out. Any help would be greatly appreciated.
> Thanks,
> Roshawn
We'll need to see some code. Please post an extract of your code able to
reproduce the problems, stripping what is not necessary.
Greetings,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Hi Laurent. Sorry for the delayed response, been busy. As you requested, h
ere's some code.
HTML Form
<form runat="server" enableviewstate="false">
<label for="q">Search:</label><br/>
<input type="text" name="q" id="q" maxlength="100" /><br/>
<label for="sz">Shoe Size:</label><br/>
<asp:dropdownlist id="sz" runat="server" enableviewstate="false">
<asp:listitem value="-24">Any</asp:listitem>
<asp:listitem value="42802">5 & Smaller</asp:listitem>
<asp:listitem value="37090">6</asp:listitem>
<asp:listitem value="22806">7</asp:listitem>
<asp:listitem value="1032">8</asp:listitem>
'more listitems go here
</asp:dropdownlist><br/>
<label for="tp">Type:</label><br/>
<asp:dropdownlist runat="server" id="tp" enableviewstate="false">
<asp:listitem value="-24">Any</asp:listitem>
<asp:listitem value="2293">Athletic</asp:listitem>
<asp:listitem value="31920">Athletic-Inspired</asp:listitem>
</asp:dropdownlist><br/>
<label for="cd">Condition:</label><br/>
<asp:dropdownlist id="cd" runat="server" enableviewstate="false">
<asp:listitem value="-24">Any</asp:listitem>
<asp:listitem value="31919">New</asp:listitem>
</asp:dropdownlist><br/>
<input type="submit" id="submit" value="Search" />
</form>
Code to handle form (note that this uses the eBay XML API; it works as expec
ted and is called in the Page_Load event)
Private Sub GetShoeResults()
Dim hp As New MyHelper() 'declared variable for the MyHelper class for auxil
lary functions
Dim shoe As Shoe = New Shoe()'custom class
Dim sb As New StringBuilder("<?xml version=""1.0"" encoding=""utf-8""?>")
With sb
.Append("<GetSearchResultsRequest xmlns=""urn:ebay:apis:eBLBaseComponents"">
<RequesterCredentials><eBayAuthToken>" &
ConfigurationManager.AppSettings("Token") & "</eBayAuthToken></RequesterCred
entials>")
.Append("<CategoryID>63850</CategoryID><DetailLevel>ReturnAll</DetailLevel>"
)
If Request.QueryString("q") <> "" Then
.Append("<Query>" & Request.QueryString("q") & "</Query>")
End If
.Append("<SearchRequest><AttributeSetID>22</AttributeSetID><ProductFinderID>
22</ProductFinderID>")
'for the Size Parameter
If Request.QueryString("sz") <> "" Then
'turn off all selected items
For i = 0 To Me.sz.Items.Count - 1
Me.sz.Items(i).Selected = False
Next
.Append("<SearchAttributes><AttributeID>53</AttributeID><ValueList><ValueID>
" & Request.QueryString("sz") &
"</ValueID></ValueList></SearchAttributes>")
Dim item As ListItem
For Each item In Me.sz.Items
If item.Value = Request.QueryString("sz") Then
shoe.Size_ID = item.Value
shoe.Size = item.Text
item.Selected = True
Exit For
End If
Next
End If
'for the Type Parameter
If Request.QueryString("tp") <> "" Then
'turn off all selected items
For i = 0 To Me.tp.Items.Count - 1
Me.tp.Items(i).Selected = False
Next
.Append("<SearchAttributes><AttributeID>54</AttributeID><ValueList><ValueID>
" & Request.QueryString("tp") &
"</ValueID></ValueList></SearchAttributes>")
Dim item As ListItem
For Each item In Me.tp.Items
If item.Value = Request.QueryString("tp") Then
shoe.Type_ID = item.Value
shoe.Type = item.Text
item.Selected = True
Exit For
End If
Next
End If
'for the Condition Parameter
If Request.QueryString("cd") <> "" Then
'turn off all selected items
For i = 0 To Me.cd.Items.Count - 1
Me.cd.Items(i).Selected = False
Next
.Append("<SearchAttributes><AttributeID>94</AttributeID><ValueList><ValueID>
" & Request.QueryString("cd") &
"</ValueID></ValueList></SearchAttributes>")
Dim item2 As ListItem
For Each item2 In Me.cd.Items
If item2.Value = Request.QueryString("cd") Then
shoe.Condition_ID = item2.Value
shoe.Condition = item2.Text
item2.Selected = True
Exit For
End If
Next
End If
'Add Pagination in case a page number is returned in the querystring
.Append("<Pagination><EntriesPerPage>10</EntriesPerPage></Pagination></GetSe
archResultsRequest>")
End With
Try
Me.Xml1.DocumentContent = hp.CreateHeaders(sb.ToString())'call to eBay
Dim ext As New XsltArgumentList()
ext.AddExtensionObject("urn:Shoes", shoe)
Me.Xml1.TransformArgumentList = ext
Me.Xml1.TransformSource = "search.xslt"
Catch ex As WebException
'handle errors here
End Try
End Sub
I hope this helps you help me. Thanks for being interested. :-)
Roshawn

Html form trouble

Hi,

On my asp.net page I have an html form. I've set runat attribute to server and filled it with server controls. All settings
are as I like them.

So here's the problem: when I perform a search for the first time, everything works perfectly. If I make any changes to the
controls in the form and resubmit the page, nothing changes. That is, viewing the querystring, not a single value is altered
despite my doing so in the form itself.

Is there some problem with the html form? I can't for the life of me figure this out. Any help would be greatly appreciated.

Thanks,
RoshawnHi,

Roshawn wrote:

Quote:

Originally Posted by

Hi,
>
On my asp.net page I have an html form. I've set runat attribute to
server and filled it with server controls. All settings are as I like
them.
>
So here's the problem: when I perform a search for the first time,
everything works perfectly. If I make any changes to the controls in
the form and resubmit the page, nothing changes. That is, viewing the
querystring, not a single value is altered despite my doing so in the
form itself.
>
Is there some problem with the html form? I can't for the life of me
figure this out. Any help would be greatly appreciated.
>
Thanks,
Roshawn


We'll need to see some code. Please post an extract of your code able to
reproduce the problems, stripping what is not necessary.

Greetings,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Hi Laurent. Sorry for the delayed response, been busy. As you requested, here's some code.

HTML Form
<form runat="server" enableviewstate="false">
<label for="q">Search:</label><br/>
<input type="text" name="q" id="q" maxlength="100" /><br/>
<label for="sz">Shoe Size:</label><br/>
<asp:dropdownlist id="sz" runat="server" enableviewstate="false">
<asp:listitem value="-24">Any</asp:listitem>
<asp:listitem value="42802">5 & Smaller</asp:listitem>
<asp:listitem value="37090">6</asp:listitem>
<asp:listitem value="22806">7</asp:listitem>
<asp:listitem value="1032">8</asp:listitem>
'more listitems go here
</asp:dropdownlist><br/>
<label for="tp">Type:</label><br/>
<asp:dropdownlist runat="server" id="tp" enableviewstate="false">
<asp:listitem value="-24">Any</asp:listitem>
<asp:listitem value="2293">Athletic</asp:listitem>
<asp:listitem value="31920">Athletic-Inspired</asp:listitem>
</asp:dropdownlist><br/>
<label for="cd">Condition:</label><br/>
<asp:dropdownlist id="cd" runat="server" enableviewstate="false">
<asp:listitem value="-24">Any</asp:listitem>
<asp:listitem value="31919">New</asp:listitem>
</asp:dropdownlist><br/>
<input type="submit" id="submit" value="Search" />
</form>

Code to handle form (note that this uses the eBay XML API; it works as expected and is called in the Page_Load event)
Private Sub GetShoeResults()
Dim hp As New MyHelper() 'declared variable for the MyHelper class for auxillary functions
Dim shoe As Shoe = New Shoe()'custom class
Dim sb As New StringBuilder("<?xml version=""1.0"" encoding=""utf-8""?>")
With sb
.Append("<GetSearchResultsRequest xmlns=""urn:ebay:apis:eBLBaseComponents""><RequesterCredentials><eBayAuthToken>" &
ConfigurationManager.AppSettings("Token") & "</eBayAuthToken></RequesterCredentials>")
.Append("<CategoryID>63850</CategoryID><DetailLevel>ReturnAll</DetailLevel>")
If Request.QueryString("q") <"" Then
.Append("<Query>" & Request.QueryString("q") & "</Query>")
End If
.Append("<SearchRequest><AttributeSetID>22</AttributeSetID><ProductFinderID>22</ProductFinderID>")
'for the Size Parameter
If Request.QueryString("sz") <"" Then
'turn off all selected items
For i = 0 To Me.sz.Items.Count - 1
Me.sz.Items(i).Selected = False
Next
.Append("<SearchAttributes><AttributeID>53</AttributeID><ValueList><ValueID>" & Request.QueryString("sz") &
"</ValueID></ValueList></SearchAttributes>")
Dim item As ListItem
For Each item In Me.sz.Items
If item.Value = Request.QueryString("sz") Then
shoe.Size_ID = item.Value
shoe.Size = item.Text
item.Selected = True
Exit For
End If
Next
End If
'for the Type Parameter
If Request.QueryString("tp") <"" Then
'turn off all selected items
For i = 0 To Me.tp.Items.Count - 1
Me.tp.Items(i).Selected = False
Next
.Append("<SearchAttributes><AttributeID>54</AttributeID><ValueList><ValueID>" & Request.QueryString("tp") &
"</ValueID></ValueList></SearchAttributes>")
Dim item As ListItem
For Each item In Me.tp.Items
If item.Value = Request.QueryString("tp") Then
shoe.Type_ID = item.Value
shoe.Type = item.Text
item.Selected = True
Exit For
End If
Next
End If
'for the Condition Parameter
If Request.QueryString("cd") <"" Then
'turn off all selected items
For i = 0 To Me.cd.Items.Count - 1
Me.cd.Items(i).Selected = False
Next
.Append("<SearchAttributes><AttributeID>94</AttributeID><ValueList><ValueID>" & Request.QueryString("cd") &
"</ValueID></ValueList></SearchAttributes>")
Dim item2 As ListItem
For Each item2 In Me.cd.Items
If item2.Value = Request.QueryString("cd") Then
shoe.Condition_ID = item2.Value
shoe.Condition = item2.Text
item2.Selected = True
Exit For
End If
Next
End If
'Add Pagination in case a page number is returned in the querystring
.Append("<Pagination><EntriesPerPage>10</EntriesPerPage></Pagination></GetSearchResultsRequest>")
End With
Try
Me.Xml1.DocumentContent = hp.CreateHeaders(sb.ToString())'call to eBay
Dim ext As New XsltArgumentList()
ext.AddExtensionObject("urn:Shoes", shoe)
Me.Xml1.TransformArgumentList = ext
Me.Xml1.TransformSource = "search.xslt"
Catch ex As WebException
'handle errors here
End Try
End Sub

I hope this helps you help me. Thanks for being interested. :-)

Roshawn

html form to asp.net page form problem

When I use an html form to post to a aspx page...the Request.Form
collection is empty. I've reproduced this on multiple machines. By
html form, I mean one that does not have runat="server" and the page
extension is html.
I'm assuming the new Request.Form collection contains only server side
controls if it shows up empty.
How do I get traditional html control values when posting to an aspx
page?
Thanks a ton!
- ScottI just tried the scenario you described and it worked for me - -
two things to always look out for :
querystrings (if you're using them) must be case sensitive in both places
if you're assigning the request.form info to a variable and using it
elsewhere on the page, the variable must be dimensioned globally (on the
receiving page).
What is your code on the receiving page, which grabs the request.form info
and displays it ?
David Wier
MCP, MVP ASP.NET, ASPInsider
http://aspnet101.com
http://aspexpress.com
"Scottyb" <scottbed@.yahoo.com> wrote in message
news:a2240d55.0409200919.4c9f51c7@.posting.google.com...
> When I use an html form to post to a aspx page...the Request.Form
> collection is empty. I've reproduced this on multiple machines. By
> html form, I mean one that does not have runat="server" and the page
> extension is html.
> I'm assuming the new Request.Form collection contains only server side
> controls if it shows up empty.
> How do I get traditional html control values when posting to an aspx
> page?
> Thanks a ton!
> - Scott
Are fields named ? Fields without the name attribute are not poseted.
Else it's likely better to just post a minimal HTML page that show the
problem... You may have also perhaps a viewstate problem ? (I would use the
usual page post ti itself model if possible).
Patrice
"Scottyb" <scottbed@.yahoo.com> a crit dans le message de
news:a2240d55.0409200919.4c9f51c7@.posting.google.com...
> When I use an html form to post to a aspx page...the Request.Form
> collection is empty. I've reproduced this on multiple machines. By
> html form, I mean one that does not have runat="server" and the page
> extension is html.
> I'm assuming the new Request.Form collection contains only server side
> controls if it shows up empty.
> How do I get traditional html control values when posting to an aspx
> page?
> Thanks a ton!
> - Scott
Are you authenticating your users against the Active Directory? If so, try
it without authentication to see if http://support.microsoft.com/?id=308074
is the problem.
Ray at home
"Scottyb" <scottbed@.yahoo.com> wrote in message
news:a2240d55.0409200919.4c9f51c7@.posting.google.com...
> When I use an html form to post to a aspx page...the Request.Form
> collection is empty. I've reproduced this on multiple machines. By
> html form, I mean one that does not have runat="server" and the page
> extension is html.
> I'm assuming the new Request.Form collection contains only server side
> controls if it shows up empty.
> How do I get traditional html control values when posting to an aspx
> page?
> Thanks a ton!
> - Scott

html form POST to aspx page, then to SQL db

I have a simple little HTML form consisting of about 20 checkboxes and one textarea. This will be emailed out to a few people and upon submission will post to an aspx page which will in turn save the results to a SQL database. What is the best/easiest way to accomplish this? I don't have a problem accessing the values submitted from the aspx page, but how would I go about getting the names of the checkboxes that were checked and saving the value to the corresponding column in the database? Any help would be appreciated (vb if possible). Thanks much

pass the values by session, querystring and use a stored procedure on the page your posting to... to insert these values into your db

on the button click event
create your session

Session["UserID"] = txtUserName.text; - if html form session["UserID"] = request.form(UserID)
Session["Email"] = txtEmail.text;

then

response.redirect(insert.aspx);

insert.aspx runs the stored procedure that inserts the values into your database.

if you create the session on the button click event the sessions get created before the response.redirect and if your using an asp classic form - put the sessions on that pickup page before you call the stored proc


Hi Welcome to asp.net forum.

This is my understanding of your problem:you have a html page which contains 20 checkboxes and one textarea,and when html page is submitted there is a aspx handle the form data(email,store it into DB ....).

how would I go about getting the names of the checkboxes

I think what you want is to test wheather the checkbox is checked since checkboxes is not dynamically created.And keep in mind unchecked checkboxes' name/value pairs are not submitted.

And Store data into session will be a burden to server.


thanks all for your input... Problem is that the page that has the form is not an aspx page, but rather an html page. The form will actually be inserted into an email and mailed out to about 1,000 recipients. So that being said i can't exactly do any processing on the form, but rather on the landing page. I've never done anything going from an html page to an aspx page, only aspx to aspx so i'm a little lost without having options such as querystring and session, etc... On my landing page (on the html form i have action="LandingPage.aspx"... This is correct, right?) and then I have to do all my processing on LandingPage.aspx. I'm doing this and i'm able to iterate thru the values submitted on the form:

For i As Integer = 0 To Request.Form.Keys.Count - 1

Name: Request.Form.Keys(i) / Value: Request.Form.Item(i)

Next

That works fine... But now how do i get all of my values together so that I can do one big insert to the database? Array? Can I pass an array as a paramater to a stored proc?

Thanks again!


Here's an example of doing a batch select with OPENXML on SQL. Instead of doing a SELECT just replace with your INSERT statement. All you need to do is generate the XML doc, which is quite easy!

http://dennylove.blogspot.com/2006/09/sql-openxml-cool-stuff.html


Can I pass an array as a paramater to a stored proc?

No, you can't pass array directly to a stored proc.

But you can construct string in following way "123,12,3245,234,345" and split is in stored proc.

For details you can take a look at this article:How to pass a list of values or array to SQL Server stored procedure


thanks for everyones input... It helped, but in the end i decided to try something new just for kicks so I didn't really have to worry about passing an array to my stored proc or anything... Ended up using bitmasking which worked out great... Thanks again though.

HTML form inside a ASP.NET form: CMS

Hi all, I have a WYSIWYG editor which allows people to insert a form into a
page.
This information is stored in a database and at run-time is displayed inside
a content placeholder (I'm using MasterPages).
The problem I am having is that because .NET places a form tag wth
runat=server my nested HTML tag posts back to the .NET form instead of the
HTML page declared in the action tag of the HTML form.
I have read that the way to get around this is to place the HTML form
outside of the .NET tag but how can I do this when a page is being built
from the database and displayed inside a content placeholder...
Any ideas welcome!
Thanks
MarkMark,
I had the same problem inserting html forms into a masterpage and came up
with this technique witch didn't completely work for me (problems when desig
n
of masterpage changed) so I made a standalone page of html forms. Maybe the
technique will work for you. It involves injecting html form tags into the
client.
In content place holder close out the masterpage form by writing a literal
control to the client
me.controls.add(new literalcontrol("</form>"))
...
Write out your db forms. how ever you do this Mark.
me.controls.add(new MarkFormfromdb)
...
Create dummy header for aspx masterpage closing form tag for well formed htm
l.
me.controls.add(new literalcontrol("<form> ))
Good Luck
DWS
"Mark" wrote:

> Hi all, I have a WYSIWYG editor which allows people to insert a form into
a
> page.
> This information is stored in a database and at run-time is displayed insi
de
> a content placeholder (I'm using MasterPages).
> The problem I am having is that because .NET places a form tag wth
> runat=server my nested HTML tag posts back to the .NET form instead of the
> HTML page declared in the action tag of the HTML form.
> I have read that the way to get around this is to place the HTML form
> outside of the .NET tag but how can I do this when a page is being built
> from the database and displayed inside a content placeholder...
> Any ideas welcome!
> Thanks
> Mark
>
>
>
Hi, thanks for your help, I will give this a go
Cheers
Mark
"DWS" <DWS@.discussions.microsoft.com> wrote in message
news:4E27ABA2-F0C8-4DF6-A49E-948A7D2892B8@.microsoft.com...
> Mark,
> I had the same problem inserting html forms into a masterpage and came up
> with this technique witch didn't completely work for me (problems when
> design
> of masterpage changed) so I made a standalone page of html forms. Maybe
> the
> technique will work for you. It involves injecting html form tags into
> the
> client.
> In content place holder close out the masterpage form by writing a
> literal
> control to the client
> me.controls.add(new literalcontrol("</form>"))
> ...
> Write out your db forms. how ever you do this Mark.
> me.controls.add(new MarkFormfromdb)
> ...
> Create dummy header for aspx masterpage closing form tag for well formed
> html.
> me.controls.add(new literalcontrol("<form> ))
> Good Luck
> DWS
>
> "Mark" wrote:
>

HTML form inside a ASP.NET form: CMS

Hi all, I have a WYSIWYG editor which allows people to insert a form into a
page.

This information is stored in a database and at run-time is displayed inside
a content placeholder (I'm using MasterPages).

The problem I am having is that because .NET places a form tag wth
runat=server my nested HTML tag posts back to the .NET form instead of the
HTML page declared in the action tag of the HTML form.

I have read that the way to get around this is to place the HTML form
outside of the .NET tag but how can I do this when a page is being built
from the database and displayed inside a content placeholder...

Any ideas welcome!
Thanks
MarkMark,
I had the same problem inserting html forms into a masterpage and came up
with this technique witch didn't completely work for me (problems when design
of masterpage changed) so I made a standalone page of html forms. Maybe the
technique will work for you. It involves injecting html form tags into the
client.

In content place holder close out the masterpage form by writing a literal
control to the client
me.controls.add(new literalcontrol("</form>"))
....
Write out your db forms. how ever you do this Mark.
me.controls.add(new MarkFormfromdb)
...
Create dummy header for aspx masterpage closing form tag for well formed html.
me.controls.add(new literalcontrol("<form>))

Good Luck
DWS

"Mark" wrote:

> Hi all, I have a WYSIWYG editor which allows people to insert a form into a
> page.
> This information is stored in a database and at run-time is displayed inside
> a content placeholder (I'm using MasterPages).
> The problem I am having is that because .NET places a form tag wth
> runat=server my nested HTML tag posts back to the .NET form instead of the
> HTML page declared in the action tag of the HTML form.
> I have read that the way to get around this is to place the HTML form
> outside of the .NET tag but how can I do this when a page is being built
> from the database and displayed inside a content placeholder...
> Any ideas welcome!
> Thanks
> Mark
>
>
>
Hi, thanks for your help, I will give this a go
Cheers
Mark
"DWS" <DWS@.discussions.microsoft.com> wrote in message
news:4E27ABA2-F0C8-4DF6-A49E-948A7D2892B8@.microsoft.com...
> Mark,
> I had the same problem inserting html forms into a masterpage and came up
> with this technique witch didn't completely work for me (problems when
> design
> of masterpage changed) so I made a standalone page of html forms. Maybe
> the
> technique will work for you. It involves injecting html form tags into
> the
> client.
> In content place holder close out the masterpage form by writing a
> literal
> control to the client
> me.controls.add(new literalcontrol("</form>"))
> ...
> Write out your db forms. how ever you do this Mark.
> me.controls.add(new MarkFormfromdb)
> ...
> Create dummy header for aspx masterpage closing form tag for well formed
> html.
> me.controls.add(new literalcontrol("<form>))
> Good Luck
> DWS
>
> "Mark" wrote:
>> Hi all, I have a WYSIWYG editor which allows people to insert a form into
>> a
>> page.
>>
>> This information is stored in a database and at run-time is displayed
>> inside
>> a content placeholder (I'm using MasterPages).
>>
>> The problem I am having is that because .NET places a form tag wth
>> runat=server my nested HTML tag posts back to the .NET form instead of
>> the
>> HTML page declared in the action tag of the HTML form.
>>
>> I have read that the way to get around this is to place the HTML form
>> outside of the .NET tag but how can I do this when a page is being built
>> from the database and displayed inside a content placeholder...
>>
>> Any ideas welcome!
>> Thanks
>> Mark
>>
>>
>>
>>
>>
>

Html Form Help!

Hi,

I have an .aspx page that contains an html form. Below is the code used for the form:

<form id="Shoes" method="post" runat="server">
<label for="q">Search:</label><br />
<asp:textbox id="q" maxlength="100" runat="server"/><br />
<label for="sz">Shoe Size (US):</label><br />
<asp:dropdownlist id="sz" runat="server"/><br /> <!-- this control is populated programmatically -->
<label for="tp">Type:</label><br />
<asp:dropdownlist id="tp" runat="server">
<asp:listitem value="24">Any</asp:listitem>
<asp:listitem value="2293">Athletic</asp:listitem>
<asp:listitem value="31920">Athletic-Inspired</asp:listitem>
</asp:dropdownlist><br />
<label for="cd">Condition:</label><br />
<asp:dropdownlist id="cd" runat="server">
<asp:listitem value="24">Any</asp:listitem>
<asp:listitem value="31919">New</asp:listitem>
</asp:dropdownlist><br />
<input type="submit" value="Search"/>
</form
All is good here.

But should I specify any form variables and perform a postback, I can't access any of the form
controls using either the Request.Form collection or using Request.Querystring collection.

I have no idea why this is happening. Can anyone help this newbie?

Thanks,
RoshawnI don't see anything particularly wrong with your form ASPX tag code.
You have not shown how you expect to access these values on a postback.

The typicaly pattern is:

Page_Load( ...)
{
if(IsPostBack)
{
//get values here

}

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com

"Roshawn Dawson" wrote:

> Hi,
> I have an .aspx page that contains an html form. Below is the code used for the form:
>
> <form id="Shoes" method="post" runat="server">
> <label for="q">Search:</label><br />
> <asp:textbox id="q" maxlength="100" runat="server"/><br />
> <label for="sz">Shoe Size (US):</label><br />
> <asp:dropdownlist id="sz" runat="server"/><br /> <!-- this control is populated programmatically -->
> <label for="tp">Type:</label><br />
> <asp:dropdownlist id="tp" runat="server">
> <asp:listitem value="24">Any</asp:listitem>
> <asp:listitem value="2293">Athletic</asp:listitem>
> <asp:listitem value="31920">Athletic-Inspired</asp:listitem>
> </asp:dropdownlist><br />
> <label for="cd">Condition:</label><br />
> <asp:dropdownlist id="cd" runat="server">
> <asp:listitem value="24">Any</asp:listitem>
> <asp:listitem value="31919">New</asp:listitem>
> </asp:dropdownlist><br />
> <input type="submit" value="Search"/>
> </form>
>
> All is good here.
> But should I specify any form variables and perform a postback, I can't access any of the form
> controls using either the Request.Form collection or using Request.Querystring collection.
> I have no idea why this is happening. Can anyone help this newbie?
> Thanks,
> Roshawn
Hmm...

Your suggestion is simple enough. I though that you don't always have to check if the page was
posted back. I thought that I could slap some code onto the page and simply use the Request object.
Seems I was wrong.

Thanks for the tip, Peter. :-)

Peter Bromberg [C# MVP] wrote:
> I don't see anything particularly wrong with your form ASPX tag code.
> You have not shown how you expect to access these values on a postback.
> The typicaly pattern is:
> Page_Load( ...)
> {
> if(IsPostBack)
> {
> //get values here
> }
> Peter
I appreciate your suggestion, but unfortunately nothing works. I still cannot use the Request.Form
collection or the Request.QueryString collection.

Thanks anyway,
Roshawn
If you want to post a "Short but complete" code sample, sombody will review
it. How about your AutoEventWireup directive, how is that set? Have you set a
breakpont on the code line that you expect to see executed, to see if it is
actually reached? Have you tried using the locals window to look at values?
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com

"Roshawn Dawson" wrote:

> I appreciate your suggestion, but unfortunately nothing works. I still cannot use the Request.Form
> collection or the Request.QueryString collection.
> Thanks anyway,
> Roshawn
Hi, Roshawn.

What you are looking for is the Request.Params collection.

See example usage at :
http://www.informit.com/articles/ar...2&seqNum=4&rl=1

http://www.hanselman.com/blog/ASPNE...leDecoding.aspx

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Roshawn Dawson" <udrago@.bellsouth.net> wrote in message
news:uxxSlDzcGHA.4072@.TK2MSFTNGP05.phx.gbl...
>I appreciate your suggestion, but unfortunately nothing works. I still cannot use the Request.Form
>collection or the Request.QueryString collection.
> Thanks anyway,
> Roshawn
Hi Juan,

I've done some more testing, and what I found is strange. Both the Request.Params and the
Request.QueryString collections are empty.

I have no idea why this is. Could setting the EnableViewState property to true have an effect on
these collections?

Thanks,
Roshawn

Juan T. Llibre wrote:
> Hi, Roshawn.
> What you are looking for is the Request.Params collection.
> See example usage at :
> http://www.informit.com/articles/ar...2&seqNum=4&rl=1
> http://www.hanselman.com/blog/ASPNE...leDecoding.aspx
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaol : http://asp.net.do/foros/
Never mind; I figured it out. Silly me, I didn't supply a name attribute for any of the form's
controls. That's why I couldn't get any data.

And to think that I need a hairpiece for nothing (I pulled all of it out). :-(

Thanks gang,
Roshawn
heh, heh...
Been there, done that!

I bet it felt good to finally figure it out!

:-)

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Roshawn Dawson" <udrago@.bellsouth.net> wrote in message
news:%23WISox%23cGHA.536@.TK2MSFTNGP02.phx.gbl...
> Never mind; I figured it out. Silly me, I didn't supply a name attribute for any of the form's
> controls. That's why I couldn't get any data.
> And to think that I need a hairpiece for nothing (I pulled all of it out). :-(
> Thanks gang,
> Roshawn

Html Form Help!

Hi,
I have an .aspx page that contains an html form. Below is the code used for
the form:
<form id="Shoes" method="post" runat="server">
<label for="q">Search:</label><br />
<asp:textbox id="q" maxlength="100" runat="server"/><br />
<label for="sz">Shoe Size (US):</label><br />
<asp:dropdownlist id="sz" runat="server"/><br /> <!-- this control is popu
lated programmatically -->
<label for="tp">Type:</label><br />
<asp:dropdownlist id="tp" runat="server">
<asp:listitem value="24">Any</asp:listitem>
<asp:listitem value="2293">Athletic</asp:listitem>
<asp:listitem value="31920">Athletic-Inspired</asp:listitem>
</asp:dropdownlist><br />
<label for="cd">Condition:</label><br />
<asp:dropdownlist id="cd" runat="server">
<asp:listitem value="24">Any</asp:listitem>
<asp:listitem value="31919">New</asp:listitem>
</asp:dropdownlist><br />
<input type="submit" value="Search"/>
</form>
All is good here.
But should I specify any form variables and perform a postback, I can't acce
ss any of the form
controls using either the Request.Form collection or using Request.Querystri
ng collection.
I have no idea why this is happening. Can anyone help this newbie?
Thanks,
RoshawnI don't see anything particularly wrong with your form ASPX tag code.
You have not shown how you expect to access these values on a postback.
The typicaly pattern is:
Page_Load( ...)
{
if(IsPostBack)
{
//get values here
}
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Roshawn Dawson" wrote:

> Hi,
> I have an .aspx page that contains an html form. Below is the code used f
or the form:
>
> <form id="Shoes" method="post" runat="server">
> <label for="q">Search:</label><br />
> <asp:textbox id="q" maxlength="100" runat="server"/><br />
> <label for="sz">Shoe Size (US):</label><br />
> <asp:dropdownlist id="sz" runat="server"/><br /> <!-- this control is
populated programmatically -->
> <label for="tp">Type:</label><br />
> <asp:dropdownlist id="tp" runat="server">
> <asp:listitem value="24">Any</asp:listitem>
> <asp:listitem value="2293">Athletic</asp:listitem>
> <asp:listitem value="31920">Athletic-Inspired</asp:listitem>
> </asp:dropdownlist><br />
> <label for="cd">Condition:</label><br />
> <asp:dropdownlist id="cd" runat="server">
> <asp:listitem value="24">Any</asp:listitem>
> <asp:listitem value="31919">New</asp:listitem>
> </asp:dropdownlist><br />
> <input type="submit" value="Search"/>
> </form>
>
> All is good here.
> But should I specify any form variables and perform a postback, I can't ac
cess any of the form
> controls using either the Request.Form collection or using Request.Queryst
ring collection.
> I have no idea why this is happening. Can anyone help this newbie?
> Thanks,
> Roshawn
>
Hmm...
Your suggestion is simple enough. I though that you don't always have to ch
eck if the page was
posted back. I thought that I could slap some code onto the page and simply
use the Request object.
Seems I was wrong.
Thanks for the tip, Peter. :-)
Peter Bromberg [C# MVP] wrote:
> I don't see anything particularly wrong with your form ASPX tag code.
> You have not shown how you expect to access these values on a postback.
> The typicaly pattern is:
> Page_Load( ...)
> {
> if(IsPostBack)
> {
> //get values here
> }
> Peter
I appreciate your suggestion, but unfortunately nothing works. I still cann
ot use the Request.Form
collection or the Request.QueryString collection.
Thanks anyway,
Roshawn
If you want to post a "Short but complete" code sample, sombody will review
it. How about your AutoEventWireup directive, how is that set? Have you set
a
breakpont on the code line that you expect to see executed, to see if it is
actually reached? Have you tried using the locals window to look at values?
Peter
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Roshawn Dawson" wrote:

> I appreciate your suggestion, but unfortunately nothing works. I still ca
nnot use the Request.Form
> collection or the Request.QueryString collection.
> Thanks anyway,
> Roshawn
>
Hi, Roshawn.
What you are looking for is the Request.Params collection.
See example usage at :
http://www.informit.com/articles/ar...2&seqNum=4&rl=1
http://www.hanselman.com/blog/ ASPN...leDecoding.aspx
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Roshawn Dawson" <udrago@.bellsouth.net> wrote in message
news:uxxSlDzcGHA.4072@.TK2MSFTNGP05.phx.gbl...
>I appreciate your suggestion, but unfortunately nothing works. I still can
not use the Request.Form
>collection or the Request.QueryString collection.
> Thanks anyway,
> Roshawn
Hi Juan,
I've done some more testing, and what I found is strange. Both the Request.
Params and the
Request.QueryString collections are empty.
I have no idea why this is. Could setting the EnableViewState property to t
rue have an effect on
these collections?
Thanks,
Roshawn
Juan T. Llibre wrote:
> Hi, Roshawn.
> What you are looking for is the Request.Params collection.
> See example usage at :
> http://www.informit.com/articles/ar...2&seqNum=4&rl=1
> http://www.hanselman.com/blog/ ASPN...leDecoding.aspx
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaol : http://asp.net.do/foros/
Never mind; I figured it out. Silly me, I didn't supply a name attribute fo
r any of the form's
controls. That's why I couldn't get any data.
And to think that I need a hairpiece for nothing (I pulled all of it out).
:-(
Thanks gang,
Roshawn
heh, heh...
Been there, done that!
I bet it felt good to finally figure it out!
:-)
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Roshawn Dawson" <udrago@.bellsouth.net> wrote in message
news:%23WISox%23cGHA.536@.TK2MSFTNGP02.phx.gbl...
> Never mind; I figured it out. Silly me, I didn't supply a name attribute
for any of the form's
> controls. That's why I couldn't get any data.
> And to think that I need a hairpiece for nothing (I pulled all of it out).
:-(
> Thanks gang,
> Roshawn

HTML Form -> ASP.NET Page?

This is probably a very basic question, but I'm completely new to ASP.NET and C# (I've been at it a week now) and I can't find a good reference site anywhere that answers my question...

I have a 40 question survey that I need to take the answers from and do a bit of analysis on. Based on the survey results, custom content will be generated. My question is, how do I get the aspx page the survey is posted to, to retrieve all of the question variables so I can work with them? Since the survey is rather long, doing it all as a query string is not a real solution.

I know in PHP I could do it as $someVar = $_POST["$surveyAnswer"]; I just can't find a simple equivalent in ASP.NET just yet.

Any help is appreciated,
-MikeWell, what format are you displaying them in? When the page posts back, you can simply access them by referencing their control ID. Keep in mind ASP.NET posts back to the same page.

Brian
The survey answers are radio buttons with numeric values. I want to take those answers and do some math on them (each question belongs to a category, I want to generate an average score per category). Based on those category scores, I have a stack of content that I then want to display based on what numbers come out. All formatted as a web page.

I don't want to have all of this done and displayed on the same page as the survey is pretty darn long, and the resulting page will be even longer. How can I do this?

I've been digging around all morning and the closest to an answer I can figure is to have it post back to itself, do the number analysis in a button-click event, then redirect to a second page using a querystring with the category scores, unfortunately I don't know quite how to actually do that either.

-Mike
Hi Mike,

Can you post your html code for the aspx page? You need to write the code for number analysis inside Button_Click event so that It will run when the button is clicked. And to redirect to a new page you can use either Response.Redirect() or Server.Transfer() methods.
And you can reference the answers using FindControl("id") method.

Thanks,
Sridhar!!
Here's the form I've built as an example. I need to have the answer options separated out between table cells.


<form runat="server">
<table width="100%" border="0">
<tbody>
<tr>
<td> Question 1 </td>
<td> <input type="radio" name="q1" value="1" runat="server">Opt 1 </td>
<td><input type="radio" name="q1" value="2" runat="server">Opt 2 </td>
</tr>
<tr>
<td></td>
<td></td>
<td> <input onclick="Button_Click" type="submit" value="Submit" name="Submit" runat="server" /></td>
</tr>
</tbody>
</table>
</form>

I've tried using <asp:RadioButtonList> but it doesn't let me separate out the button items into table cells since it doesn't like having HTML tags inbetween. I've tried to use the FindControl("id") method to just redisplay the submitted answers, but no dice on that.

-Mike
Actually a RadioButtonList generates an HTML table for rendering the output anyway, as specified by the RepeatLayout property RepeatDirection and RepeatColumns properties determine the flow of the repeated items.

Brian

Saturday, March 24, 2012

HTML E-Mail with HTML Form ??

Hi,

Do you know if it's possible to send an HTML E-Mail with an HTML Form
(<form></form>) embedded in it??

And if so, will Outlook (a) render the form properly and (b) allow you
to submit the form normally?

Thanks!!> Do you know if it's possible to send an HTML E-Mail with an HTML Form
> (<form></form>) embedded in it??

Yes, you can include the form and the send will work.

> And if so, will Outlook (a) render the form properly and (b) allow you
> to submit the form normally?

It depends on the user's security settings and which version of outlook they
are using. (It should work for most.)

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche

"Glen" <gfergo@.henryschein.com> wrote in message
news:58841151.0311131004.22e96081@.posting.google.c om...
> Hi,
> Do you know if it's possible to send an HTML E-Mail with an HTML Form
> (<form></form>) embedded in it??
> And if so, will Outlook (a) render the form properly and (b) allow you
> to submit the form normally?
> Thanks!!