|
I have a list with loads of elements. I would like to provide an edit box that when typed into reduces the number of elements to matching ones only.
I wish to use JavaScript only, and I relaise I could use a large array, match the array, emply the list, and re-populate using the matches. however there are so many elements that I'd rather not create an array as this would slow the page download speed.
Perhaps is there any way I can make an element invisible? Can anyone think of a better way please? Thanks.
I feel like I'm diagonally parked in a parallel universe
Jeremy Davis
http://www.astad.org http://www.jvf.co.uk
|
|
|
|
|
Jeremy Davis wrote:
however there are so many elements that I'd rather not create an array as this would slow the page download speed
Would it? Surely if you have an array, you don't need the option tags because you can populate it onload? In theory you might reduce the size of your page.
There may be a better way, it just occurs to me that this is a strange presumption.
Paul
And you run and you run to catch up with the sun, but it's sinking Racing around to come up behind you again The sun is the same in a relative way, but you're older Shorter of breath, one day closer to death - Pink Floyd, Time
|
|
|
|
|
Paul Riley wrote:
Would it? Surely if you have an array, you don't need the option tags because you can populate it onload? In theory you might reduce the size of your page.
Good point. I might have a go....
I feel like I'm diagonally parked in a parallel universe
Jeremy Davis
http://www.astad.org http://www.jvf.co.uk
|
|
|
|
|
uniqueidentifier, adoguid, DataGrid
1. MY TABLE SCHEMA:
I have this table with the following schema:
column SQL server data type ado data type
MsgID uniqueidentifier adoguid
MsgTitle char(250) adchar
MsgBody char(5000) adchar
2. WHAT I DID:
I load the data into a DataSet, then load the DataSet into a DataView (i need it for RowFilter), then bind the DataView to DataGrid. Code snippet as follows:
oConn = new SqlConnection(sConnect);
daForum = new SqlDataAdapter(sCommand, oConn);
daForum.Fill(this.dsForum, "Forum"); //dsForum is the DataSet
this.dvForum.Table = this.dsForum.Tables["Forum"];
//DataView: Apply row filter - we want to display root message only: ie. ParentMsgID='Null'
dvForum.RowFilter="IsNull(ParentMsgID,'Null')='Null'";
//DataGrid:
this.dgForum.DataSource = dvForum;
this.dgForum.DataBind();
oConn.Close();
3. THE PROBLEM:
3a. MsgID column disappeared? Where did this happen? When I load it to DataView? Or when DataGrid binds to DataView?
3b. The intention is, when user click a row on the datagrid, I would retrieve MsgID with "ItemCommand" event handling mechanism:
protected void Command(Object Sender, DataGridCommandEventArgs e)
{
....
//Reference (data type): http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=454
Guid gdMsgID;
gdMsgID = e.Item.Cell[0].Text; //I wish to retrieve MsgID as follows.
}
code snippet will be very helpful... thanks!uniqueidentifier, adoguid, DataGrid
1. MY TABLE SCHEMA:
I have this table with the following schema:
column SQL server data type ado data type
MsgID uniqueidentifier adoguid
MsgTitle char(250) adchar
MsgBody char(5000) adchar
2. WHAT I DID:
I load the data into a DataSet, then load the DataSet into a DataView (i need it for RowFilter), then bind the DataView to DataGrid. Code snippet as follows:
oConn = new SqlConnection(sConnect);
daForum = new SqlDataAdapter(sCommand, oConn);
daForum.Fill(this.dsForum, "Forum"); //dsForum is the DataSet
this.dvForum.Table = this.dsForum.Tables["Forum"];
//DataView: Apply row filter - we want to display root message only: ie. ParentMsgID='Null'
dvForum.RowFilter="IsNull(ParentMsgID,'Null')='Null'";
//DataGrid:
this.dgForum.DataSource = dvForum;
this.dgForum.DataBind();
oConn.Close();
3. THE PROBLEM:
3a. MsgID column disappeared? Where did this happen? When I load it to DataView? Or when DataGrid binds to DataView?
3b. The intention is, when user click a row on the datagrid, I would retrieve MsgID with "ItemCommand" event handling mechanism:
protected void Command(Object Sender, DataGridCommandEventArgs e)
{
....
//Reference (data type): http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=454
Guid gdMsgID;
gdMsgID = e.Item.Cell[0].Text; //I wish to retrieve MsgID as follows.
}
code snippet will be very helpful... thanks!
norm
|
|
|
|
|
In particular, I want to do something like this:
protected void Command(Object sender, DataGridCommandEventArgs e)
{
Guid gdMsgID;
DataRow dr;
gdMsgID = (Guid) e.Item.Cells[0].Text;
dr = this.dsForum.Tables["Forum"].Rows.Find(gdMsgID);
//Alternative 1: string strItem = dgForum.SelectedItem.Cells[0].Text;
}
NOTE: BOTH Alternative 1 DOES NOT work. Error is something like "Cannot convert System.Guid to String..." ... something like that. But my problem is, the data grid does NOT even display the GUID column in the first place. What I really need is that GUID column be hidden in DataGrid, but the underlying DataSet should have the GUID column (MsgID). And I should be able to retrieve this column via OnCommand event handling mechanism. Any idea?
Thanks.
norm
|
|
|
|
|
I've got the Guid displayed on DataGrid, but still need to retrieve it and call stored procedure. I tried to force the column by manually entering BoundColumn - with "Visible=True":
<asp:boundcolumn visible="False" datafield="MsgID" headertext="MsgID">
<itemstyle horizontalalign="Center" width="0px">
The column is sitting right in front of my eyes. I worked gracefully.
I still need the column in Guid, so later on, in response to OnCommand, I can invoke a system stored procedure (SQL Server)
GetMsg(@MsgID, @MsgTitle, @MsgBody)
@MsgID is INPUT
@MsgTitle and @MsgBody are OUTPUT.
Code will look like:
OnCommand(...)
{
Guid gdMsgID;
String strMsgTitle;
String strMsgBody;
gdMsg = e.Item.Cells[0].Text; //PROBLEM 1!!
Set oCmd = Server.CreateObject("ADODB.Command");
With oCmd //Yeah, it's VBNET syntax. Havent figured out the C# equivalent yet - if there's one. I checked sever places, it seems there's NO equivalent in C#.
.ActiveConnection = oConn;
.CommandText = "sproc_GetMsg";
.CommandType = adCmdStoredProc;
//PROBLEM 2: 128 bits? Should I put 16 BYTEs for size?
.Parameters.Append( .CreateParameter("@MsgID", adGUID, adParamInput, 16, gdMsgID) );
//Output:
.Parameters.Append( .CreateParameter("@MsgTitle", adChar, adParamOutput, 100, strMsgTitle ) );
.Parameters.Append( .CreateParameter("@MsgBody", adChar, adParamInput, 1000, strMsgBody ) );
End With //Yeah, it's VBNET syntax...
}
Thanks.
norm
|
|
|
|
|
Found a way to get around this. I will just pass strMsg (in String format) to the stored procedure and have the stored procedure to do the conversion from String to UniqueIdentifier.
Still want to know if there's a way to get GUID from OnCommand/DataGrid mechanism.
norm
|
|
|
|
|
Is there anybody knows how to retrieve the source code from
a certain web page? I've tried the Microsoft Internet Transfer
Control, but it seems for use in transferring file only!
Many thanks in advance
Jackal
|
|
|
|
|
Just remembered that Mark Nischalke[^] had this in his article: http://www.codeproject.com/aspnet/weather.asp[^]
So courtesy of him here it is:
WebRequest req = WebRequest.Create(strURL);
StreamReader stream = new StreamReader(req.GetResponse().GetResponseStream());
System.Text.StringBuilder sb = new System.Text.StringBuilder();
string strLine;
while( (strLine = stream.ReadLine()) != null )
{
if(strLine.Length > 0 )
sb.Append(strLine);
}
stream.Close();
********************
* $TeVe McLeNiThAn
********************
|
|
|
|
|
what are u thinking? i never heard you can retrieve source. Do u mean view menu>Source on your MS Internet Explorer? That's not source really. Code (ASP or whatever) has been complied to HTML before sending it to your browser.
norm
|
|
|
|
|
Msxml2.XMLHTTP will do the work for you Look in MSDN for its description
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
Thank you very much, I've got what I want, to share with you,
'Create the Microsoft Internet Transfer Control
set oItc = server.createobject("InetCtls.Inet")
'Set the Timeout
oItc.RequestTimeout = 20
'Set the target URL
oItc.URL = "http://www.microsoft.com"
'Open it
strSource = oItc.OpenURL()
'Print out the result
Response.Write(server.HTMLEncode(strSource))
then you'll see the result
Jackal Jiang
|
|
|
|
|
please tell me how to set a web server,
is IIS server only for intranet .
if so then which server is used for internet application development.
How to configure the server.
i am new to the web domain.
please tell me the architecture of web applications.
regards
Anshu
|
|
|
|
|
IIS is used for intranets and Internets, and can be configured for both simultaneously. Your question is far too complex to answer in a forum, though, and you really should read the documentation that comes with IIS. If you have Win2K as your server, it is not installed by default unless you are upgrading from an OS that already had a web server installed. You can add it from the CD using the Add/Remove Programs Control Panel function. When you install it, it will set up a default website for you with no content, but all the documentation will be included. Spend some time with the documentation, try your hand at playing with the settings, then come back with some more specific questions. We have some really talented web designers here who will be happy to assist you.
Nobody wants to read a diary by someone who has not seen the shadow of Bubba on the prison shower wall in front of them!
Paul Watson, on BLOGS and privacy - 1/16/2003
|
|
|
|
|
Hi, I need to include a resource and I have tried all options:
<EMBED src="/pics/AppliedAlgorithms_logo.bmp" width=250 height=75><br>
<EMBED src="./pics/AppliedAlgorithms_logo.bmp" width=250 height=75><br>
<EMBED src="../pics/AppliedAlgorithms_logo.bmp" width=250 height=75><br>
The directory structure of my website is:
/webroot/myaspnet_application (That's where I made the EMBED call)
/webroot/pics (That's where the picture is.)
I have the same problem with Server.Transfer.
Please advise.
norm
|
|
|
|
|
Why not to use IMG tag instead of EMBED ?
And what is the root of your site? If the root is the "webroot" directory then the first and the last paths should work well
Philip Patrick
Web-site: www.stpworks.com
"Two beer or not two beer?" Shakesbeer
|
|
|
|
|
yea, "webroot" is the root directory of the website.
"/webroot/myaspnet_app" is the asp.net location where I made the <embed /> call.
"/webroot/pics/" is where the pictures are.
norm
|
|
|
|
|
For the past two days I have been trying to get a script to work, but I am failing. I am positive it has to do with the paths because when I write a test script to save some text in a file in the local directory (cgi-bin) no problem. If I try to write somewhere else I get the damn internal server error. Maybe I am stupid but someone please help me out a little. And yes I have an existing text file with chmod 666 set. Here is my information:
domain name: www.movietrack.net
(also accessed as http://server925.gisol.com/~georgiek/)
instructions from the server:
Path to Perl - "/usr/bin/perl"'
Path to sendmail - "/usr/sbin/sendmail"
Path to date - "/bin/date"
Path to your home directory - "/home/username"
Path to your web directory - "/home/username/htdocs" (accounts created before February 2002)
Path to your web directory - "/home/username/public_html" (accounts created after February 2002)
and when running a test script that gets all the ENV variables for the path of the cgi script I get:
SCRIPT_FILENAME = /home/georgiek/public_html/cgi-bin/first.cgi
Now this works for me:
open(OUTF,">outdata.txt");
It writes to the file in the directory cgi-bin.
I have the same file in the directory: /public_html/outdata.txt
With the info given above can some rewrite the open statement for me so I can understand how to access files in other directories. Here is what I have tried and failed with:
open(OUTF,">/home/georgiek/public_html/outdata.txt");
open(OUTF,">/movietrack.net/georgiek/public_html/outdata.txt");
open(OUTF,">movietrack.net/home/georgiek/public_html/outdata.txt");
open(OUTF,">/home/georgiek/public_html/outdata.txt");
open(OUTF,">http://server925.gisol.com/~georgiek/public_html/outdata.txt");
open(OUTF,">http://server925.gisol.com/~georgiek/outdata.txt");
Someone please point it out to me!!!!! Thanks.
|
|
|
|
|
you could try "../public_html/outdata.txt"
[edit]
Also make sure your public_html folder is writable if you expect the script to be able to write there (and that the outdata.txt file is also writable)
[/edit]
Debugging cgi scripts on a remote server can be an utter pain in the arse. Here's a handy script that I use, which gives you a shell style prompt on the server:
http://www.rohitab.com/cgiscripts/cgitelnet.html[^]
Run that, CD into your cgi-bin folder (it'll probably default there, as that's where the script itself will be) and run your cgi from the prompt
i.e.
./myscript.cgi <enter>
This should actually give you sensible error messages from the perl interpreter, rather than a generic "script failed" message
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Thanks so much for the link, that's probably one of the most useful programs someone has ever pointed me to. I got my cgi-script running at 5 AM Yes! I have a question: I wrote a test script which is supposed to open a file write to it and then close. When I use the cgi I get an error (500) yet the file is written to no problem. I checked with telnet and syntax was OK. The code:
<br />
$datapath = "/home/georgiek/public_html/Database/database.txt";<br />
<br />
open(OUTF, ">>$datapath");<br />
<br />
print OUTF "This is only a third test\n";<br />
<br />
close(OUTF);<br />
and I accessed it by: www..../cgi/...cgi
I assume I am getting the error because after it writes to the file then it has nowhere and nothing to show because when I enter some HTML to be written all is well. Am I correct in assuming this?
|
|
|
|
|
Hi
Any idea how to make appear my own icon on the
address toolbar of Internet Explorer ???
Thanks
|
|
|
|
|
You need to add a link element in your document's head:
<LINK REL="SHORTCUT ICON" HREF="http://www.mydomain.com/myicon.ico">
|
|
|
|
|
I have searched and searched and can't find specific answers to these questions on LDAP. If you respond to this thread, please be detailed, and thanks very much for your help!
I have a ActiveX LDAP component that I am using from within an ASP page to authenticate users (by doing a bind a search). I have a two part question:
a) is it necessary to have a component to perform this? Is there no VBScript or other way of authenticating and passing the results to an ASP page?
b) what is necessary to perform this securely. Other than pointing to port 636, I know that I have to have SSL cert installed on my IIS, but is that it? I have SSL and I point to 636 (assuming 636 is listening).
Any help is greatly appreciated, I just can't seem to find much on this PARTICULAR situation. I have no experience with PHP, but if there is a way to do it and pass the LDAP response to ASP, that's fine with me too!
|
|
|
|
|
I think the follow snippet is fairly self explanatory:
<SCRIPT language="VBScript">
Sub SetNum(num)
document.some_form.AddHiddenVariable("var5", "value="&num) QUESTION 1: I want to do something like this. If you dont suggest this, perhaps you can show me how to add hidden form variable and "submit" on server side script?
document.some_form.submit
End Sub
</SCRIPT>
<html>
...
<body>
<form name=some_form action=page2.asp method=post>
<input type=hidden name="var1" value="1">
</form>
<table>
Dim num
num=3
<tr OnMouseDown="SetNum(num)"> QUESTION 2: Is it okay if SetNum() client side and num is server side? But to "submit", SetNum() needs to be client side... dilema.
<td>....</td>
</tr>
</table>
</body>
</html>
Thanks a bunch!
norm
|
|
|
|
|
I have four variables. A,B,C,D.
I want to check as below (ie) I NEED TO SELECT RECORDS ONLY IF THE BELOW CONDITION SATISFIES.
A < 0 AND B < 0 OR A > 0 AND B > 0.
I have written a code like.
IFF A<0 AND B<0 OR C>0 AND D>0. (ie.) even if A is greater than 0 and B is less than zero, it should not select records. So I coded like this.
I would just like to know whether the above is right or the below one which my colleage is insisting about (ie).
IFF (A>0 AND B>0) OR (C<0 AND D<0).
Basically what is he insisting is that there should be a bracket, whereas I am telling it is not required since those are logical operators and logical operators rule whatever it is OR FUNCTION WILL PRECEDE THE AND FUNCTION, so
need not put brackets.
Which is correct? If both are correct, which one is recommended from a good coding standards perspective?
Deepak Kumar Vasudevan
http://deepak.portland.co.uk/
|
|
|
|