|
Got a asp page. (DB search page) in one frame.
BASIC db with a single search on one field and passed back to same page. (So page refreshes with new search result) NOW I need to just build an array that STAYS and gets added to even if you do another and another and another search (Just to track what elements in DB was selected in each search page) and then display the array in a second frame on the page after each selection was made? IS THIS EASY ENOUGH??? Any help would be appreciated. New to this line of coding.
this is me
|
|
|
|
|
You can use javascript to send a string or array to the other frame, and in a function in that frame handle the collection of items.
Example:
Script to send a string of id:s to the other frame:
top.otherFrame.addItems('4,7,18,42');
Script in the other frame that adds the id:s to a string:
var items = '';<br />
<br />
function addItems(id) {<br />
items += (items.length?',':'') + id;<br />
}
This is just a method for sending the data. If you want to display anything in the other frame, you have to add code for that. Perhaps you need to reload that page in order to get more information about the items than just the id.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks for the quick responce again. Will try this tonight.
Can I then just do a page refresh IN that script code (I am just using VB at the moment all though almost all my previous coding experience is in c++ (Java etc))
function addItems(id) {
items += (items.length?',':'') + id;
(PAGE REFRESH THINGY
}
What would be the page refresh code then? I assume there is simply a sinlg line of code to do this? THUS when something gets passed to this page as in the first part, then this will update the array and then refresh the page??? I HOPE?
this is me
|
|
|
|
|
Yes, you can for an example pass the string of id:s in querystring to the new page:
window.location = 'MyPage.asp?items=' + items;
---
b { font-weight: normal; }
|
|
|
|
|
Sheesss but you guys (oor maybe jsut you) really do know how to help a guy out.. THANKS again for the quick responce.
OK I get the first posting you made and makes sence, but do I need to do the querystring pass or can I do it like first post only and then just refresh the PAGE 2 to display the updated array each time data has been passed to this PAGE?
Mmm.. OK. So if I have one page (DB search) I can then send info from there to other page (SAME HTML FRAME SET IN DIFFERENT FRAMES) and update an array in the second frameset (second page)
PAGE 1 is DB ( wILL NOT PASS db fIELDS OR ANYTHING LIKE THIS BUT THE SELECTION ON this page needs to be passed to PAGE 2's array)
PAGE 2 is RESULT
IF PAGE 1 send info to page 2 (FORM let's say)
PAGE 2 GETS INFO AND AMENDS the array (ADDS to what it had before)
So you can change PAGE 1 (DO MULTIPLE SEARCHES one after other) AND EACH RESULT PAGE SEND DATA TO PAGE 2 and PAGE 2 UPDATES the array (Not start a new array again)
PAGE refresh will then on the PAGE 2 show the arrays NEW data after each FORM DATA send from PAGE 1.
this is me
|
|
|
|
|
If you want to reload the second frame, you have to send all the accumulated items in the request. You can do this either using a hidden field in a form and posting the form, or passing it in querystring.
You can use the value from the querystring to get the records from the database:
strSQL = "select id, foo, bar from theTable where id in (" & Request.Querystring("items") & ")"
Put the previously accumulated items in a string in asp and write it out in the javascript. Something like:
<%
strItems = ""
While not rs.EOF
strItems = strItems & "," & rs("id")
rs.MoveNext
Wend
strItems = Mid(strItems, 2) 'remove first comma
%>
var items = '<%=strItems%>';
When you call the function that will reload the page, it will add the new items to the previously accumulated items, and send them all back in the querystring.
---
b { font-weight: normal; }
|
|
|
|
|
Something in the function when adding to the array that just says
this.refresh = refresh ???
Not going to work???
this is me
|
|
|
|
|
What do you mean? What is that code supposed to do?
---
b { font-weight: normal; }
|
|
|
|
|
OK in more detail I have this.
Pricelist.asp ASP page that simply does a shirt on the DB and displays the result in same page
Choices.asp Frame to display the accumilative choices made in the pricelist.asp frame
Price.htm the frameset containing the two ASP pages.
Now user sees the two ASP pages and can then elect a qeury in pricelist.asp (In the TopFrame)which returns the result in the same frame (page) he can then select one or more of the qeury results and click a submit button which will then pass this result to the Choice.asp page (In the MainFrame) where that result gets added to the allready there array and displyed as soon as it has been updated.
A this stage I know what I want passed etc and can get that into place, but passing seems to be done to the wrong page or frame or something ?? What would the pass be to the Mainframe on the Price.htm be? Is it Price.MainFrame or would it be just Mainframe from the Pricelist.asp or would it be Choice.mainframe or just choice I am clueless.. Sorry for this HELLUVA long thing, but sure you now know what I need? PS and any chance of keeping the answer for me in VB?? Not serious, but would help. I assume I can then pass the results from a form in Pricelist.asp to a Procedure in Choice.asp????
THANKS AGAIN FOR ALL THE HELP.. JSUT NEED THIS SORTED AND I CAN GET MY WEBSITE UP THEN.. REST IS WORKING FINE.
this is me
|
|
|
|
|
As I wrote earlier in the thread, you can use this to call a javascript function in a different frame:
top.otherFrame.addItems('4,7,18,42');
Where otherFrame is the name of the frame and addItems is the name of the function. Just substitute the name of the frame you want to reach, and the name of the function you wish to call.
---
b { font-weight: normal; }
|
|
|
|
|
Hi:
Confused. With Visual Studio .NET, don't we have that Dependency Walker (depends.exe). A full search of hard disk does not reveal it. Should we necessarily install MSDEV (VS 6) for this.
Perhaps if there was a Sourceforge.net or some freeware too, that would be great.
Deepak Kumar Vasudevan
Personal Web: http://vdeepakkumar.netfirms.com/
I Blog At: http://deepak.blogdrive.com/
|
|
|
|
|
Hi:
I am trying to package a OCX file into a CAB file using the Setup and Deployment project in Visual Studio .NET.
I wanted to know how to find the dependencies that the OCX might depend on and how to include them or direct the web browser to automatically download them from the parent website or from Microsoft itself.
Perhaps I would like to present an example like if some custom specialized Win32 library of XP being used and for Win2k, if OCX needs it, I need to package it or direct the OCX to download it. Is'nt it?
Particularly, I encountered an issue with GDIPlus.dll being not found in Win98 PCs and hence the ActiveX Control could not load in Win98 IE.
Please advise...
Deepak Kumar Vasudevan
Personal Web: http://vdeepakkumar.netfirms.com/
I Blog At: http://deepak.blogdrive.com/
|
|
|
|
|
Hello All!
I am new to the javascript language and am needing some assistance with the syntax. I need to write a script that will capture the user's NT Login information. I don't need the password, but I do need the user name and domain name if necessary. so that I can run a query through ColdFusion to my Oracle Database's user table.
Can someone tell me what that syntax is or a really good Javascript language book with great examples on how to capture this data?
I have done this same thing using .NET Asp and storing the information in Session variables, but at this time that is not the language that is being used. So I would really appreciate any suggestions and help.
Thanks!!!
:->
|
|
|
|
|
|
I found a work around but can someone tell me why this does not work. I read in books that this is how to do it in VbScript
dim x
for x = 0 to document.formname.Elements.Length -1
msgbox document.formname.Elements(x).name
Next
It seems to me that the Elements is null as I get the for loop not initialized error. Plus, the when trynig to print the length i get nothing.
I can do a document.getelementbyId with no problem.
the elements are create using window.DisplayEdits.innerHTML=lsDisplay
DisplayEdits being a CELL
Thanks
|
|
|
|
|
hi,
Can anyone please provide me with some guide or references for deploying an ASP.NET web application that uses:
- Crystal Report 9 (Integerated with VS.NET 2003)
- A web service deployed at some remote server.
- SQL Server 2000 database
I am going for a custom action to get some parameters such as database server name, database name, etc. from the user at deployment time. I want to insert these parameters in the web.config file of the application during the setup.
is there any way to do this?
thanx in advance
☺«««DTA»»»☺
|
|
|
|
|
What installer are you using ? web.config is just an xml file, so in theory there's no problem with doing this, but I don't know if the standard installer package will allow it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
We used InstallShield DevStudio 9 to do this. That has flexible and easy to use Custom Forms and after collecting all info, we can have a Custom Installer class to be invoked, which can generate proxy, update web.config etc.
Deepak Kumar Vasudevan
Personal Web: http://vdeepakkumar.netfirms.com/
I Blog At: http://deepak.blogdrive.com/
|
|
|
|
|
|
i AM using the Visual Studio setup project.
i like the custom action idea by minhpc_bk! infact i think that its the only way to do this (when using the VS.NET setup project.)
i suppose that this custom action has to be run at the commit event..right? as the web.config wont be there to edit during the installation. so if this is right, then can any of you guide me on how to use the user provided information in this custom action and how to find the path where the web.config will get installed to? some tutorials would be great!!!
again thanx a lot to all of you guys!
regards
☺«««DTA»»»☺
|
|
|
|
|
I am having problems hiding user controls. The attached code does not appear to work can anyone point me in the right direction. On page load I don't want to display the user control.
File webform1.aspx.cs
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
namespace Emulator
{
///
/// Summary description for WebForm1.
///
public class WebForm1 : System.Web.UI.Page
{
Keyboard keyboard1 = new Keyboard();
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
if (!IsPostBack)
{
keyboard1.Visible = false;
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
FIle webform1.aspx
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="Emulator.WebForm1" %>
<%@ Register TagPrefix="uc1" TagName="Keyboard" Src="Keyboard.ascx" %>
<title>WebForm1
<uc1:keyboard id="Keyboard1" runat="server">
User Control files
file keyboard.ascx.cs
namespace Emulator
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
///
/// Summary description for Keyboard.
///
public class Keyboard : System.Web.UI.UserControl
{
protected System.Web.UI.WebControls.TextBox textBox1;
protected System.Web.UI.WebControls.Button buttonOk;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
public void Hide()
{
this.Visible = false;
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
file keyboard.ascx
<%@ Control Language="c#" AutoEventWireup="false" Codebehind="Keyboard.ascx.cs" Inherits="Emulator.Keyboard" TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<asp:textbox id="textBox1" runat="server">
<asp:button id="buttonOk" runat="server" text="Ok" class="Fatkey">
function keyClicked(elem)
{
try
{
document.all("keyboard1_textBox1").value+=elem.value;
}
catch(e)
{
Response.Write(e);
}
}
clueless novice
|
|
|
|
|
Hi there,
There are a couple of things come to mind after a quick scan on your sample code:
+ To add a web user control to the web page, you cannot use the new keyword to create the user control and add it to the web page. You either declare it on the web page, for example:
<uc1:Keyboard id="Keyboard1" runat="server" /> or use the LoadControl method to programmatically load the user control based on its path.
+ In the code-behind, you simply add the declaration for the control instance:
protected Keyboard Keyboard1;
+ To make the control insivible, simply set the Visible property to false as you did.
For more information, you can see Adding User Controls to a Web Forms Page[^]
|
|
|
|
|
I have a variable called "testvar" with a value of (let's say)OPT
My SQL SELECT statement I have this
"SELECT FROM PRICELIST WHERE CAT =" &TESTVAR
Or something like this. IF I change the testvar in the select to "OPT" it works but not if just OPT.. How do I get my TESTVAR sert to hav the guotes in allready. ?????
I KNOW it must be something silly? PLEASE?
I assign the testvar="OPT" but need the select statement to then add this corectly to do a = to OPT?
HOPE this is enough info. (P.S. yes I am a newby as you can see
evlxtc
|
|
|
|
|
You have to put apostrophes around the string value:
"SELECT FROM PRICELIST WHERE CAT = '" & TESTVAR & "'"
This will give you a string that contains:
SELECT FROM PRICELIST WHERE CAT = 'OPT'
---
b { font-weight: normal; }
|
|
|
|
|
Thanks, that is all I needed. NOW I just need to finish a few small graphics and that will be that for this site. PS How do I in anycase concat a string to make a variable = "something" or is this not possible straight forward?
this is me
|
|
|
|