|
Hello!
It is all about defining the application variables in global.asa file. It is very simple see the codes for global.asa file below. And then you can use application variables in any pages as Application("CurrentUsers") etc. examine the code below... However your IIS server sometimes can reset the application variables when it gets restarted that what happens. Therefore I advice you to keep values in the database.
GLOBAL.ASA FILE
Sub Application_OnStart
Application.Lock
Application("Visitors") = 0
Application("CurrentVisitors") = 0
Application.UnLock
End Sub
Sub Session_OnStart
Application.Lock
Application("CurrentVisitors") = Application("CurrentVisitors") + 1
Application("Visitors") = Application("Visitors") + 1
Application.UnLock
End Sub
Sub Session_OnEnd
Application.Lock
Application("CurrentVisitors") = Application("CurrentVisitors") - 1
Application.UnLock
End Sub
|
|
|
|
|
Thank you. It cleared the things for me a bit.
Unfortunatelly I don't know anything about ASP and VBScript, but
with the help of the info you've given me now I have an idea what to look for
and with a little luck I may learn how to do this. The problem is I'm using
PHP and I was searching for a solution in PHP. Is there a way I can do this using PHP? If there isn't, I guess I'll have to install ASP, but then how am I going to make it work with my PHP pages?
Thanks again. I appreciate your help.
Damn, sleep is so unefficient. I don't want to go to bed. But I must.
|
|
|
|
|
It has nothing to do with PHP. It doesn't matter if you are going to use PHP or ASP. It is the concept how global.asa is processed by IIS. In your PHP script you can directly use Application("currentVisitors") variable.
The global.asa file should reside under the root directory. It is mandatory.
I don't think there will be any problem.
|
|
|
|
|
Sorry, I forgot to mention that I'm using Apache 1.3 .
And now I have to install perl and mod_perl or something like that.
Then I'll be able to use Global.asa and ASP, atleast I think so.
Unfortunatelly I'm not a sysadmin and it will prove difficult for me
installing this although it's under Windows.
So much work, yet so little time.
|
|
|
|
|
i want to enable one of the security setting in Custum Level of Trusted Site zone in IE.How can we do it programatically.
|
|
|
|
|
I don't think you can do that. It would be a major security risk.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
You might be able to change the setting in the registry. This of course requires that you run a program or component on the client computer.
---
b { font-weight: normal; }
|
|
|
|
|
Hello.
I have one problem with webservices and that problem is:
I have one application 3-tier.
In Data tier i have a class Address(example).
In Business tier (exposed by webservices) I have two webservices that returns class Address.
In Client or Interface Tier i have one module aspx that makes management of addresses. But in this class i only can import Webservice1.Address or Webservice2.address. But i want import only class Address, and not webservice1.address and webservice2.address (in client this 2 address classes are not the same).
I could i do that?
Thank you.
António Dias
|
|
|
|
|
Hi there,
Basically, the auto-generated proxy will contain the template for the custom types being used in the web services so that the client can consume the services. In this case, you can provide an additional custom proxy that is responsible for converting the shared class Address to the object provided by the service contract, and your client code will call this custom proxy instead. Another option is that you can use the SchemaImporterExtension class to edit the generated proxy by replacing the return type with the shared one.
|
|
|
|
|
I put this question in another forum and Rodrigo answer my question and solve my problem.
Here is the solution:
Antonio,
you can use the wsdl.exe tool with the /sharetypes option to share the same generated types in both services.
Or if you prefer having the Address class in a shared assembly along the whole project you can implement a "Schema Importer Extension" that allows you to customize the wsdl proxy generation using CodeDOM to add a reference to that assembly....
Hope it helps
Rgds
Rodrigo
|
|
|
|
|
Hello,
I normally write down my apps in Visual C++, but I need to make a little web page in order to show a couple of flash videos, one image (this image should be dynamic) and some texts that should also be dynamic.
In our enterprise we have a screen in the main door in order to say hello to our guests... and our secretaries should be able to prepare a little list of visitor names. This list should be shown in that web page.
I need something very simple, and that will have only to run in one computer.
I'm thinking on a little sample that I could modify just to meet my needs.
If the final result should be a database, I'd like to use a free one or access, as I have the legal license.
Thank you in advance.
PS: I'm completely lost at this point, I cannot spend time doing that and I don't want to pay for it, so I would like to get the easiest and fastest method to do it by myself.
|
|
|
|
|
Hi Joan!
It is not vey complicated to call / open a database file via asp or php. First you have to have a database file under a specific directory on the server. Make sure it is password protected. Then it is easy follow my steps below.
1. You have to define the path and connection string for the file. Therefore, make sure that you include the likely statements below in your inc. file.
DPath = Server.MapPath( "_database\FILE.MDB" )
ConnStr= "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Dpath & ";Jet OLEDB:Database Password=12345;"
2. We have to initiate a connection to database when it becomes essential for you to open the file and perform several tasks
Set ObjectConnection=Server.CreateObject ("ADODB.Connection")
ObjectConnection.Open ConnStr
3. Define a specific SQL string such as
SQLSTR = "SELECT * FROM stocks WHERE GoodsIndex = 10"
4. We have to initiate recordset. Therefore use the following statements
Set ObjectRecord = Server.CreateObject ("ADODB.Recordset")
ObjectRecord.CursorLocation = adUseServer
ObjectRecord.CursorType = adOpenkeyset
ObjectRecord.LockType = adLockOptimistic
ObjectRecord.Open SQLSTR, ObjectConnection,,, adCmdText
notice: adCmdText is used to process a SQL string command if you want to open a table directly you can also use admCmdTable statement.
5. okay lets reach the data with ADO
If ObjectRecord.RecordCount > 0 Then
SelectedGood = ObjectRecord("GoodsName")
End If
6. When you done close the connection
SET ObjectRecord = NOTHING
ObjectConnection.Close
DONE!
I hope it works for you!
|
|
|
|
|
hi! there is a web page calles mt.aspx. there is input button on it. when i click on this button a new popup window open.there is another button on it that is closed popup window. now i refresh first window & on clickin close button popup window doesn't close. actually on refreshing parent window reference of child window lost. is there any way to close child popup window from parent window after refreshing parent window?
|
|
|
|
|
No, there isn't. As you lose the reference to the child window by reloading the parent window, you can not reach the child window any more.
---
b { font-weight: normal; }
|
|
|
|
|
is it not possible to save reference of child window in the cokies or in hidden field? and after that i type cast the value of hidden field in the objec?
|
|
|
|
|
you need reference to the child window, not a value which is stored somewhere else and retrieved.
|
|
|
|
|
No. The values you save is a cookie or send in a form are only text values, and you can not store an object reference as text.
---
b { font-weight: normal; }
|
|
|
|
|
Hello firends
when I recieve new email from AJAX,Without any refresh it shows me I recieve new email and number of add one to number of email in inbox.
I want to know how gmail do that?
Is it by AJAX?
When we use AJAX,User does something ,And after user did an action on interface ,then interface will change,But in this case it shows me without any refresh or without any action on interface,Please know me if you know any tutorial about this case.Do you AJAX code for that?
I heard that Gmail uses a hidden iframe for its Ajax calls. Regardless, you can easily do auto-updating without any user interaction by setting a repeating callback (with setTimeout or similar) which polls the server for updates every X seconds.
May someone give me code for these idea?(use settimeout and use Iframe)
Thanks in advance
|
|
|
|
|
Yes that is AJAX. Just google for some tutorials. There are plenty.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hello my firend
How?
How Gmail use AJAX to do something like that,I know something about AJAX,But I want to know How GMAIL use that?
I saw something about google suggestion ,But I want to know about Gmail.Do you know any tutorial that shows how gmail does that?
GOOD LUCK!
-- modified at 0:44 Monday 18th September, 2006
|
|
|
|
|
Nope (that dosen't mean there is none)
But if you will study AJAX enough you will figure that out by yourself.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Hello
Could you show me the AJAX code that Gmail use?
Thanks,
GOOD LUCK!
|
|
|
|
|
abalfazl wrote: Could you show me the AJAX code that Gmail use?
dude!! how can anybody give you some code which gmail is using. You can ask for some ajax sample code but not the gmail code isn't it?
Best Regards,
Apurva Kaushal
|
|
|
|
|
I've spent tonight trying to get jscookmenu to work in an ASP.NET project. Even in a html page, it works sometimes, but in an aspx, I have the following in my header:
<SCRIPT type="text/javascript" src="./menu-js/jscookmenu.js"></SCRIPT>
<LINK rel="stylesheet" href="./menu-js/ThemeOffice2003/theme.css" type="text/css">
<SCRIPT type="text/javascript" src="./menu-js/ThemeOffice2003/theme.js"></SCRIPT>
These files exist.
Then in the body I have this:
<DIV ID=MenuID11></DIV>
<SCRIPT type="text/javascript">
<!--
cmDraw('MenuID11', wbMenu11, 'hbr', cmThemeOffice2003, 'ThemeOffice2003');
-->
</SCRIPT>
The point is, theme.js defines cmThemeOffice2003, and cmDraw them passes this to the menu code. Instead I get an error that cmThemeOffice2003 is undefined. But it ISN'T. Does anyone have any suggestions what IE is really trying to tell me here ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Are you using a correct path to the files? Put some alerts in the files and in the page, so that you see if the files are actually included, and if they are executed in the order that you expect.
---
b { font-weight: normal; }
|
|
|
|