473,761 Members | 8,463 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
objectdatasourc e 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 5111
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.doc ument.getElemen tById("ctl00_Ma inContent_TextB ox1").setAttrib ute("value","Fo o");
self.opener.doc ument.getElemen tById("ctl00_Ma inContent_FormV iewcSIDDtls_Mrk tsTextBoxTest") .setAttribute(" 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
3845
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 returned autogenerated Identity is wrong (on the VB side). This only occurs if the length of the value inserted for the text column is >= 8002. I've included a simple example below.
0
1605
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. (Scenario: I have an email body and i have to replace some tags like <^ContactEmail^> and others to get the actual Data from the DB, I can do this) but my problem I cannot do a replace function a text data type and the SQL BOL says I have to use...
2
3042
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 an adp and its method of therefore enabling a form to be connected to a procedure that requires parameters is really nifty. However in practice I am finding a number of annoying issues with this, most particularly that the adp seems to have...
1
2203
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. The value is optional (i.e., leaving the textbox blank is perfectly acceptable). The problem is that I pass the UI values down to the DAL for insertion or updation (yes - I'm coining a new word) into the DB. Behind the UI I was initially using...
0
1296
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 datatype text being returned from a stored procedure? I need to use it's value to display comments text on a profile page. The comments will be more than 8000 characters so using varchar is not an option. Maybe I'm on the wrong track...if so, then...
7
3469
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 'UpdateRegistrant' expects parameter '@EMail', which was not supplied. The field value was null in the database and not changed in the FormView so is null going back into the stored procedure. I'm stumped and would greatly appreciate any suggestions.
4
7742
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 parameters -------------------------- Parameter Name : V_OUTPUT Parameter Value : ERR:-443
0
1244
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 ArrayList that seems to do some tricky stuff with a chache object and I am unable to get any sort of sorting happening.
0
2223
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 type list, process and return result. My question is: I like to be able to pass input parameter of type list into stored procedure and pars the list, process it and return result set. It is an SQL stored procedure (in DB2) that is called with in...
0
9336
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,...
0
9948
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 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...
0
9765
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 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...
1
7327
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5215
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...
0
5364
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3866
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3446
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2738
bsmnconsultancy
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...

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.