Announcement

Collapse
No announcement yet.

Running a subroutine on an ASP from an include

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Running a subroutine on an ASP from an include

    Hey guys,

    I would like to run a subroutine on the click event of an image on an asp. This subroutine sits in a vbscript for which I did an include. I am using bits and pieces of stuff I have seen places. Can someone point me in the right direction?

    -Tom

    Here is what I have so far:
    <DIV><form name="Tom.asp" method="post" style="margin:0"><input type=hidden name="run_event" value=""><input type="image" src="/images/redx.gif" width="10" height="10" border=0 hspace=0 onClick="ClearINISection()"></form></DIV>
    -Tom

    Visit Kernhome
    Kern Theater Gallery

    (User: guest / Pass: guest)

    #2
    Tom,
    If you want to run a sub from an onclick event you will have to submit the form back to the server. The onclick event would need to submit the HTML form and the asp would have to use something along the lines of a request.querystring for the ini value to delete.

    I have to run my son to a BB game but when I return I'll give you an example. Unless someone comes up with one before I return.
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Rupp,

      That would be great, I could use an example.

      -Tom
      -Tom

      Visit Kernhome
      Kern Theater Gallery

      (User: guest / Pass: guest)

      Comment


        #4
        Tom,
        I really need to know what your wanting to accomplish but this is the easiest way to clear a setting. The setting to clear is provided in the forms action as a querystring.

        <pre class="ip-ubbcode-code-pre">
        &lt;%@ Language=VBScript %&gt;
        &lt;HTML&gt;
        &lt;HEAD&gt;
        &lt;META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"&gt;
        &lt;/HEAD&gt;
        &lt;BODY&gt;

        &lt;%
        strSetting = Request.QueryString ("iniSettingToClear")

        if strSetting &lt;&gt; "" then
        strValue = hs.GetINISetting("Settings", strSetting, "", "web_settings.ini")
        Response.Write "The initial value for " & strSetting & " is " & strValue & "&lt;br&gt;"
        hs.SaveINISetting "Settings", strSetting, "", "web_settings.ini"
        strValue = hs.GetINISetting("Settings", strSetting, "", "web_settings.ini")
        Response.Write "Value after resetting " & strSetting & " is " & strValue & "&lt;br&gt;"
        end if

        %&gt;
        &lt;form name="main" method="post" action="ini.asp?iniSettingToClear=logpagehits2" style="margin:0"&gt;
        &lt;input type="image" src="/images/redx.gif" width="10" height="10" border=0 hspace=0"&gt;
        &lt;/form&gt;


        &lt;/BODY&gt;
        &lt;/HTML&gt;
        </pre>

        Let me know if you have any questions. The above code looks in the web_settings.ini file that has the following contents:

        <pre class="ip-ubbcode-code-pre">
        [Settings]
        logpagehits=0
        logpagehits2=0
        </pre>
        💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

        Comment


          #5
          Ok, thanks Rupp. I need to clear a whole section where I wrote a small function to read in keys to remain, clear the section and then write the preserved keys. I think your example will get me going.

          Thanks,

          -Tom
          -Tom

          Visit Kernhome
          Kern Theater Gallery

          (User: guest / Pass: guest)

          Comment

          Working...
          X