if (!this.Page.IsClientScriptBlockRegistered("hideMessage"))
{ this.Page.RegisterStartupScript("hideMessage",
"<script>document.getElementById('" + pnlMessage.ClientID + "').style.display =
'none'</script>;"); }
To call a Web.Config appSettings entry from the ASP.NET XML Desinger (not the code behind) then,
call "<%$ appSettings:WEB_SERVICE_URL_SEARCH %>"
or
"<%$ connectionString:DATABASE_CONNECTION_STRING_NAME %>".
Examples <asp:Button ID="btnNewSearch" runat="server" OnClientClick="javascript:location.reload();" Text="New Search" /> or <input type="button" value="Reload Page" onClick="window.location.reload()"><input type="button" value="Reload Page" onClick="history.go(0)"><input type="button" value="Reload Page" onClick="window.location.href">
Examples
<asp:Button ID="btnNewSearch" runat="server" OnClientClick="javascript:location.reload();" Text="New Search" />
<input type="button" value="Reload Page" onClick="window.location.reload()"><input type="button" value="Reload Page" onClick="history.go(0)"><input type="button" value="Reload Page" onClick="window.location.href">
protected override void OnInit(EventArgs e)
{
btnSearch.Attributes.Add("onclick", "javascript:" + btnSearch.ClientID + ".disabled=true;"
+ this.Page.GetPostBackEventReference(btnSearch));
base.OnInit(e);
}
Disable ASP Button on Submit and capture the PostBack OnClick Event
public static T FindControl<T>(this Control control, string controlId) where T : Control
return (T)control.FindControl(controlId);
1) Insert your ConnectionString in a text file called Connection.config or any other name.
2) In your Web.Config file, reference the Connection.config file as below:
<connectionStrings configSource="Connection.config" />.
That's it.
1) char[] delimiterChars = { ':'}; string[] args = t.Split(delimiterChars);
2) string[] args = t.Split(new char[] {':'});