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

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,
Roshawn
Jan 12 '07 #1
2 1242
Hi,

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
Jan 12 '07 #2
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 &amp; 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""><Request erCredentials><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

Jan 12 '07 #3

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

Similar topics

7
by: JDS | last post by:
Hi, all. I'd like to do the following, preferably *without* resorting to JavaScript: I have a long, dynamically-generated form questionnaire. Not all of the form fields are dynamically...
4
by: dmiller23462 | last post by:
I'm trying to create a submission page for users to request PC/LAN Access....If they select "Yes" in the field asking about if they need Non Standard Software, I want several other HTML fields to...
8
by: Chris Sharman | last post by:
See the bottom of http://www.prestonbridge.pwp.blueyonder.co.uk/index2.htm (4th line of the club officers section). The mark-up's validated html 4 & css, but in ie5.0/Win2000 my surname...
1
by: Dymov Vlad | last post by:
Hello, All! I have some trouble with subject. Maybe it is not trouble at all, but i need a good advise. I have just tried to write simple ASPX page in HTML view. Everything was good....
5
by: Brian Kitt | last post by:
I have a C# application that builds dynamic HTML and renders it. Because it is rendered in this way, the input controls are not server controls. I write the entire page, which has a variable...
29
by: Richard Lionheart | last post by:
Hi All, I've taken the advice of a few people and managed to cobble together an HTML 4.01 Strict-compliant document (according to the W3C Validation Service), but the way I try to pass a...
2
by: tony | last post by:
I am trying to use a form with a button that calls a verification script but can't seem to get the script to run at all - can anyone tell me if this SHOULD work in a forms onCLick or have I got the...
19
by: ThatsIT.net.au | last post by:
I come from a classic asp background, but have started using ASP.NET about 12 months ago, but I'm still not sure about the pros and cons of using controls v HTML spat out from code as you would in...
5
by: NYXX | last post by:
Here is my Html Code and my Contact.php This is My code in my html <td height="345" valign="top"> <form style="margin:0; padding:0; " action="contact.php" method="get" id="form"> <table...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
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,...
0
isladogs
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...
0
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...

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.