<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>aspnet &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://wordpress.com/tag/aspnet/</link>
	<description>Feed of posts on WordPress.com tagged "aspnet"</description>
	<pubDate>Wed, 09 Jul 2008 06:44:02 +0000</pubDate>

	<generator>http://wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Encypting query string in asp.net]]></title>
<link>http://adnanrashid.wordpress.com/?p=10</link>
<pubDate>Tue, 08 Jul 2008 21:06:23 +0000</pubDate>
<dc:creator>adnanrashid</dc:creator>
<guid>http://adnanrashid.wordpress.com/?p=10</guid>
<description><![CDATA[When you pass information from one page to another, you are passing information that anybody can sni]]></description>
<content:encoded><![CDATA[<p>When you pass information from one page to another, you are passing information that anybody can sniff. For example consider a scenario, in which you pass the customer id as a query string:</p>
<p>http://www.yourapplication.com?customer_id=15</p>
<p>Now if somebody replaced 15 with say 10 or any other number, they can pull up other customer information. And thats a bad for security.</p>
<p>One solution to this problem is to use ecryption using a secret key. So lets use a hard-to-crack 8 byte key like <strong>$zm0!qp?</strong></p>
<p>To accomplish this heres a code snippet</p>
<p><em>using System;<br />
using System.IO;<br />
using System.Xml;<br />
using System.Text;<br />
using System.Security.Cryptography;</em></p>
<p><em>public class Encryption64<br />
{<br />
private byte[] key = {};<br />
private byte[] IV = {18, 52, 86, 120, 144, 171, 205, 239};</em></p>
<p><em>public string Decrypt(string stringToDecrypt, string sEncryptionKey)<br />
{<br />
byte[] inputByteArray = new byte[stringToDecrypt.Length + 1];<br />
try {<br />
key = System.Text.Encoding.UTF8.GetBytes(sEncryptionKey, 8);<br />
DESCryptoServiceProvider des = new DESCryptoServiceProvider();<br />
inputByteArray = Convert.FromBase64String(stringToDecrypt);<br />
MemoryStream ms = new MemoryStream();<br />
CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(key, IV), CryptoStreamMode.Write);<br />
cs.Write(inputByteArray, 0, inputByteArray.Length);<br />
cs.FlushFinalBlock();<br />
System.Text.Encoding encoding = System.Text.Encoding.UTF8;<br />
return encoding.GetString(ms.ToArray());<br />
}<br />
catch (Exception e) {<br />
return e.Message;<br />
}<br />
}</em></p>
<p><em>public string Encrypt(string stringToEncrypt, string sEncryptionKey)<br />
{<br />
try {<br />
key = System.Text.Encoding.UTF8.GetBytes(sEncryptionKey, 8);<br />
DESCryptoServiceProvider des = new DESCryptoServiceProvider();<br />
byte[] inputByteArray = Encoding.UTF8.GetBytes(stringToEncrypt);<br />
MemoryStream ms = new MemoryStream();<br />
CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(key, IV), CryptoStreamMode.Write);<br />
cs.Write(inputByteArray, 0, inputByteArray.Length);<br />
cs.FlushFinalBlock();<br />
return Convert.ToBase64String(ms.ToArray());<br />
}<br />
catch (Exception e) {<br />
return e.Message;<br />
}<br />
}<br />
}<br />
</em></p>
<p>The end user will get to see a random text in the query string, something like</p>
<p>http://www.yourapplication.com/Receive.aspx?key=a2f5ckj?h79#8dd3</p>
<p>Remember stay secure stay safe.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Are you making these 3 common ASP.NET AJAX mistakes?]]></title>
<link>http://jwalin.wordpress.com/?p=26</link>
<pubDate>Tue, 08 Jul 2008 17:35:04 +0000</pubDate>
<dc:creator>jwalin</dc:creator>
<guid>http://jwalin.wordpress.com/?p=26</guid>
<description><![CDATA[http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/
]]></description>
<content:encoded><![CDATA[<p><a href="http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/">http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[How To Define Mozilla Specific CSS]]></title>
<link>http://avaricesoft.wordpress.com/?p=9</link>
<pubDate>Tue, 08 Jul 2008 16:16:40 +0000</pubDate>
<dc:creator>avaricesoft</dc:creator>
<guid>http://avaricesoft.wordpress.com/?p=9</guid>
<description><![CDATA[Today I found a great approach for defining Mozilla specific styles without using Mozilla CSS extent]]></description>
<content:encoded><![CDATA[<p>Today I found a great approach for defining Mozilla specific styles without using <a href="http://www.aspnettricks.com/archives/mozilla-css-extentions/">Mozilla CSS extentions</a>. The only thing needed is to put all Mozilla specific CSS definitions in a “@-moz-document” block and specify the url, url-prefix or domain to which pages the styles have to be applied:</p>
<pre>@-moz-document url(http://www.w3.org/),
               url-prefix(http://www.w3.org/Style/),
               domain(mozilla.org)
{
  /* CSS rules here apply to:
     + The page "http://www.w3.org/".
     + Any page whose URL begins with "http://www.w3.org/Style/"
     + Any page whose URL's host is "mozilla.org" or ends with
       ".mozilla.org"
   */

  body { ... }
}</pre>
<p><strong>Browser compatibility</strong><br />
Available since Mozilla 1.8 / Firefox 1.5.</p>
<p>You can read more about this on <a href="http://developer.mozilla.org/en/docs/CSS:@-moz-document" target="_blank">Mozilla developer center website</a>.</p>
<p>Now go and learn more about <a href="http://www.aspnettricks.com/archives/mozilla-css-extentions/">Mozilla CSS extentions</a>.</p>
<p><em>regards,</em></p>
<p><em><a title="Implementation of new and emerging technologies" href="http://www.avaricesoft.com" target="_blank">www.avaricesoft.com</a></em></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Gaia Ajax Widgets]]></title>
<link>http://avaricesoft.wordpress.com/?p=8</link>
<pubDate>Tue, 08 Jul 2008 16:13:07 +0000</pubDate>
<dc:creator>avaricesoft</dc:creator>
<guid>http://avaricesoft.wordpress.com/?p=8</guid>
<description><![CDATA[Gaia Ajax Widgets is another framework (except ASP.NET AJAX extensions framework) built on top of th]]></description>
<content:encoded><![CDATA[<p><a href="http://ajaxwidgets.com/more/about_gaia_ajax_framework.aa" target="_blank">Gaia Ajax Widgets</a> is another framework (except <a href="http://www.aspnettricks.com/archives/aspnet-20-ajax-extensions-10-released/">ASP.NET AJAX extensions framework</a>) built on top of the native <a href="http://www.squidoo.com/asp-dot-net/">ASP.NET</a> server controls.</p>
<p>Pros:</p>
<ul>
<li>Easy to use</li>
<li>Easy to extend</li>
<li>Lightweighted</li>
<li>No JavaScript required - you don’t have to write JavaScript at all</li>
<li>Gaia is FREE</li>
</ul>
<p><a href="http://ajaxwidgets.com/AllControlsSamples/" target="_blank">Samples</a><br />
<a href="http://ajaxwidgets.com/more/download.aa">Download</a></p>
<p><em>regards,</em></p>
<p><em><a title="Implementation of new and emerging technologies" href="http://www.avaricesoft.com" target="_blank">www.avaricesoft.com</a></em></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Hide div and the white space it occupies]]></title>
<link>http://avaricesoft.wordpress.com/?p=7</link>
<pubDate>Tue, 08 Jul 2008 16:07:54 +0000</pubDate>
<dc:creator>avaricesoft</dc:creator>
<guid>http://avaricesoft.wordpress.com/?p=7</guid>
<description><![CDATA[Problem
Most of the developers will say “I can use javascript and CSS ‘visibility’ property to]]></description>
<content:encoded><![CDATA[<p><strong>Problem</strong><br />
Most of the developers will say “I can use javascript and CSS ‘visibility’ property to do that”, but shortly after that they’ll realize that this is not enough. This solution will hide the div tag content, but the space it occupies will stay.</p>
<p>You can reproduce this behavior using the code below:</p>
<h3 style="text-align:center;">if (objDiv.style.visibility == 'visible' &#124;&#124;<br />
objDiv.style.visibility == '')<br />
{<br />
objDiv.style.visibility = 'hidden';<br />
}<br />
else<br />
{<br />
objDiv.style.visibility = 'visible';<br />
}</h3>
<p>where objDiv is the div object which you’re trying to hide.</p>
<p><strong>Solution</strong></p>
<p>It’s simple - initialize “display” property in addition. So the above code will look like:</p>
<h3 style="text-align:center;">if (objDiv.style.visibility == 'visible' &#124;&#124;<br />
objDiv.style.visibility == '')<br />
{<br />
objDiv.style.visibility = 'hidden';<br />
objDiv.style.display = 'none';<br />
}<br />
else<br />
{<br />
objDiv.style.visibility = 'visible';<br />
objDiv.style.display = 'block';<br />
}</h3>
<p style="text-align:left;"><em>regards,</em></p>
<p style="text-align:left;">www.avaricesoft.com</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Operator ===]]></title>
<link>http://avaricesoft.wordpress.com/?p=6</link>
<pubDate>Tue, 08 Jul 2008 16:04:46 +0000</pubDate>
<dc:creator>avaricesoft</dc:creator>
<guid>http://avaricesoft.wordpress.com/?p=6</guid>
<description><![CDATA[Have you ever used the strict equal operator? I learned about it few days ago…
Below is a quick ex]]></description>
<content:encoded><![CDATA[<p>Have you ever used the strict equal operator? I learned about it few days ago…<br />
Below is a quick explanation of its behavior:</p>
<p>“The strict equal to operator returns true if both operands are equal (and of the same type). It doesn’t perform any data type conversion, so an expression like 1 === true returns false and 1 === “1″ also returns false, because this operator checks for the type of the operands. 1 is a numerical value and “1″ is a string value; their types are different.”</p>
<p><em>regards,</em><br />
<em>www.avaricesoft.com</em></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Developer - On Contract]]></title>
<link>http://bharathcontractjobs1.wordpress.com/?p=4</link>
<pubDate>Tue, 08 Jul 2008 08:37:04 +0000</pubDate>
<dc:creator>singaporerentals1</dc:creator>
<guid>http://bharathcontractjobs1.wordpress.com/?p=4</guid>
<description><![CDATA[Developer - On Contract Required Skills: ASP and ASP.Net with SQL Server  Database: SQL Server 2000/]]></description>
<content:encoded><![CDATA[<p><strong><a href="http://www.bharathcontractjobs.com/job/1088/developer-on-contract-mumbai-accounting-finance.html">Developer - On Contract</a> </strong><span class="content">Required Skills: ASP and ASP.Net with SQL Server  Database: SQL Server 2000/5 Languages: ASP, ASP.Net 1.1/2, VB.Net Technologies: Active-X components, COM/DCOM    Minimum 3 to 4 years of experience in Microsoft technologies. </span></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Insert, Update, delete, paging in formview]]></title>
<link>http://sureshsharmaaspdotnet.wordpress.com/?p=130</link>
<pubDate>Tue, 08 Jul 2008 07:48:03 +0000</pubDate>
<dc:creator>Suresh</dc:creator>
<guid>http://sureshsharmaaspdotnet.wordpress.com/?p=130</guid>
<description><![CDATA[&lt;asp:FormView ID=&#8221;fv&#8221; runat=&#8221;server&#8221;  Height=&#8221;206px&#8221; Width=]]></description>
<content:encoded><![CDATA[<p>&#60;asp:FormView ID="fv" runat="server"  Height="206px" Width="347px" AllowPaging=true  OnModeChanging="ChangMode"  OnPageIndexChanging="pagechanged" OnItemDeleting="Delete" OnItemInserting="Insert" OnItemUpdating="Update"<br />
          CellPadding="4" ForeColor="#333333"  &#62;<br />
        &#60;FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /&#62;<br />
        &#60;RowStyle BackColor="#EFF3FB" /&#62;<br />
&#60;EditItemTemplate&#62;<br />
&#60;table style="width: 100%; height: 100%"&#62;<br />
&#60;tr&#62;<br />
&#60;td align="right" style="width: 100px"&#62;ID:&#60;/td&#62;<br />
&#60;td align="left" style="width: 100px"&#62;<br />
&#60;asp:Label ID="theIDLabel1" runat="server" Text='&#60;%# Eval("companyID") %&#62;'&#62;&#60;/asp:Label&#62;&#60;/td&#62;<br />
&#60;/tr&#62;<br />
&#60;tr&#62;<br />
&#60;td align="right" style="width: 100px"&#62;Name:&#60;/td&#62;<br />
&#60;td align="left" style="width: 100px"&#62;<br />
&#60;asp:TextBox ID="theNameTextBox" runat="server" Text='&#60;%# Bind("companyName") %&#62;'&#62;<br />
&#60;/asp:TextBox&#62;&#60;/td&#62;<br />
&#60;/tr&#62;<br />
&#60;tr&#62;<br />
&#60;td align="right" style="width: 100px"&#62;City:&#60;/td&#62;<br />
&#60;td align="left" style="width: 100px"&#62;<br />
&#60;asp:TextBox ID="theCityTextBox" runat="server" Text='&#60;%# Bind("companyCity") %&#62;'&#62;<br />
&#60;/asp:TextBox&#62;&#60;/td&#62;<br />
&#60;/tr&#62;<br />
&#60;tr&#62;<br />
&#60;td align="center" colspan="2"&#62;<br />
&#60;asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update"&#62;&#60;/asp:LinkButton&#62; - &#60;asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"&#62;&#60;/asp:LinkButton&#62;<br />
&#60;/td&#62;<br />
&#60;/tr&#62;<br />
&#60;/table&#62;<br />
&#60;br /&#62;<br />
 <br />
&#60;/EditItemTemplate&#62;<br />
&#60;InsertItemTemplate&#62;<br />
&#60;table style="width: 100%; height: 100%"&#62;<br />
 &#60;tr&#62;<br />
&#60;td align="right" style="width: 100px"&#62;Name:&#60;/td&#62;<br />
&#60;td align="left" style="width: 100px"&#62;<br />
&#60;asp:TextBox ID="theNameTextBox" runat="server" Text='&#60;%# Bind("companyName") %&#62;'&#62;&#60;/asp:TextBox&#62;<br />
&#60;/td&#62;<br />
&#60;/tr&#62;<br />
&#60;tr&#62;<br />
&#60;td align="right" style="width: 100px"&#62;City:&#60;/td&#62;<br />
&#60;td align="left" style="width: 100px"&#62;<br />
&#60;asp:TextBox ID="theCityTextBox" runat="server" Text='&#60;%# Bind("companyCity") %&#62;'&#62;&#60;/asp:TextBox&#62;<br />
&#60;/td&#62;<br />
&#60;/tr&#62;<br />
&#60;tr&#62;<br />
&#60;td align="center" colspan="2"&#62;<br />
&#60;asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert"&#62;&#60;/asp:LinkButton&#62; -<br />
&#60;asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"&#62;&#60;/asp:LinkButton&#62;<br />
&#60;/td&#62;<br />
&#60;/tr&#62;<br />
&#60;/table&#62;<br />
&#60;br /&#62; <br />
&#60;/InsertItemTemplate&#62;<br />
&#60;ItemTemplate&#62;Sample Database&#60;br /&#62;<br />
  <br />
&#60;table style="width: 150px; height: 150px"&#62;<br />
&#60;tr&#62;<br />
&#60;td align="right" style="width: 100px"&#62;ID:&#60;/td&#62;<br />
&#60;td align="left" style="width: 100px"&#62;<br />
&#60;asp:Label ID="theIDLabel" runat="server" Text='&#60;%# Eval("companyID") %&#62;'&#62;&#60;/asp:Label&#62;<br />
&#60;/td&#62;<br />
&#60;/tr&#62;<br />
&#60;tr&#62;<br />
&#60;td align="right" style="width: 100px"&#62;Name:&#60;/td&#62;<br />
&#60;td align="left" style="width: 100px"&#62;<br />
&#60;asp:Label ID="theNameLabel" runat="server" Text='&#60;%# Bind("companyName") %&#62;'&#62;&#60;/asp:Label&#62;<br />
&#60;/td&#62;<br />
&#60;/tr&#62;<br />
&#60;tr&#62;<br />
&#60;td align="right" style="width: 100px"&#62;City:&#60;/td&#62;<br />
&#60;td align="left" style="width: 100px"&#62;<br />
&#60;asp:Label ID="theCityLabel" runat="server" Text='&#60;%# Bind("companyCity") %&#62;'&#62;&#60;/asp:Label&#62;<br />
&#60;/td&#62;<br />
&#60;/tr&#62;<br />
&#60;tr&#62;<br />
&#60;td align="center" colspan="2"&#62;<br />
 <br />
&#60;asp:LinkButton ID="NewButton" runat="server" CausesValidation="False"  CommandName="New" Text="New"&#62;&#60;/asp:LinkButton&#62; -<br />
&#60;asp:LinkButton ID="EditButton" runat="server" CausesValidation="False" CommandName="Edit" Text="Edit"&#62;&#60;/asp:LinkButton&#62; -<br />
&#60;asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False" CommandName="Delete" Text="Delete"&#62;&#60;/asp:LinkButton&#62;<br />
&#60;/td&#62;<br />
&#60;/tr&#62;<br />
&#60;/table&#62;<br />
&#60;/ItemTemplate&#62;<br />
&#60;PagerTemplate&#62;<br />
Page :&#60;%=fv.PageIndex+1%&#62;<br />
&#60;asp:LinkButton ID="likp" runat=server CommandName="Page" CommandArgument="Prev" &#62;« Prev&#60;/asp:LinkButton&#62;<br />
&#60;asp:LinkButton ID="LinkButton1" runat=server CommandName="Page" CommandArgument="Next" &#62;Next »&#60;/asp:LinkButton&#62;</p>
<p>&#60;/PagerTemplate&#62;<br />
&#60;PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" /&#62;<br />
&#60;HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /&#62;<br />
&#60;EditRowStyle BackColor="#2461BF" /&#62;</p>
<p>&#60;/asp:FormView&#62;<br />
codebehind file///////////////</p>
<p>public partial class formvieweditupdate : System.Web.UI.Page<br />
{<br />
SqlConnection dbConn = null;<br />
SqlDataAdapter da = null;<br />
DataTable dTable = null;<br />
String strConnection = null;<br />
String strSQL = null;<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
if (!Page.IsPostBack)<br />
{<br />
bindData();<br />
}<br />
}<br />
private void bindData()<br />
{<br />
try<br />
{<br />
strConnection = ConfigurationManager.ConnectionStrings["rubruConnectionString"].ConnectionString;<br />
dbConn = new SqlConnection(strConnection);<br />
dbConn.Open();<br />
strSQL = "SELECT companyid, companyname,companycity  from companydetail order by companyname";<br />
da = new SqlDataAdapter(strSQL, dbConn);<br />
dTable = new DataTable();<br />
da.Fill(dTable);<br />
fv.DataSource = dTable;<br />
fv.DataBind();<br />
}<br />
finally<br />
{<br />
if (dbConn != null)<br />
{<br />
dbConn.Close();<br />
}<br />
}<br />
}</p>
<p>protected void Update(object sender, FormViewUpdateEventArgs e)<br />
{<br />
try<br />
{<br />
int cid = Convert.ToInt32((fv.Row.FindControl("theIDLabel1") as Label).Text);<br />
string cname = (fv.Row.FindControl("theNameTextBox") as TextBox).Text;<br />
string ccity = (fv.Row.FindControl("theCityTextBox") as TextBox).Text;<br />
strConnection = ConfigurationManager.ConnectionStrings["rubruConnectionString"].ConnectionString;<br />
dbConn = new SqlConnection(strConnection);<br />
dbConn.Open();<br />
SqlCommand   da = new SqlCommand( "Update companydetail set <a href="mailto:companyname=@comp,companycity=@comcity">companyname=@comp,companycity=@comcity</a> where <a href="mailto:companyid=@cid">companyid=@cid</a>", dbConn);<br />
da.Parameters.Add("@cid", SqlDbType.Int).Value = cid;<br />
da.Parameters.Add("@comp", SqlDbType.VarChar).Value = cname;<br />
da.Parameters.Add("@comcity", SqlDbType.VarChar).Value = ccity;<br />
da.ExecuteNonQuery();<br />
fv.ChangeMode(FormViewMode.ReadOnly);<br />
}</p>
<p>finally<br />
{<br />
if (dbConn != null)<br />
{<br />
dbConn.Close();<br />
bindData();<br />
}<br />
}</p>
<p>}<br />
protected void Insert(object sender, FormViewInsertEventArgs e)<br />
{<br />
try<br />
{</p>
<p>string cname = (fv.Row.FindControl("theNameTextBox") as TextBox).Text;<br />
string ccity = (fv.Row.FindControl("theCityTextBox") as TextBox).Text;<br />
strConnection = ConfigurationManager.ConnectionStrings["rubruConnectionString"].ConnectionString;<br />
dbConn = new SqlConnection(strConnection);<br />
dbConn.Open();<br />
SqlCommand da = new SqlCommand("insert into companydetail values(@comp,@add,@comcity)", dbConn);<br />
da.Parameters.Add("@add", SqlDbType.VarChar).Value ="";<br />
da.Parameters.Add("@comp", SqlDbType.VarChar).Value = cname;<br />
da.Parameters.Add("@comcity", SqlDbType.VarChar).Value = ccity;<br />
da.ExecuteNonQuery();<br />
fv.ChangeMode(FormViewMode.ReadOnly);<br />
}</p>
<p>finally<br />
{</p>
<p>if (dbConn != null)<br />
{<br />
dbConn.Close();<br />
bindData();<br />
}<br />
}</p>
<p>}<br />
protected void Delete(object sender, FormViewDeleteEventArgs e)<br />
{<br />
try<br />
{<br />
int cid = Convert.ToInt32((fv.Row.FindControl("theIDLabel") as Label).Text);<br />
strConnection = ConfigurationManager.ConnectionStrings["rubruConnectionString"].ConnectionString;<br />
dbConn = new SqlConnection(strConnection);<br />
dbConn.Open();<br />
SqlCommand da = new SqlCommand("delete from companydetail where <a href="mailto:companyid=@cid">companyid=@cid</a>", dbConn);<br />
da.Parameters.Add("@cid", SqlDbType.Int).Value = cid;<br />
da.ExecuteNonQuery();<br />
fv.ChangeMode(FormViewMode.ReadOnly);<br />
}</p>
<p>finally<br />
{</p>
<p>if (dbConn != null)<br />
{<br />
dbConn.Close();<br />
bindData();<br />
}<br />
}</p>
<p>}<br />
protected void ChangMode(object sender, FormViewModeEventArgs e)<br />
{<br />
if (e.NewMode.ToString() == "Edit")<br />
{<br />
fv.ChangeMode(e.NewMode);<br />
}<br />
else<br />
if (e.NewMode.ToString()=="Insert")<br />
{<br />
fv.ChangeMode(e.NewMode);<br />
}<br />
else<br />
fv.ChangeMode(e.NewMode);<br />
bindData();<br />
}</p>
<p>protected void pagechanged(object sender, FormViewPageEventArgs e)<br />
{<br />
fv.PageIndex = e.NewPageIndex;<br />
bindData();<br />
}<br />
}</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Debug Windows Mobile with webservices on localhost using Visual Studio Web Development Server and Fiddler]]></title>
<link>http://barelygenius.wordpress.com/?p=19</link>
<pubDate>Tue, 08 Jul 2008 02:53:28 +0000</pubDate>
<dc:creator>bradymoritz</dc:creator>
<guid>http://barelygenius.wordpress.com/?p=19</guid>
<description><![CDATA[This has frustrated me for a while, but seems I found a solution this evening.
I build a lot of Comp]]></description>
<content:encoded><![CDATA[<p>This has frustrated me for a while, but seems I found a solution this evening.<br />
I build a lot of Compact Framework apps which communicate via webservices with an asp.net webservice. During development, I prefer to use the built-in web development server instead of having to mess around with IIS etc. </p>
<p>The problem: the web dev server only allows connections from "localhost", which doesnt include your dev pda, assuming you are using activesync. Long story, but even though the pda can browse the web using your desktop's ip, it has it's own local ip which makes the dev web server think it is a remote connection. Thus is winds up blocked. </p>
<p>Solution seems to be, download this tool: www.fiddlertool.com<br />
Fiddler is a local proxy which is used for debugging http connections, and is normally used along with asp.net development. </p>
<p>You can disable the logging in fiddler so we're just using it as a local proxy. </p>
<p>On your windows mobile device, add an http proxy to the connection settings. Use port 8888 (the fiddler default), and use ppp_peer as the host name. Im told that windows mobile 5 and greater use dtpt_peer instead, but I havent tested this yet. </p>
<p>NOW: when you wish to connect to a locally hosted web app or web service from the pda, use this: </p>
<p>localhost.:1234/path.asmx</p>
<p>where 1234 is your port number and.. you get the idea. *But* notice the single "." after localhost. This is the magic that makes this work. How? Well, I've fought this battle long enough, discovering why is a luxury I don't have at the moment. </p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[LINQ set operations(extension methods) on arrays]]></title>
<link>http://dotnetstories.wordpress.com/?p=412</link>
<pubDate>Mon, 07 Jul 2008 15:23:14 +0000</pubDate>
<dc:creator>fofo</dc:creator>
<guid>http://dotnetstories.wordpress.com/?p=412</guid>
<description><![CDATA[In this post, which is another post for LINQ, I will try to explain how we can use LINQ set operat]]></description>
<content:encoded><![CDATA[<p>In this post, which is another post for LINQ, I will try to explain how we can use LINQ set operators on arrays.Basically set operators are extension methods that allows to filter,merge arrays.We are going to examine these methods in detail. We will examine them by creating a project in visual studio.</p>
<p>Basically we are going to use two arrays of strings,<em> countries</em> and <em>favcountries</em>.</p>
<p>1) Launch Visual studio 2008 and create an ASP.net web application in C# in your filesystem</p>
<p>2) In the page load event of the default.aspx type the following</p>
<h4> //create 2 string arrays<br />
 </h4>
<h4>string[] countries = { "Britain", "France", "Croatia", "Argentina", "Australia", "Mexico", "Finland", "Spain", "Italy", "Greece" };<br />
 </h4>
<h4>string[] favcountries={"Britain","Argentina","Greece","Brazil"};</h4>
<h4>//cocatenate the string arrays with the Concat method<br />
var thecountries = countries.Concat(favcountries);</h4>
<h4>foreach (var c in thecountries)<br />
             <br />
Response.Write(c);</h4>
<p>if you hit F5 and run your application you will all the countries listed in both arrays</p>
<p>3) If we need to get only the unique values from the arrays we must comment out this line in the code above</p>
<h4>var thecountries = countries.Concat(favcountries);</h4>
<p>and type this</p>
<h4> // only the unique countries appear with the union method<br />
  var thecountries = countries.Union(favcountries);</h4>
<p>if you hit F5 you will see in your browser the number of the countries in those lists without duplicate values.</p>
<p>you can achieve the exact same thing if you do not type the line above , but this one</p>
<h4>var thecountries = countries.Concat(favcountries).Distinct();</h4>
<p>4) If you want to see only the values that are in both arrays, comment out the following line</p>
<h4>var thecountries = countries.Union(favcountries);</h4>
<p>and type this new line that uses the <em>Intersect</em> method</p>
<h4> // countries that appear in both arrays<br />
            var thecountries = countries.Intersect(favcountries);</h4>
<p>If you run your application only the dublicate countries will appear.</p>
<p>5) If you want to get the items that appear in the first array but not in the second array(not common items in the arrays, all the items in the first array that do not match with anything from the second array), you comment out this line of code</p>
<h4>var thecountries = countries.Intersect(favcountries);</h4>
<p>and type this</p>
<h4>var thecountries = countries.Except(favcountries);</h4>
<p>All these extension methods  that enable us to filter, merge sequences live in the System.Collections.Generic namespace.</p>
<p style="text-align:left;"><a href="http://www.facebook.com/sharer.php?u=http://dotnetstories.wordpress.com/2008/07/07/linq-set-operationsextension-methods-on-arrays/" target="_blank"><img style="border:0;margin:0;padding:0;" src="http://getsocialserver.wordpress.com/files/2008/05/gsb201m05.png" alt="Add to Facebook" /></a><a href="http://www.newsvine.com/_wine/save?u=http%3A%2F%2Fdotnetstories.wordpress.com%2F2008%2F07%2F07%2Flinq-set-operationsextension-methods-on-arrays%2F&#38;h=LINQ%20set%20operations(extension%20methods)%20on%20arrays" target="_blank"><img style="border:0;margin:0;padding:0;" src="http://getsocialserver.wordpress.com/files/2008/05/gsb202m05.png" alt="Add to Newsvine" /></a><a href="http://digg.com/submit?phase=2&#38;url=http%3A%2F%2Fdotnetstories.wordpress.com%2F2008%2F07%2F07%2Flinq-set-operationsextension-methods-on-arrays%2F&#38;title=LINQ%20set%20operations(extension%20methods)%20on%20arrays" target="_blank"><img style="border:0;margin:0;padding:0;" src="http://getsocialserver.wordpress.com/files/2008/05/gsb203m05.png" alt="Add to Digg" /></a><a href="http://del.icio.us/post?url=http%3A%2F%2Fdotnetstories.wordpress.com%2F2008%2F07%2F07%2Flinq-set-operationsextension-methods-on-arrays%2F&#38;title=LINQ%20set%20operations(extension%20methods)%20on%20arrays" target="_blank"><img style="border:0;margin:0;padding:0;" src="http://getsocialserver.wordpress.com/files/2008/05/gsb204m05.png" alt="Add to Del.icio.us" /></a><a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fdotnetstories.wordpress.com%2F2008%2F07%2F07%2Flinq-set-operationsextension-methods-on-arrays%2F&#38;title=LINQ%20set%20operations(extension%20methods)%20on%20arrays" target="_blank"><img style="border:0;margin:0;padding:0;" src="http://getsocialserver.wordpress.com/files/2008/05/gsb205m05.png" alt="Add to Stumbleupon" /></a><a href="http://reddit.com/submit?url=http%3A%2F%2Fdotnetstories.wordpress.com%2F2008%2F07%2F07%2Flinq-set-operationsextension-methods-on-arrays%2F&#38;title=LINQ%20set%20operations(extension%20methods)%20on%20arrays" target="_blank"><img style="border:0;margin:0;padding:0;" src="http://getsocialserver.wordpress.com/files/2008/05/gsb206m05.png" alt="Add to Reddit" /></a><a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&#38;Description=&#38;Url=http%3A%2F%2Fdotnetstories.wordpress.com%2F2008%2F07%2F07%2Flinq-set-operationsextension-methods-on-arrays%2F&#38;Title=LINQ%20set%20operations(extension%20methods)%20on%20arrays" target="_blank"><img style="border:0;margin:0;padding:0;" src="http://getsocialserver.wordpress.com/files/2008/05/gsb207m05.png" alt="Add to Blinklist" /></a><a href="http://ma.gnolia.com/bookmarklet/add?url=http%3A%2F%2Fdotnetstories.wordpress.com%2F2008%2F07%2F07%2Flinq-set-operationsextension-methods-on-arrays%2F&#38;title=LINQ%20set%20operations(extension%20methods)%20on%20arrays" target="_blank"><img style="border:0;margin:0;padding:0;" src="http://getsocialserver.wordpress.com/files/2008/05/gsb208m05.png" alt="Add to Ma.gnolia" /></a><a href="http://www.technorati.com/faves?add=http%3A%2F%2Fdotnetstories.wordpress.com%2F2008%2F07%2F07%2Flinq-set-operationsextension-methods-on-arrays%2F" target="_blank"><img style="border:0;margin:0;padding:0;" src="http://getsocialserver.wordpress.com/files/2008/05/gsb209m05.png" alt="Add to Technorati" /></a><a href="http://www.furl.net/storeIt.jsp?u=http%3A%2F%2Fdotnetstories.wordpress.com%2F2008%2F07%2F07%2Flinq-set-operationsextension-methods-on-arrays%2F&#38;t=LINQ%20set%20operations(extension%20methods)%20on%20arrays" target="_blank"><img style="border:0;margin:0;padding:0;" src="http://getsocialserver.wordpress.com/files/2008/05/gsb210m05.png" alt="Add to Furl" /></a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[About AJAX]]></title>
<link>http://naveenpn.wordpress.com/?p=75</link>
<pubDate>Mon, 07 Jul 2008 14:44:18 +0000</pubDate>
<dc:creator>naveenpn</dc:creator>
<guid>http://naveenpn.wordpress.com/?p=75</guid>
<description><![CDATA[The term Ajax was actually coined by Jesse James Garret of Adaptive
 Path. 
]]></description>
<content:encoded><![CDATA[<p><span style="font-size:14pt;">The term <em><span style="background:silver none repeat scroll 0;">Ajax </span></em><span style="background:silver none repeat scroll 0;">was actually coined by Jesse James Garret</span> of Adaptive</span></p>
<p><span style="font-size:14pt;"> Path. </span><a href="http://naveenpn.wordpress.com/files/2008/07/headshot_garrett.jpg"><img class="size-medium wp-image-76 alignleft" style="float:left;" src="http://naveenpn.wordpress.com/files/2008/07/headshot_garrett.jpg?w=180" alt="" width="180" height="270" /></a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Asp.Net Flv Converter Beta Version]]></title>
<link>http://menononnet.wordpress.com/?p=40</link>
<pubDate>Mon, 07 Jul 2008 11:51:23 +0000</pubDate>
<dc:creator>menononnet</dc:creator>
<guid>http://menononnet.wordpress.com/?p=40</guid>
<description><![CDATA[Your Waiting for the Free Online FLV Converter is going to over&#8230; MenonOn.Net planning to launc]]></description>
<content:encoded><![CDATA[<p>Your Waiting for the Free Online FLV Converter is going to over... MenonOn.Net planning to launch the "On The Fly" FLV Converter by the end of July 2008.</p>
<p>Menon FLV Converter is an On the FLY FLV Converter for ASP.Net Video Streaming Portal Websites. It will convert video files to the flv format.</p>
<p>Beta version of Menon FLV Converter is still under testing... We need your suggestions about this. So kindly post your comments or mail me on menononnet@gmail.com</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Paging in Gridview using PagerTemplate]]></title>
<link>http://sureshsharmaaspdotnet.wordpress.com/?p=127</link>
<pubDate>Mon, 07 Jul 2008 10:00:04 +0000</pubDate>
<dc:creator>Suresh</dc:creator>
<guid>http://sureshsharmaaspdotnet.wordpress.com/?p=127</guid>
<description><![CDATA[&lt;asp:GridView ID=&#8221;gv&#8221; Runat=&#8221;Server&#8221; DataSourceID=&#8221;SqlDataSource1]]></description>
<content:encoded><![CDATA[<p>&#60;asp:GridView ID="gv" Runat="Server" DataSourceID="SqlDataSource1" AutoGenerateColumns="false"<br />
BorderColor="#000080"<br />
BorderWidth="2px"<br />
HorizontalAlign="Center"<br />
Width="90%" AllowPaging=true BackColor=Gray  PagerSettings-Position=TopAndBottom  &#62;<br />
&#60;Columns&#62;<br />
&#60;asp:BoundField HeaderText="localityID" DataField="localityid"  /&#62;<br />
&#60;asp:BoundField HeaderText="localityName" DataField="localityname" /&#62;</p>
<p>&#60;/Columns&#62;</p>
<p>&#60;PagerTemplate&#62;<br />
&#60;asp:LinkButton CommandName="Page" CommandArgument="First"<br />
ID="LinkButton1" runat="server" Style="color: white"&#62;<br />
« First&#60;/asp:LinkButton&#62;<br />
&#60;asp:LinkButton CommandName="Page" CommandArgument="Prev"<br />
ID="LinkButton2" runat="server" Style="color: white"&#62;<br />
&#60; Prev&#60;/asp:LinkButton&#62;<br />
[Records &#60;%= gv.PageIndex * gv.PageSize%&#62;-&#60;%= gv.PageIndex * gv.PageSize + gv.PageSize - 1%&#62;]<br />
&#60;asp:LinkButton CommandName="Page" CommandArgument="Next"<br />
ID="LinkButton3" runat="server" Style="color: white"&#62;<br />
Next &#62;&#60;/asp:LinkButton&#62;<br />
&#60;asp:LinkButton CommandName="Page" CommandArgument="Last"<br />
ID="LinkButton4" runat="server" Style="color: white"&#62;<br />
Last »&#60;/asp:LinkButton&#62;<br />
&#60;/PagerTemplate&#62;<br />
&#60;/asp:GridView&#62;<br />
&#60;asp:SqlDataSource ID="SqlDataSource1" runat="server" SelectCommand="SELECT * FROM locality"<br />
ConnectionString="&#60;%$ ConnectionStrings:rubruConnectionString %&#62;" /&#62;</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[asp.net encrypting querystring in the URL]]></title>
<link>http://biztalkserverguide.wordpress.com/?p=97</link>
<pubDate>Mon, 07 Jul 2008 07:10:56 +0000</pubDate>
<dc:creator>Dheeraj</dc:creator>
<guid>http://biztalkserverguide.wordpress.com/?p=97</guid>
<description><![CDATA[I didnt find a c# version to encrypt query strings in the url, please find the same below..
use Syst]]></description>
<content:encoded><![CDATA[<p>I didnt find a c# version to encrypt query strings in the url, please find the same below..</p>
<p>use System.Security.Cryptography;<br />
System.IO;<br />
System.Text; name spaces</p>
<p>public class QueryStringEncryption<br />
{<br />
byte[] key = { };<br />
byte[] IV = { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB,0xCD, 0xEF};<br />
public QueryStringEncryption()<br />
{<br />
//<br />
// TODO: Add constructor logic here<br />
//<br />
}<br />
public string Encrypt(string stringToEncrypt, string SEncryptionKey)<br />
{<br />
try<br />
{<br />
key = System.Text.Encoding.UTF8.GetBytes(SEncryptionKey.Substring(0, 8));<br />
DESCryptoServiceProvider des = new DESCryptoServiceProvider();<br />
byte[] inputByteArray = Encoding.UTF8.GetBytes(stringToEncrypt);<br />
MemoryStream ms = new MemoryStream();<br />
CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(key, IV), CryptoStreamMode.Write);<br />
cs.Write(inputByteArray, 0, inputByteArray.Length);<br />
cs.FlushFinalBlock();<br />
return Convert.ToBase64String(ms.ToArray());</p>
<p>}<br />
catch (Exception ex)<br />
{<br />
return ex.Message.ToString();<br />
}<br />
finally<br />
{<br />
}</p>
<p>}</p>
<p>public string Decrypt(string stringToDecrypt, string SEncryptionKey)<br />
{<br />
byte[] inputByteArray = new byte[stringToDecrypt.Length];<br />
//   inputByteArray.Length = stringToDecrypt.Length;<br />
//  inputByteArray.Length = stringToDecrypt.Length;<br />
try<br />
{<br />
key = System.Text.Encoding.UTF8.GetBytes(SEncryptionKey.Substring(0, 8));<br />
DESCryptoServiceProvider des = new DESCryptoServiceProvider();<br />
inputByteArray = Convert.FromBase64String(stringToDecrypt);<br />
MemoryStream ms = new MemoryStream();<br />
CryptoStream cs = new CryptoStream(ms,des.CreateDecryptor(key,IV),CryptoStreamMode.Write);<br />
cs.Write(inputByteArray, 0, inputByteArray.Length);<br />
cs.FlushFinalBlock();<br />
System.Text.Encoding encoding = System.Text.Encoding.UTF8;<br />
return encoding.GetString(ms.ToArray());<br />
}<br />
catch ( Exception ex)<br />
{<br />
return ex.Message.ToString();<br />
}<br />
finally<br />
{<br />
}</p>
<p>}<br />
}</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[ASP.NET developer's firefox add-ons]]></title>
<link>http://msqr.wordpress.com/?p=3</link>
<pubDate>Mon, 07 Jul 2008 07:05:38 +0000</pubDate>
<dc:creator>msqr</dc:creator>
<guid>http://msqr.wordpress.com/?p=3</guid>
<description><![CDATA[Anyone who is working on cross-browser compatibility must realize benefits of cool firefox add-ons, ]]></description>
<content:encoded><![CDATA[<p>Anyone who is working on cross-browser compatibility must realize benefits of cool firefox add-ons, and I guess thats what makes firefox so much powerful against IE. Pretty open Add-on framework and vast developer community keeps adding new tools to ease firefox user's life.</p>
<p><strong>Firebug</strong> - Most popular firefox add-on in the web developer community, not only allows debugging javascript but also allows inspecting ht[wp_caption id="attachment_5" align="alignnone" width="300" caption="Live http-headers in action"]<a href="http://msqr.files.wordpress.com/2008/07/headers.jpg"><img src="http://msqr.wordpress.com/files/2008/07/headers.jpg?w=300" alt="Live http-headers in action" width="300" height="107" class="size-medium wp-image-5" /></a>[/wp_caption]ml, helps seeing bandwidth and throughput of your page in terms of styles, javascript, raw html and images.</p>
<p><strong>User Agent Switcher</strong> - This add-on allows you to switch your browser to simulate HTTP GET request as if its coming from IE/Opera/Netscape. I found it extremely useful when some sites are compatible to IE only and you want to inspect html or look at javascript, you can use the duo of User Agent Switcher and Firebug within Firefox itself even if page is designed for IE only.</p>
<p><strong>Live Http Headers</strong> -  It answer's simple question - What it takes browser to load this page. Its useful when you are troubleshooting authentication issues like NTLM(NT LAN Manager) / Kerberos. Usually browser makes request for each physical file, i.e if your page has 2 css files, 2 references of images and 2 javascript files then it makes 6 requests to load this page. Also you can use this to determine whether GZIP compression is enabled or not.</p>
<p>Other Add-ons not specific to developer but useful in day-to-day activity are<br />
<strong><br />
Dictionary Tooltip </strong>- I remember couple of guys in my college time who used to mug up GRE-Barron's and some of the crazier guys mugging up Oxford dictionary to get good score in English. If I ask them meaning of any obscure word, I used to get dictionary answer. But, After I left the college, I tried several options like WordWeb</p>
<p>Gujurati Lexicon</p>
<p>The free dictionary</p>
<p>But all of them had an inherent disadvantage, <strong>you have to explicitly launch them, copy the spelling, hit enter</strong>, wouldn't it be nice if theres some add-on plugs into browser and displays meaning when you double click the word - and my hunt ended with <a href="https://addons.mozilla.org/en-US/firefox/addon/1171">Dictionary Tool-tip</a> add-on.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Keep the Session Alive for DNN]]></title>
<link>http://woaychee.wordpress.com/?p=68</link>
<pubDate>Mon, 07 Jul 2008 06:38:12 +0000</pubDate>
<dc:creator>woaychee</dc:creator>
<guid>http://woaychee.wordpress.com/?p=68</guid>
<description><![CDATA[Well, last week I m face a serious problem of session timeout when the user not do anything for 30]]></description>
<content:encoded><![CDATA[<p>Well, last week I m face a serious problem of session timeout when the user not do anything for 30 mins..</p>
<p>I m tried to change the session value in web.config, IIS setting to increase the session but still not luck!</p>
<p>End up, I use the callback which offered by ASP.NET,<br />
you can check out the link, it work for DNN to keep the session alive, I set the intervals to 15mins to hit server each time.</p>
<p>Here the simple example I m developed for DNN Module which will hit server for every 5 seconds then display alert in Internet Browser:</p>
<p>in ASCX,</p>
<p>&#60;script language="JavaScript"&#62;</p>
<p>function ShowSucess(msg, context) {<br />
if (msg != '')<br />
alert(msg);<br />
}<br />
function startTimeOutRequest() {<br />
initServerTimeRequest();<br />
}</p>
<p>window.setInterval("startTimeOutRequest()", 5000);</p>
<p>&#60;/script&#62;</p>
<p>in ASCX.CS,</p>
<p>protected void Page_Load(System.Object sender, System.EventArgs e)<br />
{</p>
<p>ClientScriptManager cs = Page.ClientScript;</p>
<p>StringBuilder sb = new StringBuilder();<br />
sb.Append("&#60;script language=\"javascript\" type=\"text/javascript\"&#62;");<br />
sb.Append("function initServerTimeRequest(args, context){");<br />
sb.Append(cs.GetCallbackEventReference(this, "args", "ShowSucess", "context", false));<br />
sb.Append("}");<br />
sb.Append("&#60;/script&#62;");<br />
cs.RegisterStartupScript(GetType(), "initServerTimeRequest", sb.ToString());</p>
<p>}</p>
<p>public string GetCallbackResult()<br />
{</p>
<p>return "Alert from Server";<br />
}</p>
<p>public void RaiseCallbackEvent(string eventArgument)<br />
{<br />
//eventArgument &#60;- this is the args from javascript, if in javascript  you pass 1, here will receive 1, Example: initServerTimeRequest(1) in ASCX, you will receive 1 for eventArgument</p>
<p>}</p>
<p>Here the <a href="http://msdn.microsoft.com/en-us/library/ms178208.aspx">link<br />
</a> for your reference.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[fix header in repeater and datalist]]></title>
<link>http://sureshsharmaaspdotnet.wordpress.com/?p=124</link>
<pubDate>Mon, 07 Jul 2008 06:29:01 +0000</pubDate>
<dc:creator>Suresh</dc:creator>
<guid>http://sureshsharmaaspdotnet.wordpress.com/?p=124</guid>
<description><![CDATA[&lt;asp:DataList ID=&#8221;dl&#8221; runat=server&gt;
&lt;HeaderTemplate&gt;&lt;table bgcolor=gray]]></description>
<content:encoded><![CDATA[<p>&#60;asp:DataList ID="dl" runat=server&#62;<br />
&#60;HeaderTemplate&#62;&#60;table bgcolor=gray&#62;&#60;tr style="font-family:Arial;font-size:14px;font-weight:bold;background-color:Gray"&#62;&#60;td&#62;Localityid&#60;/td&#62;&#60;td&#62;Localityname&#60;/td&#62;&#60;/tr&#62;&#60;tr&#62;&#60;td colspan=2&#62;&#60;div style="overflow-y:scroll;height:250px;width:200px;"&#62;&#60;table bgcolor=white&#62;&#60;/HeaderTemplate&#62;<br />
&#60;ItemTemplate&#62;<br />
&#60;tr&#62;&#60;td width=100&#62;&#60;%#Eval("localityid") %&#62;&#60;/td&#62;&#60;td width=100&#62;&#60;%#Eval("localityname") %&#62;&#60;/td&#62;&#60;/tr&#62;<br />
&#60;/ItemTemplate&#62;<br />
&#60;FooterTemplate&#62;&#60;/table&#62;&#60;/div&#62;&#60;/td&#62;&#60;/tr&#62;&#60;/table&#62;&#60;/FooterTemplate&#62;<br />
&#60;/asp:DataList&#62;<br />
code behind code/////////<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["rubruConnectionString"].ConnectionString);<br />
SqlDataAdapter cmd = new SqlDataAdapter("select top 100 * from locality", con);<br />
cmd.SelectCommand.CommandType = CommandType.Text;<br />
DataSet ds = new DataSet();<br />
cmd.Fill(ds);<br />
dl.DataSource = ds;<br />
dl.DataBind();</p>
<p>}</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[An error occurred when merging assemblies: Access to the path '...' is denied.]]></title>
<link>http://dreamlusion.wordpress.com/?p=72</link>
<pubDate>Sun, 06 Jul 2008 13:29:14 +0000</pubDate>
<dc:creator>dreamlusion</dc:creator>
<guid>http://dreamlusion.wordpress.com/?p=72</guid>
<description><![CDATA[Not much talk has been around this error. There has been some incident reports in the ASP.NET forums]]></description>
<content:encoded><![CDATA[<p><a href="http://www.google.com/search?q=%22An+error+occurred+when+merging+assemblies%3A+Access+to+the+path%22">Not much talk has been around this error</a>. There has been some incident reports in the ASP.NET forums that suggest the root cause of the problem is a duplicate type name, typically a page class, in the merging assemblies.</p>
<p>We did encounter some serious problems recently in my work relevant to this issue. The Web Deployment Project for our Web Site that served us well for some time, all of a sudden stopped working giving this error in it's build output console.</p>
<p><strong>One of my first attempts to solve this puzzle</strong>, after having searched the net for an answer, was to check if any of the containing types of the the assembly that seemed to be causing the problem, was given an already existent name across the project, but that was not the case.</p>
<p><strong>I decided to look further the problem</strong> by manually compiling and merging the Web Application in order to gain more control over the issuing commands and, hopefully, get the duplicate type name.</p>
<p>As <a href="http://msdn.microsoft.com/en-us/library/ms229863(VS.80).aspx">aspnet_compiler</a> has always been compiling the project with success, I didn't use any extra switches to manipulate it's error/status output.</p>
<p><code>aspnet_compiler.exe -v /WebSite -p C:\Development\WebSite -u -f -d C:\Development\WebSiteBuild\TempBuildDir\</code></p>
<p>For <a href="http://msdn.microsoft.com/en-us/library/bb397866.aspx">aspnet_merge</a> I used the extra <em>-errorstack</em> and <em>-log</em> arguments the functionality of which is described in the ASP.NET Merge Tool presentation article <a href="http://msdn.microsoft.com/en-us/library/bb397866.aspx">here</a>.</p>
<p><code>aspnet_merge.exe </code><code>C:\Development\WebSiteBuild\TempBuildDir\</code><code> -o WebSiteBuild -a  -debug -copyattrs -errorstack -log merge.log</code></p>
<p>From the extra <em>-errorstack</em> argument I've learned that an <a href="http://msdn.microsoft.com/en-us/library/system.unauthorizedaccessexception.aspx">UnAuthorizedAccessException</a> causes aspnet_merge to fail with this stack trace:</p>
<p><code>[UnauthorizedAccessException]: Access to the path 'C:\Development\WebSiteBuild\TempBuildDir\bin\App_Web_9imofmvu.dll' is denied.<br />
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)<br />
at System.IO.File.Delete(String path)<br />
at System.Web.Compilation.Merge.DeleteFileNoThrow(String filepath)<br />
at System.Web.Compilation.Merge.RemoveOldAssembly(Hashtable assemblyMapping)<br />
at System.Web.Compilation.Merge.Main(String[] args)</code></p>
<p>or</p>
<p><code>[UnauthorizedAccessException]: Access to the path 'C:\Development\WebSiteBuild\TempBuildDir\bin\App_Code.dll' is denied.<br />
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)<br />
at System.IO.File.Delete(String path)<br />
at System.Web.Compilation.Merge.DeleteFileNoThrow(String filepath)<br />
at System.Web.Compilation.Merge.RemoveOldAssembly(Hashtable assemblyMapping)<br />
at System.Web.Compilation.Merge.Main(String[] args)</code></p>
<p>And from the the <em>-log</em> argument I didn't learn anything as the log file did not contain anything suspicious to me.</p>
<p><strong>The gathered information didn't help much</strong> to achieve my initial goal, to unveil the duplicate type name, so I needed to move onto this mini research.</p>
<p>Having trust to what others say about the problem, and continuing to believe that for some reason a duplicate type name existed in the project - I had nothing else to work on -, I thought I could merge the assemblies using some tool other than aspnet_merge, that will hopefully give me more details if any error occurs.</p>
<p>After some googling <strong>I came up with a tool called <a href="http://www.google.com/search?q=download+details%3A+ilmerge">ILMerge</a></strong>. It is hosted in Microsoft, is authored by Michael Barnett and shares the same codebase as aspnet_merge.</p>
<p>You typically use this tool in command of the following form:</p>
<p><code>ILMerge /target:(library&#124;exe&#124;winexe) /out:filename Program.exe ClassLibrary1.dll ClassLibrary2.dll</code></p>
<p>For the specific situation of merging the pre-compiled assemblies of a Web Site, the correct command to use is:</p>
<p><code>ILMerge /out:WebSiteBuild.dll App_Web_*.dll App_Web_*.dll </code><code>App_Web_*.dll ...</code></p>
<p>For ILMerge to work you, obviously, first need to use aspnet_compiler to pre-compile your Web Site. You then need to explicitly specify all the assembly names that you want to take part in the merge operation. If you have <a href="http://en.wikipedia.org/wiki/Windows_PowerShell">PowerShell</a> installed in your system you may issue the following command instead of specifying each assembly one-by-one:</p>
<p><code>PS C:\Develop\WebSiteBuild\TempBuildDir\bin&#62; $assemblies = ls .\* -include App_*.dll -name; &#38;'C:\Program Files\Microsoft\ILMerge\ILMerge.exe' /t:lib /out:WebSiteBuild.dll $assemblies</code></p>
<p><em>NOTE: You may need a <a href="http://et.cairene.net/2006/05/02/vs2005-powershell-prompt/">Visual Studio PowerShell Prompt</a> to do this.</em></p>
<p><strong>and.. BINGO!</strong></p>
<p>If a duplicate type name exists in your set of assemblies you should get the following output:</p>
<p>An exception occurred during merging: ILMerge.Merge: ERROR!!: Duplicate type 'Company.WebSite.YetAnotherClass' found in assembly 'App_Web_y1dnvgxw'.<br />
at ILMerging.ILMerge.MergeInAssembly(AssemblyNode a, Boolean makeNonPublic)<br />
at ILMerging.ILMerge.Merge()<br />
at ILMerging.ILMerge.Main(String[] args)</p>
<p>Now that you have the name of the <em>evil</em> class name, all you have to do is to rename it, but in our case unfortunatelly things aren't that sweet because the YetAnotherClass <strong>IS NOT a duplicate type</strong>, and that left me scratching my head..</p>
<p>I thought this should be related to the compilation, and I took a more thorough looked into the aspnet_compiler arguments.</p>
<p><strong>Compiling using the <em>-fixednames</em> argument, and then merging using the ILMerge OR the aspnet_merge tools, makes the problem dissapear</strong>, meaning that the compiler no longer produces duplicate type names. Bug?</p>
<p>The problem is that from within VS I fnd no other way to pass the <em>-fixednames</em> argument to aspnet_compiler than to use the "Merge each individual folder output to its own assembly" option which, apparently, is not equivalent to "Merge all outputs to a single assembly".</p>
<p><strong>To the bottom line</strong>, if you experience the "Access Denied" error when merging all output to a single assembly, you may be able to overcome it but, probably, not from within VS, you'll have to use the command prompt instead.</p>
<p>UPDATE: Using the “Merge all pages and control outputs to a single assembly” option, which calls aspnet_merge with the -w param instead of the -o param, resolves the issues we had.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[ASP.net Reset Password]]></title>
<link>http://adnanrashid.wordpress.com/?p=3</link>
<pubDate>Sun, 06 Jul 2008 10:46:04 +0000</pubDate>
<dc:creator>adnanrashid</dc:creator>
<guid>http://adnanrashid.wordpress.com/?p=3</guid>
<description><![CDATA[If you are using Membership Provider in your ASP.net application, you might come across a scenario i]]></description>
<content:encoded><![CDATA[<p>If you are using Membership Provider in your ASP.net application, you might come across a scenario in which you need to have both Security Question and Answer feature and would also like to programmatically reset the password for an account.</p>
<p>So if you run the code</p>
<p><em>string username = “user”;<br />
string password = “password”;<br />
MembershipUser mu = Membership.GetUser(username);<br />
mu.ChangePassword(mu.ResetPassword(), password);</em></p>
<p>You will get an error when you try to reset the password. A solution is to add another Membership provider having all the same settings as the default provider with only one exception:</p>
<p><em>&#60;add name="NewMembershipProvider" <strong>requiresQuestionAndAnswer=”false”</strong> ....../&#62;</em></p>
<p>For all Membership functions, you the default Membership provider will be used, but when you need to reset the password, you must reference the new Provider. Here's a code excerpt to help you out:</p>
<p><em>string username = “user”;<br />
string password = “password”;<br />
MembershipUser mu = Membership.Providers["NewMembershipProvider"].GetUser(username, false);<br />
mu.ChangePassword(mu.ResetPassword(), password);</em></p>
<p>So now your application can use both the Security feature to recover password and programmatically Change/Reset the password when required.</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Forms Authentication timeout in ASP.NET]]></title>
<link>http://menononnet.wordpress.com/?p=43</link>
<pubDate>Sun, 06 Jul 2008 07:08:29 +0000</pubDate>
<dc:creator>menononnet</dc:creator>
<guid>http://menononnet.wordpress.com/?p=43</guid>
<description><![CDATA[Asp.Net the forms authentication timeout value by default is 30 Minutes, this means after 30 minutes]]></description>
<content:encoded><![CDATA[<p>Asp.Net the forms authentication timeout value by default is 30 Minutes, this means after 30 minutes of inactivity the application will redirect user to the login page again</p>
<p>You can change the timeout value by modifying the <span style="color:#cc3300;"><em>web.config</em></span></p>
<p>for example:</p>
<p style="padding-left:30px;"><span style="color:#cc3300;">&#60;authentication mode="Forms"&#62;<br />
&#60;forms name=".ASPXFORMSDEMO" loginUrl="./logon.aspx" protection="All" path="/" timeout="2400" /&#62;<br />
&#60;/authentication&#62;</span></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Google Interview Questions June 2008 Updated]]></title>
<link>http://bestinterviewquestions.wordpress.com/?p=3</link>
<pubDate>Sat, 05 Jul 2008 22:06:09 +0000</pubDate>
<dc:creator>navneetdce</dc:creator>
<guid>http://bestinterviewquestions.wordpress.com/?p=3</guid>
<description><![CDATA[&#8220;You are shrunk to the height of a nickel and your mass is proportionally reduced so as to mai]]></description>
<content:encoded><![CDATA[<p><em>"You are shrunk to the height of a nickel and your mass is proportionally reduced so as to maintain your original density. You are then thrown into an empty glass blender. The blades will start moving in 60 seconds. What do you do?"</em></p>
<p><strong>(my answer):</strong> Take off all my clothes, wedge them between the blades and the floor to prevent it from turning. Back up against the edge of the blender until the electric motor overheats and burns out. Using the notches etched in the side for measuring, climb out. If there are no such notches or they're too far apart, retrieve clothes and make a rope to hurl myself out.</p>
<p><a href="http://it-interviews.blogspot.com"><br />
</a></p>
<h2><a href="http://it-interviews.blogspot.com">FOR MORE GOOGLE INTERVIEW QUESTIONS CLICK HERE...</a></h2>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Cloud Control for ASP.NET]]></title>
<link>http://vincenthomedev.wordpress.com/2008/07/05/cloud-control-for-aspnet/</link>
<pubDate>Sat, 05 Jul 2008 21:45:12 +0000</pubDate>
<dc:creator>vincenthome</dc:creator>
<guid>http://vincenthomedev.wordpress.com/2008/07/05/cloud-control-for-aspnet/</guid>
<description><![CDATA[&nbsp; 
The weight factor is calculated according to the following formula:

factor = (weight - mean]]></description>
<content:encoded><![CDATA[<p>&#160;<a href="http://vincenthomedev.files.wordpress.com/2008/07/image4.png"><img style="border-width:0;" height="100" alt="image" src="http://vincenthomedev.files.wordpress.com/2008/07/image-thumb4.png" width="244" border="0"></a> </p>
<li>The weight factor is calculated according to the following formula:<br />
<blockquote>
<pre>factor = (weight - mean)/(stddev)</pre>
</blockquote>
<p><a href="http://www.codeproject.com/KB/aspnet/cloud.aspx">CodeProject: Cloud Control for ASP.NET. Free source code and programming help</a> </p>
</li>
]]></content:encoded>
</item>
<item>
<title><![CDATA[OpenID ASP.NET Control]]></title>
<link>http://vincenthomedev.wordpress.com/2008/07/05/openid/</link>
<pubDate>Sat, 05 Jul 2008 18:42:13 +0000</pubDate>
<dc:creator>vincenthome</dc:creator>
<guid>http://vincenthomedev.wordpress.com/2008/07/05/openid/</guid>
<description><![CDATA[&nbsp;
This C# OpenID library adds OpenID 2.0 Provider and Relying Party support to your web site bo]]></description>
<content:encoded><![CDATA[<p>&#160;</p>
<blockquote><p>This C# OpenID library adds <strong>OpenID 2.0 Provider and Relying Party</strong> support to your web site both programmatically and through convenient drop-in ASP.NET controls.<br />
<h4><a>Features</h4>
<ul>
<li>Add support for your site visitors to login with their OpenIDs by just dropping an ASP.NET control onto your page. <i>It's that easy</i>.
<li>Give your site members their own OpenIDs with the provider support included in this library.
<li>Sample relying party and provider web sites show you just how to do it.
<li>Works in partial trusted shared hosting environments.
<li>Support for web farms where state persistence, front-facing web servers and ASP.NET may not be standard or even available.
<li></a>170+ unit tests to verify correctness. </li>
</ul>
<p></a></p></blockquote>
<p>Via <a href="http://code.google.com/p/dotnetopenid/">dotnetopenid - Google Code</a></p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[A Regular Expression for a Strong Password]]></title>
<link>http://hspinfo.wordpress.com/2008/07/05/a-regular-expression-for-a-strong-password/</link>
<pubDate>Sat, 05 Jul 2008 12:23:48 +0000</pubDate>
<dc:creator>hspinfo</dc:creator>
<guid>http://hspinfo.wordpress.com/2008/07/05/a-regular-expression-for-a-strong-password/</guid>
<description><![CDATA[If you want to create an application which accepts only strong password, then here is a solution fo]]></description>
<content:encoded><![CDATA[<p>If you want to create an application which accepts only strong password, then here is a solution for you. You can apply the following regular expression which creates a validation for you to allow only strong password.</p>
<p>(?=^.{8,}$)((?=.*\d)&#124;(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$</p>
<p>Description of this regular expression is as below:</p>
<p>Passwords will contain at least (1) upper case letter<br />
Passwords will contain at least (1) lower case letter<br />
Passwords will contain at least (1) number or special character<br />
Passwords will contain at least (8) characters in length<br />
Password maximum length should not be arbitrarily limited</p>
<p>let me know if you want any change in current regular expression according to your requirements.</p>
<p>Happy coding...</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[Expandable Panel]]></title>
<link>http://dhavalcharadva.wordpress.com/?p=3</link>
<pubDate>Sat, 05 Jul 2008 12:10:10 +0000</pubDate>
<dc:creator>dhavalcharadva</dc:creator>
<guid>http://dhavalcharadva.wordpress.com/?p=3</guid>
<description><![CDATA[Expandable panel- a kind of panel which has ability to expand/collapse.
]]></description>
<content:encoded><![CDATA[<p>Expandable panel- a kind of panel which has ability to expand/collapse.</p>
]]></content:encoded>
</item>

</channel>
</rss>
