Question

Hi I am trying to achieve following in c# where I want to post xml data to a url where cxml-urlencoded is an hidden field.

<FORM METHOD=POST ACTION=<%= url%>>
<INPUT TYPE=HIDDEN NAME="cxml-urlencoded" VALUE="<% CreateCXML toUser,
fromUser, buyerCookie, unitPrice, supPartId, supPartAuxId, desc%>">
<INPUT TYPE=SUBMIT value=BUY>
</FORM>

I tried doing it

string  myurl=(uri+Server.UrlEncode(str1));
      Response.Write(@"<a input type=""hidden"" name=""cxml-urlencoded"" value=""myurl""></a>"); 
      Response.Close();

Any ideas how to best go about it?

Was it helpful?

Solution

Insert a HiddenField server control in the page

<asp:HiddenField runat="server" ID="hdXML"/>

and set the value in the hidden fields from code behind as

hdXml.Value = CreateCXML(toUser, fromUser, buyerCookie, unitPrice, supPartId, supPartAuxId, desc);

Make sure you have the CreateCXML function declared and returning string.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top