473,395 Members | 2,436 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.

How to bind input text field to pass as parameter to stored procedure in BLL

Hello all,

I'm fairly new at this so I may be doing this the wrong way but I've
got a FormView within a multiview that when it is updated in edit
mode, will call on the update method associated with the
objectdatasource that fills the formview.

Problem:
One of the fields is a textbox that when clicked has to open up a
popup window with a listbox and when that popup closes, it sends the
results as a comma delimited string back to the text box. I've done
this with javascript and had to switch from an asp:textbox to input
textbox as I don't believe the asp textbox control has an onclick
event. The issue is that to use the input textbox I have to use
value='<%# Eval("Mrkts") %>' instead of value='<%# Bind("Mrkts") %>'
because if I try Bind it says "A call to Bind must be assigned to a
property of a control inside a template. As is, using Eval, when it
invokes the update method it does not carry over the newly updated
value within the textbox.

Is there a way to work this into a bind that I'm missing?

I tried to go about it by creating another textbox somewhere within
that formview that i would use to pass to the update method but within
the javascript I need to do getElementById(controlID) but I am unable
to track down how it is building this controlID. I can do this for a
asp textbox outside of the formview but that is no help.

I'm thinking the best approach is to have it go into the code behind
when hitting the update button and call the update method from in
there but I'm not able to see any of the values for any of the fields
within this formview from the codebehind the way I'm doing it. I've
tried FindControl with not much luck.

If anyone can provide some insight I'd be thrilled. Thanks1

May 24 '07 #1
2 5077
So after spending all day on it, almost immediately after posting this
I figured out how to grab the clientID of the textbox within the
formview. However, I try to update that textbox from the javascript
and nothing happens. It works fine for a textbox that I placed
outside of the multiview though...

self.opener.document.getElementById("ctl00_MainCon tent_TextBox1").setAttribute("value","Foo");
self.opener.document.getElementById("ctl00_MainCon tent_FormViewcSIDDtls_MrktsTextBoxTest").setAttrib ute("value","bar");

When this code runs from either the parent or the child, it only
updates the one outside the multiview which is the first one.

Serenity now....

May 24 '07 #2
Ok I found a workaround. If anyone knows the correct way to do this
or a better way please enlighten me :-)

I figured out how the controlIDs are built so I was able to use
javascript and setAttribute to update an asp control from the child
popup. Rather than a textbox I actually used hiddenfield control so
it wasn't in the way. I used Bind on the hidden field and that did
the trick when calling the update method.

May 24 '07 #3

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

Similar topics

4
by: Dan | last post by:
I've run into an interesting problem, and seemed to have stumped 3 newsgroups and 2 other forums. For some reason when I try to insert a record into a SQL table that has a Text column, the...
0
by: Dev | last post by:
Hi Fellows, I am trying to write a User Defined Function in SQL 2000 to accept a Parameter of type Text Field and then Do a replace function to manipulate the some strings inside that text data....
2
by: Andrew Chanter | last post by:
I am developing my first ADP client for a SQL db, after having used mdb's as clients in numerous applications previously. I have found that theoretically the Input Parameters property of a form in...
1
by: Guadala Harry | last post by:
What do to about conversion to decimal type when blank is allowed? The situation is this. In the UI there is a textbox into which users can enter a value which is supposed to be a dollar amount....
0
by: Jimmy | last post by:
I have a web page that displays data from a sql server db. I'm using a stored procedure to return data from a field of type text as an OUTPUT parameter. How can I use an OUTPUT parameter of...
7
by: Dabbler | last post by:
I'm using an ObjectDataSource with a stored procedure and am getting the following error when trying to update (ExecuteNonQuery): System.Data.SqlClient.SqlException: Procedure or Function...
4
by: jdokos | last post by:
Hello All, I have a procedure that is getting -443 after upgrading to V9.5 FP1. The procedure was written to output only the SQLCODE. Here is the output that is returned: Value of output...
0
by: pbd22 | last post by:
Hi. I am returning to an old bit of code in our program and need to figure out how to sort my columns on bind. I am sorting on Date (mostly) and some other values. Problem is, the code is an...
0
by: htenay | last post by:
I need to be able to define an array in Java and pass it on to SQL stored procedure. I am new to store proc and found a lot of helpful tutorials on Google but found none that passes parameter of...
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
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
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
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
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...
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.