473,386 Members | 1,860 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,386 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.
Jul 21 '05 #1
0 1031

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

Similar topics

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...
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...
2
by: Dabbler | last post by:
What's the best way to return to GridView after editing a detail record in a FormView so the GridView shows the page with the edited record on it? I'm using GridView with standard...
2
by: flodpanter | last post by:
I have one objectdatasource which both a gridview and a formview rely on. In my Gridview I have a command button which should display the selected row in my formview. Sorting the gridview...
4
by: J055 | last post by:
Hi I have 2 update buttons in my FormView ('Apply' and 'OK'). I want both buttons to update the data source but the 'OK' button should redirect afterwards. I can see which button is clicked...
4
by: TS | last post by:
In my production exceptions i get an email with all the form elements and their values to debug. the controls that have a blank value are not seen and it makes my debug job harder (was the...
1
by: Q. John Chen | last post by:
I have Validation controls on FormView. ClientScripts is enabled FormView's DefaultMode is ReadOnly. And I have button so it will swith to Insert or Edit mode. To be specific, I have a...
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"...
5
by: Mark Olbert | last post by:
It appears that FormView controls require the >>exact<< same layout of controls and control types in the various templates in order to function properly. Failure to do so results in a "failure to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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:
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,...

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.