I have the following XForms code:
<?xml-stylesheet href="./xsltforms.xsl" type="text/xsl"?>
<?xsltforms-options debug="yes"?>
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events">
<head>
<title>XForms Submit Example</title>
<xf:model id="MyModel">
<xf:instance src="./Model.xml"/>
<xf:bind id="FirstName" nodeset="/MyData/FirstName"/>
<xf:submission id="save" method="put" action="./myData.xml" replace="none" />
<xf:submission id="loadDoc" action="./myData.xml" replace="instance" method="get" />
</xf:model>
</head>
<body>
<xf:input ref="FirstName" incremental="true">
<xf:label>Please enter your first name: </xf:label>
</xf:input>
<br/>
<br/>
Output First Name: <xf:output ref="FirstName" />
<br/>
<br/>
<xf:submit submission="save">
<xf:label>Save</xf:label>
</xf:submit>
<br/>
<br/>
<xf:submit submission="loadDoc">
<xf:label>Load</xf:label>
</xf:submit>
</body>
</html>
This form contains one textbox field and two buttons save and load, and also 1 dependency to the file Model.xml which is:
<?xml version="1.0" encoding="UTF-8"?>
<MyData>
<FirstName>John</FirstName>
<Data2>Two</Data2>
<Data3>Three</Data3>
</MyData>
The problem is: When I entering some data to text box, pressing save button, the model should be saved to myData.xml. This file exists on disk and it is not read only
In fact nothing happens, and file's data will not be updated (by the way Load button works fine).
What is the reason of this behaviour and how to fix this and save entered data to external file?
Did you already try adding "file://" in the action attribute?
-Alain
Related
As the question states I'm trying to set a background image in XSL file for a Sitecore Email component.
If I hard code a variable with the image source and then set the Div's background using Style then I can see my div with the background set.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sc="http://www.sitecore.net/sc"
xmlns:dot="http://www.sitecore.net/dot"
exclude-result-prefixes="dot sc">
<!-- output directives -->
<xsl:output method="html" indent="no" encoding="UTF-8" />
<!-- parameters -->
<xsl:param name="lang" select="'en'"/>
<xsl:param name="id" select="''"/>
<xsl:param name="sc_item"/>
<xsl:param name="sc_currentitem"/>
<!-- variables -->
<!-- Uncomment one of the following lines if you need a "home" variable in you code -->
<!--<xsl:variable name="home" select="sc:item('/sitecore/content/home',.)" />-->
<!--<xsl:variable name="home" select="/*/item[#key='content']/item[#key='home']" />-->
<!--<xsl:variable name="home" select="$sc_currentitem/ancestor-or-self::item[#template='site root']" />-->
<xsl:variable name="backgroundurl">-/media/Images/go-ape-forest-banner-background.ashx</xsl:variable>
<!-- entry point -->
<xsl:template match="*">
<xsl:apply-templates select="$sc_item" mode="main"/>
</xsl:template>
<!--==============================================================-->
<!-- main -->
<!--==============================================================-->
<xsl:template match="*" mode="main">
<div style="background:url({$backgroundurl}); background-repeat:no-repeat; background-size:100% 100%; height:200px; border-radius: 25px; border: 2px solid black; padding-left: 20px;padding-right: 20px;">
</div>
</xsl:template>
</xsl:stylesheet>
As you can see from the screen shot above, this works so far as the image is displayed as the div's background image, but is not what I'm after, the background image should be set according to the Sitecore Item, In this case the Items background image field and not a hard coded variable.
I have access to various items from the components template. In this case we have the following fields:
Logo (Image)
Icon (Image)
Background (Image)
Headline (Single-Line Text)
Icon Text (Single-Line Text)
I can access these items on the page using the following sitecore controls:
<sc:image field="logo"/>
<sc:image field="icon" />
<sc:image field="background" />
<sc:text field="headline"/>
<sc:text field="icon text"/>
If I add the above onto my xsl page they render correctly as can bee seen from screen shot below:
I want to take the background image field and get the src value from it and then set my div's background to this value.
Any idea's how this could/should be done?
Regards,
Comic Coder
EDIT:
I noticed something funny that you may be able to help me understand what is happening.
When I use the following in my XSLT file:
<img src="{sc:fld('background',.,'src')}" alt="{sc:fld('background',.,'alt')}" />
And inspect the source code output i get the following rendered on the page.
<img src="" alt="go-ape-forest-banner-background" sc-part-of="placeholder rendering" class="scEnabledChrome">
I can see the src field is empty and this is a problem. This is the method that is provided by sitecore at the following link on the sitecore SDN
Assessing Field Values in Sitecore
When I use:
<img src="{sc:field('background',.,'src')}" alt="{sc:fld('background',.,'alt')}" />
Notice the fld on the src field has changed to field now and i get the following when i inspect the source.
<img src="<input id='fld_B9ACE161A86D474390C7DA8308D79278_4C5D9258F7CF44B8A073A078CAEC08B0_en_1_00a4e02d3315484a8da1a756f2ef2d69_6759' class='scFieldValue' name='fld_B9ACE161A86D474390C7DA8308D79278_4C5D9258F7CF44B8A073A078CAEC08B0_en_1_00a4e02d3315484a8da1a756f2ef2d69_6759' type='hidden' value="<image mediapath="" alt="go-ape-forest-banner-background" width="600" height="108" hspace="2" vspace="2" showineditor="" usethumbnail="" src="" mediaid="{EE47E80F-DE1E-4FDD-B5D8-ACA473B52A9C}" />" /><code id="fld_B9ACE161A86D474390C7DA8308D79278_4C5D9258F7CF44B8A073A078CAEC08B0_en_1_00a4e02d3315484a8da1a756f2ef2d69_6759_edit" sc_parameters="format" type="text/sitecore" chromeType="field" scFieldType="image" class="scpm" kind="open">{"commands":[{"click":"chrome:field:editcontrol({command:\"webedit:chooseimage\"})","header":"Choose Image","icon":"/sitecore/shell/themes/standard/custom/16x16/photo_landscape2.png","disabledIcon":"/temp/photo_landscape2_disabled16x16.png","isDivider":false,"tooltip":"Choose an image.","type":""},{"click":"chrome:field:editcontrol({command:\"webedit:editimage\"})","header":"Properties","icon":"/sitecore/shell/themes/standard/custom/16x16/photo_landscape2_edit.png","disabledIcon":"/temp/photo_landscape2_edit_disabled16x16.png","isDivider":false,"tooltip":"Modify image appearance.","type":""},{"click":"chrome:field:editcontrol({command:\"webedit:clearimage\"})","header":"Clear","icon":"/sitecore/shell/themes/standard/custom/16x16/photo_landscape2_delete.png","disabledIcon":"/temp/photo_landscape2_delete_disabled16x16.png","isDivider":false,"tooltip":"Remove the image.","type":""},{"click":"chrome:common:edititem({command:\"webedit:open\"})","header":"Edit the related item","icon":"/temp/iconcache/office/16x16/cubes.png","disabledIcon":"/temp/cubes_disabled16x16.png","isDivider":false,"tooltip":"Edit the related item in the Content Editor.","type":"common"},{"click":"chrome:rendering:personalize({command:\"webedit:personalize\"})","header":"Personalize","icon":"/temp/iconcache/office/16x16/users_family.png","disabledIcon":"/temp/users_family_disabled16x16.png","isDivider":false,"tooltip":"Create or edit personalization for this component.","type":"sticky"},{"click":"chrome:rendering:editvariations({command:\"webedit:editvariations\"})","header":"Edit variations","icon":"/temp/iconcache/office/16x16/windows.png","disabledIcon":"/temp/windows_disabled16x16.png","isDivider":false,"tooltip":"Edit the variations.","type":"sticky"}],"contextItemUri":"sitecore://master/{B9ACE161-A86D-4743-90C7-DA8308D79278}?lang=en&ver=1","custom":{},"displayName":"Background","expandedDisplayName":null}</code><img src="/sitecore/shell/-/media/Images/go-ape-forest-banner-background.ashx?h=108&la=en&w=600&hash=B3D30A69E02A5C0AC47D2475FF85DFA166768C40" hspace="2" vspace="2" alt="go-ape-forest-banner-background" width="600" height="108" /><code class="scpm" type="text/sitecore" chromeType="field" kind="close"></code>" alt="go-ape-forest-banner-background" sc-part-of="placeholder rendering" class="scEnabledChrome">
I have also asked a question that is relevant to this problem regarding the use of the XSLHelper.fld method which is not working as expected. You can see the question here:
Sitecore XSLHelper.fld Method not working as expected
Before I answer, I have to say that I would highly recommend that you stop using XSLT. Future maintainers of your code (including yourself) will thank you if you move to MVC. If you want to avoid the need to compile, you can use View renderings.
The following code was adapted from the old presentation component reference doc for Sitecore 6. I haven't tested it on 8 as I have no desire to touch XSLT again, but I think it should still work.
<xsl:variable name="mediaid" select="sc:fld('Background',$sc_currentitem,'mediaid')" />
<xsl:if test="$mediaid">
<xsl:variable name="mediaitem" select="sc:item($mediaid,.)" />
<xsl:if test="$mediaitem">
<div style="background:url({sc:GetMediaUrl($mediaitem)}); background-repeat:no-repeat; background-size:100% 100%; height:200px; border-radius: 25px; border: 2px solid black; padding-left: 20px;padding-right: 20px;">
</xsl:if>
</xsl:if>
Update in response to additional info
The article you linked to is out-of-date. There is no longer a src attribute in image fields. If you just select an image you will see something like this if you view the raw value of the field:
<image mediaid="{094AED03-02E7-4868-80CB-19926661FB77}" />
If you modify the properties of the image (e.g. set the alt text or dimensions) you will see something like this:
<image mediaid="{094AED03-02E7-4868-80CB-19926661FB77}" alt="alt text" height="" width="150" hspace="" vspace="" />
To get the URL, you need to use the mediaid property like I showed above.
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.
I was wondering if I could get some help with implementing a tool-tip for every single star in the ratings, using Primefaces. As of now, I have the tool-tip applying to the entire rating block, so all 5 stars have the same tool-tip in essence. Would anyone know of an elegant way to apply a different tool-tip to each star? Some of the people I work with have suggested using onHover() like states to do it if all else fails (in a rather brute forceish kind of way), but if possible, I'd like to do it with more elegance.
Here is the current code, which has a single tool-tip that pops up when any of the stars are hovered over.
<h:outputLabel for="developerScore">Developer Score:</h:outputLabel>
<p:rating value="#{scoreCard.developerScore}" stars="#{uiSettingsBean.ratingMax}" cancel="false" readonly="#{otherReadOnly}" id="developerScore">
<p:tooltip for="developerScore" showEffect="fade" hideEffect="fade" >
<h:outputText value="Developer Score Rubric"/><br />
<h:outputText value="1 Star: Abysmal"/><br />
<h:outputText value="2 Star: Needs Improvement"/><br />
<h:outputText value="3 Star: Doing Good"/><br />
<h:outputText value="4 Star: Above Average"/><br />
<h:outputText value="5 Star: Exceptional"/>
</p:tooltip>
</p:rating>
Anywho, any help is appreciated and thank you for your time.
I too had similar requirement and I landed to this SO and I was surprised to see that there is no accepted answer even after 3 years!
Primefaces(version 6.0) still does not have this feature. I hope it will be added in the next releases.
After doing a good bit of search, I Finally ended up creating a custom composite component.
Here is the solution/workaround that I have. It is elegant or not, I leave it to you :).
By the way, this works in JSF 2.2. For older version of JSF, you may have to add few more files for composite components to work.(taglibs etc).
First, we have to create our own composite component for rating (Don't worry, its just two files). It is nothing but the p:rating and p:tooltip combined together. Following are the two files:
ratingComposite.xhtml
ratingComposite.js
Add both the files to JSF resources folder of your project.
(Note: customizedprimefaces is your resource library name)
<YourWarFile>\resources\customizedprimefaces\ratingComposite.xhtml
<YourWarFile>\resources\js\ratingComposite.js
(If you are not familiar with composite components and their paths then I suggest to study it first, it is made easy in JSF 2.2.)
And start using it in your page.
myPage.xhtml
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"*
xmlns:cp="http://java.sun.com/jsf/composite/customizedprimefaces"
>
...
<cp:ratingComposite id="ratingId" widgetVar="ratingIdWgt"
stars="4"
value="#{bean.rating}"
tooltipValue="Ugly | Bad | OK | Good"
/>
(Note the xmlns include: xmlns:cp="http://java.sun.com/jsf/composite/customizedprimefaces")
This is same as the p:rating component with only difference is tooltipValue attribute that accepts a pipe separated tool tip messages in the order corresponding to the stars in rating.
Here is the rough explanation of what is going on in javascript file:
Split the p:tooltip elements value by pipe(|) and save in an
array(tooltipTxt), that holds pipe separated tooltips for each
<cp:ratingComposite/> in page. The array is indexed by the rating component id.
Bind a custom hoverIn and hoverOut event handler for each star in
your rating component.
On hoverIn, get the message from array(tooltipTxt) (at index corresponding to the currently hovered star) and replace with the <p:tooltip>
message.
Display the <p:tooltip> message at the position of the currently hovered star.
On hoverOut, Just hide the <p:tooltip> message.
ratingComposite.xhtml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:composite="http://java.sun.com/jsf/composite">
<composite:interface>
<composite:attribute name="id" />
<composite:attribute name="value" />
<composite:attribute name="readonly" />
<composite:attribute name="widgetVar" />
<composite:attribute name="stars" type="java.lang.Integer" />
<composite:attribute name="tooltipValue"
shortDescription="A pipe(ie.:|) seperated list of tooltip messages. \nEach message in list corresponds to a star in the rating componant." />
<!-- Add other attributes of p:rating component here. -->
</composite:interface>
<composite:implementation>
<h:outputScript name="js/ratingComposite.js" target="head" />
<script type="text/javascript">
<!--
$(document).ready(function(){
rating.init('#{cc.namingContainer.clientId}:_#{cc.attrs.id}', '#{cc.namingContainer.clientId}:_#{cc.attrs.id}-ttId');
});
//-->
</script>
<p:rating id="_#{cc.attrs.id}" widgetVar="#{cc.attrs.widgetVar}"
readonly="#{cc.attrs.readonly}"
value="#{cc.attrs.value}" stars="#{cc.attrs.stars}" />
<p:tooltip id="_#{cc.attrs.id}-ttId" for="_#{cc.attrs.id}" trackMouse="true"
value="#{cc.attrs.tooltipValue}" />
</composite:implementation>
</html>
ratingComposite.js
rating = {
tooltipTxt:{},
init:function(ratingId, tooltipId){
var ratingIdjq = PrimeFaces.escapeClientId(ratingId);
var tooltipIdjq = PrimeFaces.escapeClientId(tooltipId);
var _self = this;
this.tooltipTxt[tooltipId] = $(tooltipIdjq).find(".ui-tooltip-text").html(),
$(ratingIdjq).find(".ui-rating-star").each(function(){
$(this).hover(function(event){return _self.hoverIn(event,tooltipId)},
function(event){$(tooltipIdjq).hide();} //This is on Hoverout
);
});
},
hoverIn:function(event, tooltipId){
var tooltipIdjq = PrimeFaces.escapeClientId(tooltipId);
var ratingArray = this.tooltipTxt[tooltipId].split("|");
var tooptipDiv = $(tooltipIdjq);
tooptipDiv.show();
this.setCoordinate(tooptipDiv, event.pageX, event.pageY);
var currEleIndx = $(event.currentTarget).parent().find(".ui-rating-star").index(event.currentTarget);
var currTooltip = ratingArray[currEleIndx].trim();
tooptipDiv.find(".ui-tooltip-text").html(currTooltip);
},
setCoordinate:function(tooptipDiv, x, y){
var pos = {"left":x, "top":y};
tooptipDiv.offset(pos);
}
}
I hope this helps.
use <h:outputText value="1 Star:Abysmal:" title="1 Star: Abysmal"/>
I'm trying to use the PasswordRecovery of ASP.NET.
Everything works fine, however I am using Email template. Within this email I'm trying to insert an image as follows:
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<img alt="blabla" src="/Images/blabla-logo.png" align="middle"/><br/><br/>
bla bla:<%Password%><br /><br />
</body>
</html>
As I said, the email is being sent fine but the image is not inserted. I tried: src="~/Images/blabla-logo.png", but with no success.
Idea anyone?
Thanks a lot,
Assaf.
For email you should not give relative path like "/Images/blabla-logo.png" the only works for the internal website pages, instead of this you should give the complete path like
http://youserver/youapp/Images/blabla-logo.png
I will suggest you not to include image using the path instead of this try embedding the image in your email. You can achieve this by converting your images to base64 string and set the base64 string as the source of the image.
You can use OnSendingMail event to modify your email message. Let's assume your template look like this:
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<img alt="blabla" src="{0}" align="middle"/><br/><br/>
bla bla:<%Password%><br /><br />
</body>
</html>
You PasswordRecovery markup should look like this:
<asp:PasswordRecovery ID="prPasswordRecovery" runat="server" OnSendingMail="prPasswordRecovery_SendingMail">
<MailDefinition BodyFileName="~/passwordRecoveryEmailTemplate.txt" IsBodyHtml="true" Priority="High" Subject="bla bla"/>
</asp:PasswordRecovery>
Last thing to do is to write prPasswordRecovery_SendingMail method in code behind:
protected void prPasswordRecovery_SendingMail(object sender, MailMessageEventArgs e)
{
e.Message.Body = String.Format(e.Message.Body, ResolveClientUrl("~/Images/blabla-logo.png"));
}
That should do it.
try adding a tilde "~", an id and runat="server". The tilde only gets changed to the root path when runat="server" is applied. Otherwise, the serverside code has no knowledge of the control and doesn't parse it and apply the path insertion
<img alt="blabla" src="~/Images/blabla-logo.png"
align="middle" id="img" runat="server"/>
Have you tried using AlternateView?
One example is here.
I have a standard aspx page with which I need to add another standard HTML form into and have it submit to another location (external site), however whenever I press the submit button the page seems to do a post back rather than using the sub-forms action url.
A mock up of what the form relationships is below. Note in the real deployment the form will be part of a content area of a master page layout, so the form needs to submit independantly from the master page form.
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<form id="subscribe_form" method="post" action="https://someothersite.com" name="em_subscribe_form" >
<input type="text" id="field1" name="field1" />
<input id="submitsubform" type="submit" value="Submit" />
</form>
</div>
</form>
</body>
</html>
It's an interesting problem. Ideally you only want the 1 form tag on the page as other users have mentioned. Potentially you could post the data via javascript without having 2 form tags.
Example taken from here, modified for your needs. Not 100% sure if this will work for you but I think this is how you'll have to approach it.
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
function postdata()
{
var fieldValue = document.getElementById("field1").value;
postwith("http://someothersite.com",{field1:fieldValue});
}
function postwith (to,p) {
var myForm = document.createElement("form");
myForm.method="post" ;
myForm.action = to ;
for (var k in p) {
var myInput = document.createElement("input") ;
myInput.setAttribute("name", k) ;
myInput.setAttribute("value", p[k]);
myForm.appendChild(myInput) ;
}
document.body.appendChild(myForm) ;
myForm.submit() ;
document.body.removeChild(myForm) ;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<div>
<input type="text" id="field1" name="field1" />
<asp:Button ID="btnSubmitSubscribe" runat="server" Text="Submit" OnClientClick="postdata(); return false;" />
</div>
</div>
</form>
</body>
</html>
If javascript is not a viable option - you can use .Net's HttpWebRequest object to create the post call in code behind. Would look something like this in the code behind (assuming your text field is an asp textbox:
private void OnSubscribeClick(object sender, System.EventArgs e)
{
string field1 = Field1.Text;
ASCIIEncoding encoding=new ASCIIEncoding();
string postData="field1="+field1 ;
byte[] data = encoding.GetBytes(postData);
// Prepare web request...
HttpWebRequest myRequest =
(HttpWebRequest)WebRequest.Create("http://someotherwebsite/");
myRequest.Method = "POST";
myRequest.ContentType="application/x-www-form-urlencoded";
myRequest.ContentLength = data.Length;
Stream newStream=myRequest.GetRequestStream();
// Send the data.
newStream.Write(data,0,data.Length);
newStream.Close();
}
If you add an ASP.NET button to the form, and set its PostBackUrl property to the external site, then all the form data will be posted to that URL.
There is a very nice tricky solution for this problem.
You can insert a </form> tag before your <form> to close the asp.net form which causes the problem. Do not forget to add a <form> tag after your html form. It may cause the editor to give you an exception, but do not worry, it will work.
Nested forms are not possible in HTML according to the W3C. You can achieve your intended result using JavaScript or with jQuery as explained by Peter on a blog called My Thoughts.
In my experience, Appetere Web Solutions has the best solution. Simple and elegant...and it's not a hack. Use the PostBackUrl.
I just tried it and everything works as expected. I didn't want to use Javascript because I didn't want to include it in my Master Page for every page that uses it.
I had the same situation as Ross - except that my input types were all of the "hidden" varitey.
Cowgod's answer got me thinking about nested forms within my .aspx page. I ended up "un-nesting" my 2nd form OUT of the main .aspx form ( ) and placed it (along with my js script tags) just under the body tag - but before the main .aspx form tag.
Suddenly, everything was submitting as it was supposed to. Is this a hack?
ASP.NET allows you to have multiple forms on one page, but only one can be runat=server. However I don't think you can nest forms at all.
You might have to make a new master page, one without a form tag on it so the form will work on that one page only. This is not a good solution, unless you can place the form outside the master pages' form, and use javascript to submit the second form, but that's hardly better. There really is no good solution for what you are trying to achieve, and if so I'd like to hear it. I don't think you can do a POST call from a code-behind, can you? I'm sure there's some way. But that's probably the only solution: from code.