|
How could I install a application which is packed under .msi to client server?
I have read about .cab file too... what is the differences between the two?
I wish to make a silence install so should I go with .msi or is it possible to do it with .cab since it seem much less troublesome.
|
|
|
|
|
Hi guys,
I've used PHP quite a bit before, and I'm now moving over to ASP.
In PHP, I would create a common functions file called functions.php, and use require('functions.php') at the top of every page.
I am having trouble trying to replicate this in ASP.
In a single page scenario, I have this code, which queries a database:
<br />
Dim Conn 'Create the ADOBD connection object<br />
Dim rs 'Create the recordset object<br />
<br />
set conn = server.CreateObject ("ADODB.Connection") <br />
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath ("Rental.mdb")<br />
<br />
set rs = server.CreateObject ("ADODB.Recordset")<br />
<br />
<br />
rs.Open "SELECT [BALANCE] FROM [MEMBER] WHERE [MEMBERID] = " & session("memberID") &"", Conn
So, I created a functions.asp page, and placed all code EXCEPT the rs.open line, into it. That page looks like this:
<%<br />
Function SetupConnection()<br />
<br />
Dim Conn 'Create the ADOBD connection object<br />
Dim rs 'Create the recordset object<br />
<br />
set conn = server.CreateObject ("ADODB.Connection") <br />
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath ("Rental.mdb")<br />
<br />
<br />
set rs = server.CreateObject ("ADODB.Recordset")<br />
<br />
End Function<br />
%>
I then placed this in the original page, above the rs.open line...
SetupConnection()
When calling the original page, I get:
Object required: ''
/account_main.asp, line 11
Line 11 is the rs.open line.
Am I completely missing the point here? The only thing I can assume is that it's something to do with the scope of variables.
|
|
|
|
|
In one form I save a variable in a view state like so:
ViewState["Color"] = "red";
I then call Response.Redirect(nextPage.aspx)
In the page load function of nextPage.aspx I try and read the variable using this:
string sColor=(string) ViewState["Color"];
but there is nothing there!
What am I doing wrong?
thanks
Brian
|
|
|
|
|
Hi Brian. ViewState is maintained for one page and its postbacks. When you redirect to another page, a new ViewState is generated.
In your context, you may want to set a cookie rather than use ViewState, or use a Session variable: Session["Color"] = "red";
|
|
|
|
|
Thanks Mike.
I did just that and things are working.
Perhaps you can answer this question for me
If I defne an aspx page with html controls, can I use code behined file to handle the code for those controls? This would mean that the controls are handled client side...
Brian
|
|
|
|
|
Hi Brian. The code-behind file (and the .aspx file for that matter) is compiled and executed server-side only. You can declare standard <html> controls with the runat="server" attribute to access them server-side. Here's a simple example:
<%@ Page Language="C#" %>
<script runat="server">
void Page_Load(object o, EventArgs e)
{
myHeading.InnerHtml = "This is the Heading";
myText.Value = "Default Value";
}
</script>
<html>
<head>
<title></title>
</head>
<body>
<form runat="server">
<h3 id="myHeading" runat="server" />
Here is a standard HTML text box:
<input type="text" id="myText" runat="server" />
</form>
</body>
</html> If you want to manipulate html controls client-side, you'll need to look at javascript for that.
|
|
|
|
|
Hi ,
i am facing one problem in decripting the dat in asp...
situation is:
there are 5 fields in webpage .... one among them is to upload them is to browse the file field... i am using
'--- all fields are here---
when i am clicking on submit button .. my image is uploaded to the server ... now i am trying to insert the image path and other field in the database on the next page..i am trying to fetch the variables by using request("variablename").. but the value is not comming on next page...
... can any body help me hoe to decript the value...
please tell me this asap...
i will be highly thakful to you if u can transfer code ...
thank you,
chandan sharma
|
|
|
|
|
Are you using a third party COM component todo the uploading? I'm assuming this is classic ASP (not asp.net). Usually the component doing the uploading has methods to get access to the form variables.
|
|
|
|
|
hi,
i am programming website in which i am uploading image to the server...
my file and the folder( in which image is going to upload ) they are present in the same directory. i am writing this code...
Upload.Save("Upload_Image")
when i am giving absolute path then my programm is uploading the image.. but when i am giving relative path then it is not uploading the file to the server...
how to know the drive name of the server ....in which my file will be present....
can any body help me...
|
|
|
|
|
If I understand you correctly you need to use the Server.MapPath method.
This will turn your relative path into an absoulte path.
|
|
|
|
|
thanks for your kind help....
|
|
|
|
|
Hi All...
I have a problem that I will write you down.
I have a web page that use client side xmlhttp ( "Microsoft.XMLHTTP" with javascript ) object to update a piece of data in the page. It work well, accept the clients which use PROXY server to reach internet. Clients with Proxy always gets the oldest data. What can I do to overcome proxy problem when using xmlhttp in client side to reach the data on my server?
tahnx a lot...
not: I use asp with windows 2000 server on server side and I allow only ie 5.5 up broser to see that page.
karanba
|
|
|
|
|
I think you need to set the expiration (which is a header) on the page. I think something like Response.Expires = 0 is what you are after.
|
|
|
|
|
how do i set focus to a text box on my webform. and i was also wondering how do i link the enter key to one of my buttons
thanks
chad
|
|
|
|
|
|
Here's my situation. I've got an ASPX page that needs to be refreshed with new content every few seconds, but that amount of time is variable. I'm sending that variable to the page from the server-side application on every refresh. That way, theoretically, the page can automatically refresh when that variable amount of time is elapsed and thereby get a new amount of time to count down.
Setting up a JavaScript reload function is easy enough, but I can't find a way to get that ASP variable into the Javascript, as the JavaScript seems to be able to only access HTML form components and not ASP form objects.
So, I either need a way to get an ASP variable into the JavaScript, or I need a different client-side script that can actually get that variable from an ASP control and is still capable of causing a PostBack like JavaScript can. Any ideas?
Thanks for your help!
|
|
|
|
|
Well if you think about it, all the server is doing is outputting text, whether that text is HTML, javascript etc.
So you could output something like this:
<javascript block="">
setTimeOut(<%= Some Variable calculated on the server%>);
<javascript block="">
This would be sent to the client like:
<javascript block="">
setTimeOut(500);
<javascript block="">
Of course this is oversimplified, you could create custom controls that are a little more elegant and reusable.
|
|
|
|
|
How do I connect an Access database to an XML procedure.
RP Max
|
|
|
|
|
what is the best way to get variables from one webform to another without over loading my server by usering session
chad
|
|
|
|
|
hi,
there are three ways by which u can transfer the varable from one page to another page...
1-> by using request("variablename").
2-> by using session("variablename")=value..
3-> by using
but by maintaing the session it is easy to tranfer the variable from one page to any other page... this is the best way..
bye
chandan sharma
|
|
|
|
|
how do i pass them using hidden fields
chad
|
|
|
|
|
by using hidden field
in this way u can use the hidden value concept...
when u will go to the next page u can reterive the value of this variable... by using request("variable_name")...
* remember this hidden value tag should be present under the form tag....
ok
|
|
|
|
|
And there is a fourth method[^]. Using properties and the context.handler.
|
|
|
|
|
hi,
i have used a datagrid control to display the data in my aspx page.
i have also set the validation controls to required fields and it works!
but it works a bit too well!!
let me explain the scenario a little bit.
i have used template columns for all the data fields and at the footer of each column, i have placed an empty textbox for accepting new records.
Furthermore i have a separate template column to show the edit, save/update and cancel buttons, and at the footer of this column i have placed another set of buttons for saving the new entered data.
i have placed a required filed validation for one of the fields 'User Id'. this validation is also at the footer of the column, therefore it checks for the insertion of a NEW User Id. When the no data is entered, the validation works and the error messege is diplayed. also the save button for the new record does not work. but the problem is that the edit buttons dont work as well. and i want all the other buttons to work except for the saveing the new record.
well i have explained a bit too much havent i? sorry about that! i have tried to be as short as possible.
but please is there any way around this. i am also willing to use javascript, but i am not very familiar with its use. so please recommend me some good links or code.
thanx in advance!
☺«««DTA»»»☺
|
|
|
|
|
a have a webform written in asp.net with a hidden field on it is there a way i can get the info from the hidden field when i get to the next web page like i could do in asp like "Request.Form["test"]" would return me what was in the test hidden field from the prev page
chad
|
|
|
|