How to read web.config appsettings or connection strings from .aspx file
Web.Config:
<appSettings><
add key="appSettingsKey" value="Testing Input"/></appSettings>
<connectionStrings><
add name="con_string" connectionString="Data Source=TestServer;Initial Catalog=TestDB;Integrated Security=SSPI" providerName="System.Data.SqlClient"/></connectionStrings>
.aspx Page
<asp:TextBox ID="txtAppSetting" runat="server" Text="<%$appSettings:appSettingsKey %>"></asp:TextBox>
<asp:TextBox ID="txtConnectionString" runat="server" Text="<%$connectionStrings:con_string %>"></asp:TextBox>
by using <%$appSettings:appSettingsKey %> , we can read the app settings data of Web.Config
Solution for the QlikView, Biztalk, DotNet and MSBI real time development problems
Search This Blog
Subscribe to:
Post Comments (Atom)
Popular Posts
-
Applies To ASP.NET version 1.1 ASP.NET version 2.0 Summary This How To shows how you can help protect your ASP.NET applications from cr...
-
Use below code to raise messages from javascript and code behind. .ASPX <%@ Page Language="C#" AutoEventWireup="true...
-
function numbersonly(e) { var unicode = e.charCode ? e.charCode : e.keyCode if (unicode != 8) { //if the key isn't the backspace key (...
-
Difference between C# var and Javascript var C# var i = 10; // implicitly typed int i = 10; //explicitly typed //Initialization is man...
-
Use below javascript function to 1) validate the date difference in asp.net 2) difference (number of days, months, years) between two dat...
No comments:
Post a Comment