سؤال

I try to create dynamic voice xml document with ASP .NET.

I get a variable in my first page ASP application : customerRecordId

<%
       int customerRecordId = GetNextAvaliableCustomerId();


 %>

And I want to send this parameter to my second vxml generator page:[ProcessAtServer.aspx]

<submit maxage="0" method="post"
                       next="http://localhost/ProcessAtServer.aspx"

/> 

By default vxml submit all tags like "filled" .But not my variable customerRecordId.

PS: I try namelist at submit : namelist = "customerRecordId" not worked.

How can I send/pass parameter customerRecordId to the page ProcessAtServer.aspx ?

More Info:

Here is general structure of My ASP .NET. What I want is to pass the result of Function GetNextAvaliableCustomerId as parameter to post request [ using submit tag ]

<script language="c#" runat="server">


 public int GetNextAvaliableCustomerId()
 {
    // Some Code
 }

</script>

<% Response.ContentType="text/xml"; %><?xml version="1.0" encoding="utf-8" ?>

<vxml version="2.0">

  <%-- This DOES NOT WORK. 
       GET COMPILATION ERROR "Compiler Error Message: CS1002: ; expected"  
  --%>
 <var name="customerRecordId" expr="<%GetNextAvailableCustomerId()%>"/> 

<form>

    <field name ="option">

         // SomeCOde          
        <submit maxage="0" method="post"
                           next="http://localhost:49368/ProcessSurveyResult.aspx"
                           namelist ="option"
        />

        // Some code
</filled>
</form>
</vxml>     
هل كانت مفيدة؟

المحلول

Putting customerRecordId in the namelist will not work because it is not part of the vxml. Try something like this:

<var name="customerRecordId" expr="<% =GetNextAvailableCustomerId() %>" />

Then you can use the namelist attribute in the submit element to pass the variable in query string.

If you are new to VoiceXML and what to use ASP.NET to generate dynamic pages I would suggest looking at the open source project VoiceModel. There are a lot of examples in the project to help you get started.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top