I'm creating a custom user control to render a form for sending emails from a Umbraco site. Everything seems to be working fine. But one issue is currently driving me up the wall...
When the page renders, the <input>
button doesn't show any text.
The code from the .ascx file responsible for rendering the <input>
can be seen below:
<asp:Button ID="btnSubmit" runat="server" onclick="BtnSubmitClick" CssClass="full-width" />
<script runat="server">
private void Page_Load()
{
btnSubmit.Attributes.Add("value", StringSendText);
}
</script>
And the code behind (.ascx.cs):
public string StringSendText
{
get { return umbraco.library.GetDictionaryItem("[Master]Contact-Form-Send"); }
}
I know that the StringSendText returns the text for the input, but no matter what I do, the value attrubute shows up empty. And when I instead insert the StringSendText into the text=""
attribute of the , I can see the text string showing in the source, but nothing shows on the button.
I have tried to disable both javascript and css files, but it gives me the exact same result. The text on the button is only showing when manipulating the source (from Firebug or Chrome) and adding the value="Send"
attribute manually.
It doesn't even show up when adding the text as fixed strings:
btnSubmit.Attributes.Add("value", "Text 1");
btnSubmit.Attributes.Add("text", "Text 2");
When looking at the source, the value attribute shows as value
only, whereas I can see the attribute text="Text 2"
just fine in the source - but still, no text for the is shown.
Guess I'm missing something very trivial here, but I can't seem to find the logic :/
Thank you for your time!