|
Ok first, I'll outline my project. It is a web application made to search and display records of archived technical documents. What I have right now is a page that uses datagrids (via drag and drop from Visual Studio 2005) to display columns of data from my SQL Test server.
What I need now is a way to create a simple form text box and create and pass a variable to the SELECT statement within the datagrids. All my attempts at this thus far, using both ASP and C# and MSDN knowledgebase, have ended in frustration.
Here is the code of the datagrid:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1" EmptyDataText="There are no data records to display.">
<Columns>
<asp:BoundField DataField="OVERVIEW" HeaderText=" " SortExpression="OVERVIEW" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="
<%ConnectionStrings:trdConnectionString2 %>"
ProviderName="<%$ ConnectionStrings:trdConnectionString2.ProviderName %>"
SelectCommand="SELECT [OVERVIEW] FROM [SUDS_TRD] WHERE [IDENT]='1'">
</asp:SqlDataSource>
What I need to do is where it says [IDENT]='1', is have that "1" be a parameter passed from an HTML form, perhaps looking like this WHERE [IDENT]='"% strIDENT %"', yet I do not know how to pass a parameter from an HTML form into that SELECT statement. Any help would be great as this is a problem holding up my project.
To reiterate, I need to:
A. create an html form text box
B. pass that textbox as a variable
C. place that variable into the SELECT statement for the ASP datagrid.
Any help would be great, example code, whatever it takes; the simpler the better =) Please just don't send me to MSDN's Datagrid Knowledge Base page as 1/2 the stuff there doesn't even work =[.
Thanks for any help in advance!
|
|
|
|
|
Soot,
A couple questions, do you get static(unchanging) data populated in your datagrid as it is? Do you want the end user to enter a variable into the text box to repopulate the datagrid?
As I understand what you've given so far you're going to need a text box, which you can drag and drop where you want it; a button with an OnClick event that will take the text and initiate the SQL statement, you can d&d the button and set the name of the event on the Design screen but the functionality has to be set on the code behind(aspx) page.
I'm fairly new to this myself but I've been working with datagrids for a while and maybe I can help.
An American football fan - Go Seahawks!
Lil Turtle
|
|
|
|
|
|
Hi all,
What is the best way to build reports using Reporting Services based on data from SharePoint? (Users enter data to SharePoint Form Library using InfoPath and managers need to build reports based on that data)
Thanks,
Stas
|
|
|
|
|
Hello,
I generate with JS some HTML-Elements (Div, Hidden and Select) inside a Span-Tag. The Span is positioned absolut with JS after pressing a button. Now I see the Select-Element correct filled, but a static HTML-select-element of this page is displayed OVER the dynamic generated select. See Screenshot:
www.stephan-pilz.de/1.jpg
After I resize the window (manual with mouse !!!) in vertical direction, my dynamic select is displayed OVER the static (this is what I want). See screenshot:
www.stephan-pilz.de/2.jpg
Did anybody know, why the static select is displayed OVER the dyn. select?
Or has anybody some ideas, how I can resize this window and back, to do the manual proc. with JS. For this case, I have try many things with window.resizeTo, .resizeBy, document.body.clientWidth and so on. Nothing of this works.
PLEASE NOTE: The code must only work in IE and the window contains an frameset!!!
Many thanks. I'm hopelessly.
Stephan
\\\| \\ - -
( @ @ )
+---------------oOOo-(_)-oOOo-----------------+
| Stephan Pilz stephan.pilz@stephan-pilz.de |
| <a href=www.stephan-pilz.de>www.stephan-pilz.de</a> |
| ICQ#: 127823481 |
+-----------------------Oooo------------------+
oooO ( )
( ) ) /
\ ( (_/
\_)
|
|
|
|
|
You could try by specifying the z-index of the elements, but I'm not sure how well the select elements would respond to that.
IE 6 is using a standard Windows control for the select list, so it doesn't play very well with other elements in the browser. I would suggest that you change the layout so that you won't have select elemenents on top of each other.
---
b { font-weight: normal; }
|
|
|
|
|
Hm. Not bad idea with the z-Index. Did you know, how I can change that?
It's is unfortunately not possible to change the static elements in the page.
Stephan
\\\| \\ - -
( @ @ )
+---------------oOOo-(_)-oOOo-----------------+
| Stephan Pilz stephan.pilz@stephan-pilz.de |
| <a href=www.stephan-pilz.de>www.stephan-pilz.de</a> |
| ICQ#: 127823481 |
+-----------------------Oooo------------------+
oooO ( )
( ) ) /
\ ( (_/
\_)
|
|
|
|
|
Now I tried to set the z-order via .style.zIndex to 999 of my dyn. select and to 0 of the static select. That does not solve the problem.
Any other ideas ?
Thanks
Stephan
\\\| \\ - -
( @ @ )
+---------------oOOo-(_)-oOOo-----------------+
| Stephan Pilz stephan.pilz@stephan-pilz.de |
| <a href=www.stephan-pilz.de>www.stephan-pilz.de</a> |
| ICQ#: 127823481 |
+-----------------------Oooo------------------+
oooO ( )
( ) ) /
\ ( (_/
\_)
|
|
|
|
|
The select is displayed over because the listboxes generated by the browser do not take z-order styles - i think it's something to do with them actually being windows controls (vague memory...).
Anyway, there is a workaround - if you want to put something over a listbox (we had this problem with dynamically created dropdown menus), you can create an iframe the same size as whatever you want to go over your listbox and one z-order underneath it (i've heard the term shim for this). The iframe hides the select box. So if you could look at your page in height it'd be like this:
div to display
iframe
select to hide
PAGE
|
|
|
|
|
Hello Paddy,
thanks for your answer. Your hint (undoc. feature) solves my problem.
BR
Stephan
\\\| \\ - -
( @ @ )
+---------------oOOo-(_)-oOOo-----------------+
| Stephan Pilz stephan.pilz@stephan-pilz.de |
| <a href=www.stephan-pilz.de>www.stephan-pilz.de</a> |
| ICQ#: 127823481 |
+-----------------------Oooo------------------+
oooO ( )
( ) ) /
\ ( (_/
\_)
|
|
|
|
|
i hav three advertisements as flash movies(ad1.swf,ad2.swf,ad3.swf). i hav a combination of object and embed elements. i want these ads to reapted one after the other. each ads should stay for 1 minute. how can i rotate these ads in javascript?
Thanks.
|
|
|
|
|
There are many solutions but here is one that might do the trick ...
var RunningIE4<br />
RunningIE4 = (msieversion() >=4);<br />
function msieversion() {<br />
var ua = window.navigator.userAgent<br />
var msie = ua.indexOf ( "MSIE " )<br />
if ( msie > 0 )
return parseInt ( ua.substring ( msie+5, ua.indexOf ( ".", msie ) ) )<br />
else<br />
return 0
}<br />
<br />
var curBanner<br />
curBanner = 0<br />
Bfiles = new Array()
Btargets = new Array()
Balt = new Array()
Bfiles[0] = "ad1.swf"<br />
Btargets[0] = "http://www.the web address"<br />
Balt[0] = " description - can be blank"<br />
Bfiles[1] = "ad2.swf"<br />
Btargets[1] = "http://www.the web address"<br />
Balt[1] = " description - can be blank "<br />
Bfiles[2] = "ad3.swf"<br />
Btargets[2] = "http://www.the web address"<br />
Balt[2] = " description - can be blank"<br />
<br />
function startBanner() {<br />
window.setInterval("changeBanner();",60000);<br />
}<br />
function changeBanner() {<br />
if (RunningIE4 == true) {<br />
if (curBanner == (Bfiles.length -1)) {<br />
curBanner = 0;<br />
} else {<br />
curBanner++}<br />
Banner.src = Bfiles[curBanner]<br />
BannerTag.href = Btargets[curBanner]<br />
Banner.alt = Balt[curBanner]<br />
}<br />
} <br />
and later in the web page
<br />
<SCRIPT LANGUAGE="JavaScript"><br />
if (RunningIE4 == true) {<br />
document.write("<A NAME='BannerTag' HREF='" +Btargets[curBanner]+ "' TARGET='_new'><IMG NAME='Banner' BORDER=0 SRC='" +Bfiles[curBanner]+"' ALT='"+Balt[curBanner]+"' ></A>")<br />
}<br />
</SCRIPT><br />
<NOSCRIPT> <A HREF="non-ie webpage.htm">for non MSIE browsers</A> </NOSCRIPT>
modified 1-Aug-19 21:02pm.
|
|
|
|
|
Thank you for your coopertion.
|
|
|
|
|
hi... any one please give me codings to delete the particular row in a datagrid using button column...
Arun chakravarthi
|
|
|
|
|
You can use the itemcommand event of the datagrid to accomplish this task. What you need to do is to get the ID value of that row and then execute the query to delete that particular record from the database and then rebind the datagrid.
Best Regards,
Apurva Kaushal
|
|
|
|
|
hello guys
Problem is that how can i find images in my site. i create three file aish.htm,rani.htm and preeti.htm In three files i insert many images. I want create a input box and a button and result will show in bottom.
baliram vyas
|
|
|
|
|
Hi All,
I work with an web application where I have few components developed using vb, few using ASP.Net , few using VC++ , few ASP pages, few ASP.Net pages etc.
There is no versioning done uptil now for all this files.
Now we are in need of implementing version control.
How can we proceed on it any idea? Anyone please help.
Regards,
HV
|
|
|
|
|
hi all,
i'm using php and i have a large array (it has several thousand entries). i need to search the array, several thousand times, for a value.
the in_array() function works, but the page takes a while to be generated. is their a faster function or way to find out if an element exists in an array?
thanks in advance.
-- modified at 0:52 Monday 21st August, 2006
|
|
|
|
|
Make sure that the values are sorted in the array, so that you can use a binary search[^]. That would significantly speed up the process.
Looping to find a value in an array of 10000 values would need an average of 5000 compares, while binary search will use around 14 compares. That would mean that the process would be around 350 times faster.
---
b { font-weight: normal; }
|
|
|
|
|
Can anyone please shed some light on what is happening here.
I am in the process of developing a web site which contains a calendar that my viewers can select a date and when clicking on that date another window opens to display a day planner with times throughout the day.
They would then click on a day to open yet another page to book their appointment with me.
The issue is this: I have used the window.open function in the following way,
to create button,
the onclick function is: ="DayPlan=window.open('', 'DayPlan', 'width=300, height=300'); which was supposed to open the window and name="s1" value=" 1 "> ... ...
note: the bold type is the actual code I have used!
This script repeats for each of the days in the month.
When I run it and click on a day I get a message that says there is an error...and tells me that 'access is denied.'
Can anyone please, please shed some light on what is happening. I have only just started using javascript so I am in need of simple explanations. Sorry for being a pain.
A Good Instructor Will Lead You Where You Are Too Afraid To Go Alone
|
|
|
|
|
I may be misunderstanding your code, but isn't the window.open() meant to open a URL? It looks to me like you are missing a URL.
Words fade as the meanings change, but somehow, it don't bother me.
|
|
|
|
|
Hi Boro...thanks for the reply. Yes it can open a URL but if left blank will open a blank window, according to a listing to test the window.open() i got from a teaching book. Like I said I am very new to this and have got most of my information/knowledge from 'SAMS Teach Yourself JavaScript' over the last few days.
A Good Instructor Will Lead You Where You Are Too Afraid To Go Alone
|
|
|
|
|
Can you show the actual code that you are using?
---
b { font-weight: normal; }
|
|
|
|
|
Hi Guffa
The original code I got from http://javascriptkit.com/script/script2/buttoncalendar.shtml
I then added this function:
function OpenDayView()
{
DayPlan=window.open('', 'DayPlan', 'width=300, height=300');
}
//OpenDayView()
And modified this one:
function setDate(str) {
if (str == " ") {
alert('Sorry, you selected an invalid date!');
return;
}
else {
OpenDayView()
}
This should work like this;
user clicks blank button and gets 'selected invalid date' message...
user clicks valid date and gets new blank window opened.
I get error message...'access is denied'
your thoughts would be very much appreciated.
Paul
A Good Instructor Will Lead You Where You Are Too Afraid To Go Alone
|
|
|
|
|
That looks like it should work.
There is a possibility that there is a popup blocker stopping the window, of course. You don't get any indication of that?
How are you calling the function?
---
b { font-weight: normal; }
|
|
|
|