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

Get Value From FormView on Postback

As always, hope this is the right group.

Very new to .net and all its glorious headaches. Using asp.net 2.0
(trying to at least) and have a problem that is frustrating. I have a
FormView setup that uses a second sqldatasource to populate a pulldown
list (CatPullDown1) within the Edit Template. That pulldown list is
set to AutoPostBack. So far, things seem to be OK. The lits populates
correctly, and on autopostback an event fires off that updates a SQL
DB. Here's the thing. I need to use the new value from the pulldown
list to flesh out the SQL statement. I have no idea how to get that
value. Here's what fires off on that postback...

Sub CatPullDown1_SelectedIndexChanged(ByVal sender As Object, ByVal
e As System.EventArgs)

DataBind()

Dim strItem As New Long
strItem = CLng(Request.QueryString("item"))

Dim strCat1Value As String
strCat1Value = CatPullDown1.SelectedItem.Value()

Dim updateCatDB1 As New SqlDataSource
updateCatDB1.ProviderName = "System.Data.SqlClient"
updateCatDB1.ConnectionString = "blah blah"
updateCatDB1.UpdateCommand = "UPDATE dbo.table Set fldCat1 = '"
& strCat1Value & "', fldCat2 = '2 ', fldCat3 = '3 ' WHERE fldItem =" &
strItem
updateCatDB1.Update()

End Sub

The strCat1Value is what I need to fill in. If I put in a specific
value (i.e. '1 ') it runs fine. The above code gives me an error that
CarPulLDown1 is not declared. It seems that it's hiding in the Edit
Template too far, but I really need to get this value out. Any help
would be great.
Nov 22 '05 #1
0 747

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

Similar topics

0
by: Jason K | last post by:
As always, hope this is the right group. Very new to .net and all its glorious headaches. Using asp.net 2.0 (trying to at least) and have a problem that is frustrating. I have a FormView setup...
2
by: jason.kunk | last post by:
As always, hope this is the right group. Very new to .net and all its glorious headaches. Using asp.net 2.0 (trying to at least) and have a problem that is frustrating. I have a FormView setup...
0
by: jason.kunk | last post by:
As always, hope this is the right group. Very new to .net and all its glorious headaches. Using asp.net 2.0 (trying to at least) and have a problem that is frustrating. I have a FormView setup...
5
by: Jurgen Appelo | last post by:
I'm at a loss here... My FormView control automatically performs a databind at each postback on the server. But in some cases I don't want this to happen. Like when the business layer decides that...
3
by: J055 | last post by:
Hi I have a PlaceHolder control inside a FormView EditItemTemplate: <asp:PlaceHolder ID="phResponseText" runat="server"> <tr> <td> <asp:Label ID="lblResponseText"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.