function pageLoad(sender, args) { if (args.get_isPartialLoad()) { alert(”Ajax call”); } else { alert(”PostBack or initial load”); } }
function pageLoad(sender, args) { if (args.get_isPartialLoad()) { alert(”Ajax call”); } else { alert(”PostBack or initial load”); } }
This plug-in formats and highlights code and also does the following:
I found that it is more flexible and readable for me to use the ToString formatting for dates
objDate.ToString("MM/dd/yyyy");
than to use this:
objDate.ToShortDateString()
Just an example from the original article, but it is self explanatory
<asp:DropDownList ID="ddlMimeType" runat="server">
<asp:ListItem Value="mp3">audio/mpeg</asp:ListItem>
<asp:ListItem Value="wma">audio/wma</asp:ListItem>
<asp:ListItem Value="other">Other</asp:ListItem>
</asp:DropDownList>
<asp:TextBox id="txbOtherMimetype" runat="server" />
<asp:RequiredFieldValidator id="valOtherMimetypeRequired" runat="server"
ControlToValidate="txbOtherMimetype" ForeColor="#990066"
ErrorMessage="You have to specify a custom mimetype." />
<script type="text/javascript">
$(document).ready(function()
{
$("#<%= ddlMimeType.ClientID %>").change(function()
{
toggleOtherMimeType(this);
});
}
function toggleOtherMimeType(elem)
{
if(elem!=undefined)
{
if(elem.value=="other")
{
$("#<%= txbEnclosureOtherMimetype.ClientID %>").show();
ValidatorEnable($("#<%= valEncOtherMimetypeRequired.ClientID %>")[0], true);
}
else
{
$("#<%= txbEnclosureOtherMimetype.ClientID %>").hide();
ValidatorEnable($("#<%= valEncOtherMimetypeRequired.ClientID %>")[0], false);
}
}
}
</script>
SELECT
GETDATE() AS DefaultFormat,
CONVERT(nvarchar(30), GETDATE(), 101) AS US,
CONVERT(nvarchar(30), GETDATE(), 103) AS UK,
CONVERT(nvarchar(30), GETDATE(), 111) AS Japan,
CONVERT(nvarchar(30), GETDATE(), 104) AS German,
CONVERT(nvarchar(30), GETDATE(), 112) AS ISO,
CONVERT(nvarchar(30), GETDATE(), 109) AS Date_with_Milliseconds
For this example I have 2 html pages:
Page1.html and Page2.html
If Page2 is shown as iframe inside Page1 and has this function:
<script type="text/javascript">
function showMessage(m) {
document.getElementById("message").innerHTML = m;
}
</script>
Than it can be called from Page1 like this:
<script type="text/javascript">
window.onload = function() {
window.frames[0].showMessage("Hello from Main Page in iFrame");
};
</script>