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 2 1284
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
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:dropdownli st 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:dropdownlis t><br/>
<label for="tp">Type:</label><br/>
<asp:dropdownli st runat="server" id="tp" enableviewstate ="false">
<asp:listitem value="-24">Any</asp:listitem>
<asp:listitem value="2293">At hletic</asp:listitem>
<asp:listitem value="31920">A thletic-Inspired</asp:listitem>
</asp:dropdownlis t><br/>
<label for="cd">Condit ion:</label><br/>
<asp:dropdownli st id="cd" runat="server" enableviewstate ="false">
<asp:listitem value="-24">Any</asp:listitem>
<asp:listitem value="31919">N ew</asp:listitem>
</asp:dropdownlis t><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("<GetSe archResultsRequ est xmlns=""urn:eba y:apis:eBLBaseC omponents""><Re questerCredenti als><eBayAuthTo ken>" &
ConfigurationMa nager.AppSettin gs("Token") & "</eBayAuthToken></RequesterCreden tials>")
.Append("<Categ oryID>63850</CategoryID><Det ailLevel>Return All</DetailLevel>")
If Request.QuerySt ring("q") <"" Then
.Append("<Query >" & Request.QuerySt ring("q") & "</Query>")
End If
.Append("<Searc hRequest><Attri buteSetID>22</AttributeSetID> <ProductFinderI D>22</ProductFinderID >")
'for the Size Parameter
If Request.QuerySt ring("sz") <"" Then
'turn off all selected items
For i = 0 To Me.sz.Items.Cou nt - 1
Me.sz.Items(i). Selected = False
Next
.Append("<Searc hAttributes><At tributeID>53</AttributeID><Va lueList><ValueI D>" & Request.QuerySt ring("sz") &
"</ValueID></ValueList></SearchAttribute s>")
Dim item As ListItem
For Each item In Me.sz.Items
If item.Value = Request.QuerySt ring("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.QuerySt ring("tp") <"" Then
'turn off all selected items
For i = 0 To Me.tp.Items.Cou nt - 1
Me.tp.Items(i). Selected = False
Next
.Append("<Searc hAttributes><At tributeID>54</AttributeID><Va lueList><ValueI D>" & Request.QuerySt ring("tp") &
"</ValueID></ValueList></SearchAttribute s>")
Dim item As ListItem
For Each item In Me.tp.Items
If item.Value = Request.QuerySt ring("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.QuerySt ring("cd") <"" Then
'turn off all selected items
For i = 0 To Me.cd.Items.Cou nt - 1
Me.cd.Items(i). Selected = False
Next
.Append("<Searc hAttributes><At tributeID>94</AttributeID><Va lueList><ValueI D>" & Request.QuerySt ring("cd") &
"</ValueID></ValueList></SearchAttribute s>")
Dim item2 As ListItem
For Each item2 In Me.cd.Items
If item2.Value = Request.QuerySt ring("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("<Pagin ation><EntriesP erPage>10</EntriesPerPage> </Pagination></GetSearchResult sRequest>")
End With
Try
Me.Xml1.Documen tContent = hp.CreateHeader s(sb.ToString() )'call to eBay
Dim ext As New XsltArgumentLis t()
ext.AddExtensio nObject("urn:Sh oes", shoe)
Me.Xml1.Transfo rmArgumentList = ext
Me.Xml1.Transfo rmSource = "search.xsl t"
Catch ex As WebException
'handle errors here
End Try
End Sub
I hope this helps you help me. Thanks for being interested. :-)
Roshawn This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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 generated, though.
I'd like to capture the NAME of every HTML form field element on the
server, even if that element is submitted blank. The trouble is, with,
say, radio buttons or checkboxes for example, a *blank* element does not
get submitted at all.
|
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 become
visible....If they keep the dropdown box at "No" (default) then I want
to submit the form "as is", keeping the inapplicable HTML fields
hidden....I'm trying an "if statement" in ASP....Here's my code....I'm
thinking that the if statement...
|
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 disappears, leaving just "web author: chris
(big space) <myemail.gif>". It's ok (afaik) in other browsers, and even
other versions of ie.
I tried a lot of variations, and eventually found a workaround (at
index.htm) which appears to work, but I'd really...
|
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.
Auto-farmatting feature been worked well.
It was make right indents, quotes and ect.
Just like below:
|
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 number of detail lines for an order. I
want the user to be able to change values on these detail lines and hit an
'update' button. I know how to do this in Javascript, but I'd like to be
able to inspect the controls that come back to my C# program...
| |
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 TextArea object to a script
function doesn't work.
What's the least amount of change I can make to this to remain
compliant but also correct for execution?
|
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 syntax wrong?
The function is previously included with include_once('library.php');
This seems to work ok. I dont get any php errors if I turn on reporting.
The function checks out ok on its own. I've also tried a simple echo with
no luck....
|
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 classic asp. I have also
been using System.Web.UI.ICallbackEventHandler to send data to the server
and back without using controls.
What I want to know is the pros and cons of each. To me you never have quite
the freedom using a control as you...
|
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 width="476" style="height:100% " border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="238" valign="top">
<div style="margin:29px 0px 0px 23px; ">
|
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 show - text boxes, input boxes, buttons,
hyperlinks ie the usual.
The data is not obtained directly from a database.
|
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |