This is my technical area for troubleshooting and learning new programming skills and much more. Here, you will find answers on a wide range of technologies such as AI, Machine Learning, OpenAI, Databricks, ASP.NET, C#, Python, Microsoft Access, MySQL, Amazon Web Services, SQL Server, PL/SQL, JD Edwards, SAS, Salesforce, APIs, MVC, and many others. Please feel free to visit and join the discussion!
Thursday, July 30, 2009
Url Rebasing in ASP.NET 2.0
Url Rebasing in ASP.NET 2.0: ASP Alliance: "Url Rebasing"
Let’s say we have an image control with relative path on the masterpage html, and Masterpage is in one folder and the content page is in different folder. The relative image path given in the masterpage html markup points to the wrong location and the image is not rendered. To avoid these sorts of problems Asp.Net rebases relative urls known as Url Rebasing.
Let’s say we have an image control with relative path on the masterpage html, and Masterpage is in one folder and the content page is in different folder. The relative image path given in the masterpage html markup points to the wrong location and the image is not rendered. To avoid these sorts of problems Asp.Net rebases relative urls known as Url Rebasing.
Wednesday, July 29, 2009
Google Toolbar disable most visited websites
Web-browsing tools : Google new tab page and most visited websites - Toolbar Help: "Enable or disable the Google new tab page
Click the Toolbar's wrench icon.
On the Search tab, select (or deselect) the 'Enable the Google new tab page' checkbox.
Click Save."
Click the Toolbar's wrench icon.
On the Search tab, select (or deselect) the 'Enable the Google new tab page' checkbox.
Click Save."
Tuesday, July 28, 2009
Thursday, July 23, 2009
Rss Feed to Listview with DataPager in Asp.net
Displaying Rss Feed in Listview also using DataPager in Asp.net sample.
<%
@ Page Language="C#" AutoEventWireup="true" CodeFile="feedtolistview.aspx.cs" Inherits="feedtolistview" %> <!
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"><
head id="Head1" runat="server"> <title>Using DataPager and ListView Controls with a Custom Data Source</title></
head><
body> <form id="form1" runat="server"> <div> <asp:DataPager ID="dataPager" runat="server" PagedControlID="listItems" QueryStringField="page" PageSize="5" > <Fields> <asp:NextPreviousPagerField FirstPageText="<<" ShowFirstPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" /> <asp:NumericPagerField /> <asp:NextPreviousPagerField LastPageText=">>" ShowLastPageButton="True" ShowNextPageButton="False" ShowPreviousPageButton="False" /> </Fields> </asp:DataPager> <br /> <asp:ListView ID="listItems" runat="server" DataSourceID="xmlDataSource"> <LayoutTemplate> <asp:PlaceHolder runat="server" ID="itemPlaceholder" /> </LayoutTemplate> <ItemTemplate> <h3><a href="<%# XPath("link") %>"><%# XPath("title") %></h3> </a><%
# XPath("description")%> </ItemTemplate> <ItemSeparatorTemplate> <hr /> </ItemSeparatorTemplate> </asp:ListView> <asp:XmlDataSource ID="xmlDataSource" runat="server" DataFile="http://rss.news.yahoo.com/rss/topstories" XPath="rss/channel/item"></asp:XmlDataSource> <asp:DataPager ID="dataPager1" runat="server" PagedControlID="listItems" QueryStringField="page" PageSize="5"> <Fields> <asp:NumericPagerField /> </Fields> </asp:DataPager> </div> </form></
body></
html>Wednesday, July 22, 2009
Friday, July 17, 2009
Thursday, July 16, 2009
Connection string based on the Database Environment c#
Connection string based on the Database Environment c# sample:
<%
@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><
html xmlns="http://www.w3.org/1999/xhtml"><
head runat="server"> <title>Untitled Page</title></
head><
body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <div> <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1"> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ProviderName="System.Data.SqlClient" DataSourceMode="DataReader" SelectCommand="SELECT * FROM [mntsold]"></asp:SqlDataSource> </div> </form></
body></
html> using
System;using
System.Data;using
System.Configuration;using
System.Web;using
System.Web.Security;using
System.Web.UI;using
System.Web.UI.WebControls;using
System.Web.UI.WebControls.WebParts;using
System.Web.UI.HtmlControls;public
partial class _Default : System.Web.UI.Page{
protected void Page_Load(object sender, EventArgs e){
if (System.Environment.GetEnvironmentVariable("COMPUTERNAME").ToString() == "xxxxxxx"){
Response.Write(
"from test database");SqlDataSource1.ConnectionString =
ConfigurationManager.ConnectionStrings["JDE_RKConnectionString"].ConnectionString;}
if (System.Environment.GetEnvironmentVariable("COMPUTERNAME").ToString() == "ITWEB1223"){
Response.Write(
"from production database");SqlDataSource1.ConnectionString =
ConfigurationManager.ConnectionStrings["JDE_PRODUCTIONConnectionString"].ConnectionString;}
}
}
SQLdatasource Connection String in code behind c#
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1"> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ProviderName="System.Data.SqlClient" DataSourceMode="DataReader" SelectCommand="SELECT * FROM [mntsold]"></asp:SqlDataSource>
code behind:
SqlDataSource1.ConnectionString =
ConfigurationManager.ConnectionStrings["JDE_PRODUCTIONConnectionString"].ConnectionString;web.config
<
connectionStrings><
add name="JDE_PRODUCTIONConnectionString" connectionString="Data Source=ENTERPRISE;Initial Catalog=JDE_PRODUCTION;User ID=sssss;password=sssss" providerName="System.Data.SqlClient" /> </connectionStrings>Machine Name in code behind C#
string name = System.Environment.GetEnvironmentVariable("COMPUTERNAME");
Subscribe to:
Posts (Atom)