accessing key value pairs from config file...

asp India
  • 14 years ago

    Hi all,

    I am new to asp and though my question may sound inane, please take out time to reply asap.

    I have to access key/value pairs defined in .config file from .asp page.

    I tried many ways but it is giving compilation and syntax errors.

    these are the errors i am getting: 

     

    Microsoft VBScript compilation error '800a03ea'

    Syntax error

    /employer/employee/orderdetails.asp, line 2215

    Response.write (<%getvalue(MailFromAddr)
    or 

    MailFrom_Addr is not defined.
    Please help me out.
    I've got a deadline.....
     
    Thanking you in anticipation......
     
    kris.
     
     

  • 14 years ago

    you should use the global.asa ...

    the web.config is used in asp.net

    serval

     

     

  • 14 years ago

    1)  to use the global.asa add this following to it :

    Sub Application_OnStart

    Application("Mail_From_Addr") = [email protected]

    End Sub

     

    2) to retrieve the data in your asp page you have to type

    response.write application.value("Mail_From_Addr") 

     

    serval

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“My definition of an expert in any field is a person who knows enough about what's really going on to be scared.” - P. J. Plauger