tag:blogger.com,1999:blog-22609536517182477302009-07-13T01:03:18.426-07:00Welcome to TALIB's WorldTalib Ali Khanhttp://www.blogger.com/profile/00895700116807701467Talib.Enigmatic@gmail.comBlogger18125tag:blogger.com,1999:blog-2260953651718247730.post-9369830986478347222009-02-24T02:14:00.000-08:002009-07-08T04:48:12.703-07:00ASP.NET AJAX Auto Complete Extender with DatabaseOf late, there has been a lot of speculation about AJAX Control Toolkit's AutoComplete Extender. Basically , this control loads the data specific to the entered text.. <br />So now we will see as to how to connect this control to database and fetch the data when the user enters a specific word or phrase.....<br /><br /><b><u>AutoComplete.aspx</u></b><br /><br><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_26hG6RRaBdk/SaPSudOqqPI/AAAAAAAAALY/V1QE2a_9bvI/s1600-h/AJAX.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 222px; height: 320px;" src="http://1.bp.blogspot.com/_26hG6RRaBdk/SaPSudOqqPI/AAAAAAAAALY/V1QE2a_9bvI/s320/AJAX.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5306316481534535922" /></a><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_26hG6RRaBdk/SaPXsh-_czI/AAAAAAAAALg/nZgPy8-FC_E/s1600-h/AJAX1.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 134px;" src="http://3.bp.blogspot.com/_26hG6RRaBdk/SaPXsh-_czI/AAAAAAAAALg/nZgPy8-FC_E/s320/AJAX1.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5306321946009367346" /></a><br /><br /><b>Now let us see the code for web service that will help us in fetching the data.. </b><br /><br /><b><u>AutoComplete.cs</u></b><br /><br />[WebService(Namespace = "http://tempuri.org/")]<br />[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]<br />[System.Web.Script.Services.ScriptService]<br />public class AutoComplete : WebService<br />{<br /> [WebMethod]<br /><br /> public string[] SearchDB(string prefixText, int count)<br /> { <br /> if (count == 0)<br /> {<br /> count = 10;<br /> }<br /><br /> SqlConnection con = new SqlConnection("server=localhost;database=your database;uid=your username;pwd=your pwd");<br /><br /> string str = "select * from table where username like @prefixText";<br /> con.Open();<br /> SqlDataAdapter da = new SqlDataAdapter(str, con);<br /><br /> da.SelectCommand.Parameters.Add("@prefixText", SqlDbType.VarChar, 50).Value = prefixText + "%";<br /> DataSet ds = new DataSet();<br /> da.Fill(ds);<br /><br /> int cnt = ds.Tables[0].Rows.Count;<br /> List<string> items = new List<string>(cnt);<br /> for (int i = 0; i < ds.Tables[0].Rows.Count; i++)<br /> {<br /><br /><br /> items.Add(ds.Tables[0].Rows[i]["UserName"].ToString());<br /> }<br /> return items.ToArray();<br /><br /> } <br />}<br /><br /><br /><b><u>Stylesheet.css</u></b><br />/* AutoComplete highlighted item */<br /><br />.autocomplete_highlightedListItem<br />{<br /> background-color: #ffff99;<br /> color: black;<br /> padding: 1px;<br />}<br /><br />/* AutoComplete item */<br /><br />.autocomplete_listItem <br />{<br /> background-color : window;<br /> color : windowtext;<br /> padding : 1px;<br />}<br /><br />Now let's check out the result after running the application ..<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_26hG6RRaBdk/SaQEW7DotgI/AAAAAAAAALo/0M6Ldnrys5I/s1600-h/WService.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 190px;" src="http://2.bp.blogspot.com/_26hG6RRaBdk/SaQEW7DotgI/AAAAAAAAALo/0M6Ldnrys5I/s320/WService.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5306371052805862914" /></a><br /><br /><br /><br /><b><u>NOTE:</u></b>Please do comment regarding the article as it'll help me to write even more specifically..<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2260953651718247730-936983098647834722?l=talibkhan.blogspot.com'/></div>Talib Ali Khanhttp://www.blogger.com/profile/00895700116807701467Talib.Enigmatic@gmail.com4tag:blogger.com,1999:blog-2260953651718247730.post-70392784372846686592009-02-23T01:16:00.000-08:002009-02-23T02:14:33.786-08:00Failed to access IIS Metabase<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_26hG6RRaBdk/SaJ2x36vtBI/AAAAAAAAALI/aUVmUWJkbYk/s1600-h/metabase+error_2.png"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 192px;" src="http://3.bp.blogspot.com/_26hG6RRaBdk/SaJ2x36vtBI/AAAAAAAAALI/aUVmUWJkbYk/s320/metabase+error_2.png" alt="" id="BLOGGER_PHOTO_ID_5305933910191879186" border="0" /></a><br /><br />This kind of error usually comes when you install ASP.NET first and then IIS. So as a solution to this , you just need to do one thing , write the given syntax in the command line and run it.<br /><br /><b><br />C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet-regiis -i </b><br /><br /><br />Hope this helps…<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2260953651718247730-7039278437284668659?l=talibkhan.blogspot.com'/></div>Talib Ali Khanhttp://www.blogger.com/profile/00895700116807701467Talib.Enigmatic@gmail.com0tag:blogger.com,1999:blog-2260953651718247730.post-40115470413262148832009-02-08T02:20:00.000-08:002009-02-08T06:11:07.260-08:00Memory Exception in ASP.NET<a href="http://3.bp.blogspot.com/_26hG6RRaBdk/SY7lC2PTkNI/AAAAAAAAAK4/HiWsOlkAlzQ/s1600-h/Exception.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 181px;" src="http://3.bp.blogspot.com/_26hG6RRaBdk/SY7lC2PTkNI/AAAAAAAAAK4/HiWsOlkAlzQ/s320/Exception.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5300425648543862994" /></a><br /><br />Exceptions are an integral part of programming. when you do programming, exceptions are bound to occur.Although there are many kinds of exceptions that are prevalent, but one of the most annoying of 'em all is the 'System.OutOfMemoryException'. Although there have been many discussions/posts regarding this exception 'coz this kind of exception arises out of many possibilites. As far as my experience goes, i've found some reasons as to why this exception occurs.<br /><br />1)<b> Using a higher value for Max Pool Size in Web.Config </b><br /><br /><br /><a href="http://4.bp.blogspot.com/_26hG6RRaBdk/SY7EKT9yq6I/AAAAAAAAAKw/XD9v86eWAgs/s1600-h/CONN.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 50px;" src="http://4.bp.blogspot.com/_26hG6RRaBdk/SY7EKT9yq6I/AAAAAAAAAKw/XD9v86eWAgs/s320/CONN.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5300389492898835362" /></a><br /> Reason for using Max Pool Size is , it specifies the maximum size of your connection pool. Default is 100. Most Web sites do not use more than 40 connections under the heaviest load but it depends on how long your database operations take to complete. Connection pooling increases the performance of Web applications by reusing active database connections instead of creating a new connection with every request. Connection pool manager maintains a pool of open database connections. When a new connection requests come in, the pool manager checks if the pool contains any unused connections and returns one if available. If all connections currently in the pool are busy and the maximum pool size has not been reached, the new connection is created and added to the pool. When the pool reaches its maximum size all new connection requests are being queued up until a connection in the pool becomes available or the connection attempt times out.<br /> When a connection is opened and a pool is created, multiple connections are added to the pool to bring the connection count to the configured minimum level. Connections can be subsequently added to the pool up to the configured maximum pool count. When the maximum count is reached, new requests to open a connection are queued for a configurable duration.<br /><br /><br />2)<b> Using DataReader but not closing it after the task finishes.</b> <br /> <br /> Of late , this has been noticed that many times we OPEN the DataReader but don't CLOSE the reader after a specific task has been finished. So as a better practice, do remember to CLOSE the DataReader whenever you OPEN it.<br /> Also , do keep a check on CLOSING/DISPOSING the database connection. <br /><br />3) <b>Objects not being disposed.</b><br /><br /> C#, through the .NET Framework common language runtime (CLR), automatically releases the memory used to store objects that are no longer required. The release of memory is non-deterministic; memory is released whenever the CLR decides to perform garbage collection. However, it is usually best to release limited resources such as file handles and network connections as quickly as possible. The using statement allows the programmer to specify when objects that use resources should release them. The object provided to the using statement must implement the IDisposable interface. This interface provides the Dispose method, which should release the object's resources.<br />A using statement can be exited either when the end of the using statement is reached or if an exception is thrown and control leaves the statement block before the end of the statement.<br /><br /><br /> Font font2 = new Font("Arial", 10.0f);<br /> using (font2)<br /> {<br /> // use font2<br /> }<br /><br />Hope this helps someone some day or the other......<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2260953651718247730-4011547041326214883?l=talibkhan.blogspot.com'/></div>Talib Ali Khanhttp://www.blogger.com/profile/00895700116807701467Talib.Enigmatic@gmail.com0tag:blogger.com,1999:blog-2260953651718247730.post-79288062233267818362008-10-18T01:21:00.000-07:002008-10-18T02:53:42.406-07:00App_Offline.htm .... Taking an ASP.NET 2.0 application offlineSometimes what happens is , when you are working on some maintainence stuff on your website , then you need to STOP the application from functioning. This could prove to be a tedious task . So as a solution to this ,comes another amazing feature of Visual Studio.Net which we will see in the coming lines below.<br /><br />Create a file named <strong>"app_offline.htm" </strong> in the root of the application . When ASP.NET sees it, it will shut-down the app-domain for the application (and not restart it for requests) and instead send back the contents of the <strong>app_offline.htm</strong> file in response to all new dynamic requests for the application. So when you are done updating the site, just delete the file and it will come back online.<br /><br />So if you use the <strong>app_offline.htm</strong> feature, you should make sure you have at least 512 bytes of content within it to make sure that your HTML shows up to your users. <br /><br />For example :<br /><div> <p>This page is U N D E R C O N S T R U C T I O N !!. Please visit after sometime. Thank You !!</p><br /></div><br /><br />I hope this article helps someone or the other someday. :-)<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2260953651718247730-7928806223326781836?l=talibkhan.blogspot.com'/></div>Talib Ali Khanhttp://www.blogger.com/profile/00895700116807701467Talib.Enigmatic@gmail.com0tag:blogger.com,1999:blog-2260953651718247730.post-22610765976084438012008-08-06T00:51:00.000-07:002008-08-06T04:14:25.555-07:00SQL - CLR Integration in Visual Studio .NET<div><span style="font-family:verdana;font-size:85%;">The SQL – CLR integration feature has been into existence since VS 2005. The most amazing feature of this is, frankly speaking , you can create a dll using VS.Net and then you can access that dll’s logic in SQL Server 2005.. Wanna know more about this , then lets get it started… </span><br /><br /><p><span style="font-family:verdana;font-size:85%;">The first and foremost point is to "ENABLE" the CLR functionality in Sql Server 2005 ,( 'coz by default it's DISABLED) which you can do it in this way ... Write the below given commands in the Sql Server Management Studio IDE </span><span style="font-family:verdana;font-size:85%;">in the database where you want to perform this.</span></p><br /><p><span style="font-family:verdana;font-size:85%;"><br /><strong>sp_configure 'show advanced options', 1<br />GO<br />RECONFIGURE<br />GO<br />sp_configure 'clr enabled', 1<br />GO<br />RECONFIGURE<br />GO</strong></span><br /></p><span style="font-family:verdana;font-size:85%;">Step1: Create a SQL Server Database Project in Visual Studio .<br /></span><br /><br /><br /><br /><p><br /><img id="BLOGGER_PHOTO_ID_5231315277521884834" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_26hG6RRaBdk/SJldhzjEFqI/AAAAAAAAADw/iTIumv7EC18/s320/untitled.bmp" border="0" /> <a href="http://1.bp.blogspot.com/_26hG6RRaBdk/SJleAblch8I/AAAAAAAAAD4/Qa-dOiQncsY/s1600-h/Step2.bmp"><img id="BLOGGER_PHOTO_ID_5231315803665369026" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_26hG6RRaBdk/SJleAblch8I/AAAAAAAAAD4/Qa-dOiQncsY/s320/Step2.bmp" border="0" /></a> I named it as "My Project", you can name it as you like.</p><br /><br />Now it asks for a Database connection instance ,like the one shown below.<br /><br /><a href="http://2.bp.blogspot.com/_26hG6RRaBdk/SJlf831_OeI/AAAAAAAAAEI/hKbpfa4NtVw/s1600-h/Step3.bmp"><img id="BLOGGER_PHOTO_ID_5231317941554723298" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_26hG6RRaBdk/SJlf831_OeI/AAAAAAAAAEI/hKbpfa4NtVw/s320/Step3.bmp" border="0" /></a><br /><br /><br /><br />Select your desired database conection or create a new one by clicking " Add New Reference".<br /><br /><br /><br /><br /><p>Step2: Right Click on the Project name and add a new item " User-Defined Function" ( I have used function here, you can create a Stored Procedure or trigger as well ... depending on your requirement ).</p><br /><a href="http://1.bp.blogspot.com/_26hG6RRaBdk/SJlgl65CezI/AAAAAAAAAEQ/sRpLbugmpII/s1600-h/Step4.bmp"><img id="BLOGGER_PHOTO_ID_5231318646747462450" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_26hG6RRaBdk/SJlgl65CezI/AAAAAAAAAEQ/sRpLbugmpII/s320/Step4.bmp" border="0" /></a><br /><br /><br /><br /><p>By default , the Function Class contains a function returning "Hello " . So we'll use that one as our function.</p><br /><p>Step 3 : Now , BUILD the project and then the dll is created for that project in its root folder.</p><br /><p>Now , right click on the project and click "Deploy" . This will deploy your project onto the instance of Sql Server and also creates an ASSEMBLY with the same name as per the name of your project's dll. for eg; here it's name is <strong>MyProject</strong> . </p><br /><a href="http://2.bp.blogspot.com/_26hG6RRaBdk/SJlrTJjSkII/AAAAAAAAAEY/2OtDLuZv9TY/s1600-h/Step5.bmp"><img id="BLOGGER_PHOTO_ID_5231330418893164674" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_26hG6RRaBdk/SJlrTJjSkII/AAAAAAAAAEY/2OtDLuZv9TY/s320/Step5.bmp" border="0" /></a><br /><p></p><br /><p></p><br /><p>To check out whether the assembly has been created or not , execute this in Sql Server Management Studio IDE ,</p><br /><p>Select * from sys.Assemblies </p><br /><p>This will display the registered assemblies in that database .</p><br /><p>Step 4: As of now the assembly is created, so now we need to create a FUNCTION that references that assembly .</p><br /><p><br />CREATE function <span style="color:#ff0000;"><span style="color:#663333;">MyFunction ()</span><br /></span>returns nvarchar(15)<br />AS EXTERNAL NAME <span style="color:#000099;">MyProject</span>.[<span style="color:#330099;">UserDefinedFunctions</span>].<span style="color:#330033;">Function1</span></p><br /><p>Note : <strong><span style="color:#663333;">MyFunction ()</span></strong> is the name of the function you want to create.</p><br /><p><span style="color:#000099;"><strong>MyProject</strong> </span><span style="color:#000000;">is the name of the Assembly ,which got created when we click the DEPLOY option .</span></p><br /><p><span style="color:#cc33cc;"><strong><span style="color:#330099;">UserDefinedFunctions</span></strong> </span>is the name of the Parent Class present in the file Function1.cs </p><br /><p><strong>Function1</strong> is the name of the function present in the file Function1.cs</p><br /><p>Execute the above code in Sql Server Management Studio IDE and now your Function is ready to be used . Check it out by executing the below command,</p><br /><p><strong>Select dbo.MyFunction () </strong></p><br /><p>Now this returns the output as "Hello" .. </p><br /><p>From this article , we have learnt as to how one can use the SQL - CLR Integration feature of Visual Studio .Net.</p><br /><p>Hope you liked the article . Till then keep rocking and enjoy programming .</p><br /><p></p><br /><p></p></div><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2260953651718247730-2261076597608443801?l=talibkhan.blogspot.com'/></div>Talib Ali Khanhttp://www.blogger.com/profile/00895700116807701467Talib.Enigmatic@gmail.com0tag:blogger.com,1999:blog-2260953651718247730.post-30242687686279068142008-05-14T06:57:00.000-07:002008-05-28T05:56:27.838-07:00Disable Dates in a CalendarFrom my previous experiences , what i have found out is that sometimes we need to disable the previous and coming dates in a calendar control. So finally i thought to post it out. It goes like this....,<br /><br /><br /><br />protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)<br />{<br />if (e.Day.Date< <datetime.today) isselectable="false;" tooltip="This date is not available">DateTime.Today)<br />{<br />e.Day.IsSelectable = false;<br />e.Cell.ToolTip = "This date is not available";<br />}<br />else if (e.Day.Date> DateTime.Today)<br /> {<br /> e.Day.IsSelectable = false;<br /> e.Cell.ToolTip = "This date is not available";<br /> }<br />}<br /><br />Keep rockiin........<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2260953651718247730-3024268768627906814?l=talibkhan.blogspot.com'/></div>Talib Ali Khanhttp://www.blogger.com/profile/00895700116807701467Talib.Enigmatic@gmail.com1tag:blogger.com,1999:blog-2260953651718247730.post-42132290300578316432008-05-07T00:31:00.000-07:002008-05-25T07:05:24.419-07:00Detecting User's IP Address<span style="font-family:trebuchet ms;">If your website contains sensitive data and you don't want any spamming or any malicious use of your website ,then one thing you can do is to keep a track of the</span><span style="font-family:trebuchet ms;"> visiting user's system IP and this can be done in some easy steps given below,</span><br /><span style="font-family:Trebuchet MS;"></span><br /><br /><span style="color:#33ccff;"><span style="font-family:courier new;color:#ffffcc;"><strong>string strHostName = System.Net.Dns.GetHostName();<br />string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString();</strong></span><br /></span><br />Now set the value of <strong><em>clientIPAddress</em> </strong>to either a Textbox or label or any control as per your requirement.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2260953651718247730-4213229030057831643?l=talibkhan.blogspot.com'/></div>Talib Ali Khanhttp://www.blogger.com/profile/00895700116807701467Talib.Enigmatic@gmail.com5tag:blogger.com,1999:blog-2260953651718247730.post-844028074237452892008-05-04T07:07:00.000-07:002008-05-25T07:05:51.063-07:00Useful HTML Meta TagsTo be precise, HTML Meta tags are quite powerful in the sense that using these tags one set the page refresh at a specific time and also can put your website at the top level when someone searches (*using Google Search or any other Search engine) for a specific thing related to your website..<br /><br />Have a look at it and feel the difference.. Hope this helps..<br /><br /><a href="http://www.i18nguy.com/markup/metatags.html">http://www.i18nguy.com/markup/metatags.html</a><br /><br /><br />Happy Programming :)<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2260953651718247730-84402807423745289?l=talibkhan.blogspot.com'/></div>Talib Ali Khanhttp://www.blogger.com/profile/00895700116807701467Talib.Enigmatic@gmail.com0tag:blogger.com,1999:blog-2260953651718247730.post-64430370557593645072008-04-30T06:58:00.001-07:002008-05-25T07:06:32.440-07:00Using the Google search from ASP.NETI hope that every one has thought of using the infamous Google Search in their projects/applications but couldn't figure out as to how to do this..<br /><br />Fine... now you can integrate Google Search into your applications..<br /><br />Check out the below article and figure out the truth.. <br /><br /><a href="http://www.communitymx.com/content/article.cfm?page=1&amp;cid=E8E8CE970C6AB073">http://www.communitymx.com/content/article.cfm?page=1&amp;cid=E8E8CE970C6AB073</a><br /><br /><br />Happy Programming. :)<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2260953651718247730-6443037055759364507?l=talibkhan.blogspot.com'/></div>Talib Ali Khanhttp://www.blogger.com/profile/00895700116807701467Talib.Enigmatic@gmail.com0tag:blogger.com,1999:blog-2260953651718247730.post-1871121312474992782008-04-19T02:04:00.000-07:002008-05-25T07:06:32.440-07:00Why do ASP.NET AJAX page methods have to be static?This has been a question of concern for quite sometime now.. So to solve the issue , i suggest you to have a look at the below article .<br /><br />Hope you like it . :)<br /><br /><a href="http://encosia.com/2008/04/16/why-do-aspnet-ajax-page-methods-have-to-be-static/">http://encosia.com/2008/04/16/why-do-aspnet-ajax-page-methods-have-to-be-static/</a><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2260953651718247730-187112131247499278?l=talibkhan.blogspot.com'/></div>Talib Ali Khanhttp://www.blogger.com/profile/00895700116807701467Talib.Enigmatic@gmail.com0tag:blogger.com,1999:blog-2260953651718247730.post-31756124359716674692008-04-16T00:10:00.000-07:002008-05-25T07:07:24.212-07:00Code ConversionHaving problems while converting your code from C# to VB or vice-versa ?? Then i suggest you to use <a href="http://www.codechanger.com/">http://www.codechanger.com</a>. <br /><br />Have a look at it and try it ...<br /><br /><br />Happy Programming :)<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2260953651718247730-3175612435971667469?l=talibkhan.blogspot.com'/></div>Talib Ali Khanhttp://www.blogger.com/profile/00895700116807701467Talib.Enigmatic@gmail.com1tag:blogger.com,1999:blog-2260953651718247730.post-19420472071281009602008-04-16T00:05:00.000-07:002008-05-25T07:06:32.441-07:00Easy to understand ASP.NET TutorialsWell... today while sitting in my office , i thought that what is that is needed for a new programming soul to get started with coding . Huh.... but if you want to have a look at an easier way of programming, then check out <a href="http://www.aspnettutorials.com/">http://www.aspnettutorials.com</a><br /><br />Happy Programming :)<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2260953651718247730-1942047207128100960?l=talibkhan.blogspot.com'/></div>Talib Ali Khanhttp://www.blogger.com/profile/00895700116807701467Talib.Enigmatic@gmail.com0tag:blogger.com,1999:blog-2260953651718247730.post-57392352234703912072008-04-15T04:41:00.000-07:002008-04-15T04:51:28.801-07:00Dynamic Site Layout and Style Personalization with ASP.NETThese days many websites offer customisable features and one of them is setting themes according to user preferences. In other words, we can say that generating the look and feel of the website as per user requests.<br />So now the big question arises as to how one can achieve/implement this feature. Scott Guthrie has explained this in a very conventional way. Have a look at it..<br /><br /><a href="http://weblogs.asp.net/scottgu/archive/2006/07/22/Recipe_3A00_-Dynamic-Site-Layout-and-Style-Personalization-with-ASP.NET--.aspx">http://weblogs.asp.net/scottgu/archive/2006/07/22/Recipe_3A00_-Dynamic-Site-Layout-and-Style-Personalization-with-ASP.NET--.aspx</a><a href="http://weblogs.asp.net/scottgu/archive/2006/07/22/Recipe_3A00_-Dynamic-Site-Layout-and-Style-Personalization-with-ASP.NET--.aspx"></a><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2260953651718247730-5739235223470391207?l=talibkhan.blogspot.com'/></div>Talib Ali Khanhttp://www.blogger.com/profile/00895700116807701467Talib.Enigmatic@gmail.com0tag:blogger.com,1999:blog-2260953651718247730.post-63292332768217382902008-04-14T01:58:00.000-07:002008-05-25T07:06:32.441-07:00ASP.NET Page Life CycleEach request for a Microsoft® ASP.NET page that hits Microsoft® Internet Information Services (IIS) is handed over to the ASP.NET HTTP pipeline. The HTTP pipeline is a chain of managed objects that sequentially process the request and make the transition from a URL to plain HTML text happen. The entry point of the HTTP pipeline is the HttpRuntime class. The ASP.NET infrastructure creates one instance of this class per each AppDomain hosted within the worker process...<br /><br />For a detailed scenario of Page Life Cycle, just go through<br /><a href="http://msdn2.microsoft.com/en-us/library/aa479007.aspx">http://msdn2.microsoft.com/en-us/library/aa479007.aspx</a><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2260953651718247730-6329233276821738290?l=talibkhan.blogspot.com'/></div>Talib Ali Khanhttp://www.blogger.com/profile/00895700116807701467Talib.Enigmatic@gmail.com1tag:blogger.com,1999:blog-2260953651718247730.post-68703966364940813322008-04-06T00:28:00.000-07:002008-05-25T07:07:52.692-07:00Tip/Trick:Url Rewriting with ASP.NETFor dynamically re-writing URLs or to publish cleaner URL end-points in your ASP.NET applications , just have a look at this article by Scott Guthrie.<br /><br /><a href="http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx">http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx</a><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2260953651718247730-6870396636494081332?l=talibkhan.blogspot.com'/></div>Talib Ali Khanhttp://www.blogger.com/profile/00895700116807701467Talib.Enigmatic@gmail.com0tag:blogger.com,1999:blog-2260953651718247730.post-39895995611499286992008-04-02T00:49:00.000-07:002008-04-02T00:51:55.173-07:00Displaying Date in many formats Using JavascriptHi folks,<br /><br />Just check out the below link for some cool stuff on how to display date &amp; time using Javascript in different formats.<br /><br /><a href="http://www.javascriptmall.com/jsc/jsC4Udate.htm#DateTime11">http://www.javascriptmall.com/jsc/jsC4Udate.htm#DateTime11</a><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2260953651718247730-3989599561149928699?l=talibkhan.blogspot.com'/></div>Talib Ali Khanhttp://www.blogger.com/profile/00895700116807701467Talib.Enigmatic@gmail.com0tag:blogger.com,1999:blog-2260953651718247730.post-85674394416105053222008-04-02T00:41:00.000-07:002008-05-25T07:08:13.761-07:00Two Rows of Tab Headers in an AJAX Tab ControlThere has been much talk about the AJAX's Tab control. But by default, it displays all the Tab containers in one line only. So how to make it multi lined. For doing this. check out the below article .<br /><br /><br /><br /><a href="http://www.narizvi.com/blog/post/Two-rows-of-tab-headers-in-TabContainer-in-Ajax-Control-Toolkit.aspx">http://www.narizvi.com/blog/post/Two-rows-of-tab-headers-in-TabContainer-in-Ajax-Control-Toolkit.aspx</a><div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2260953651718247730-8567439441610505322?l=talibkhan.blogspot.com'/></div>Talib Ali Khanhttp://www.blogger.com/profile/00895700116807701467Talib.Enigmatic@gmail.com0tag:blogger.com,1999:blog-2260953651718247730.post-68262209409391158782008-03-27T04:02:00.000-07:002008-05-25T07:06:32.442-07:00Don’t run production ASP.NET Applications with debug=”true” enabledOne of the things you want to avoid when deploying an ASP.NET application into production is to accidentally (or deliberately) leave the <compilation debug="”true”/">switch on within the application’s web.config file.<br /><br />Doing so causes a number of non-optimal things to happen including:<br /><br />1) The compilation of ASP.NET pages takes longer (since some batch optimizations are disabled)<br />2) Code can execute slower (since some additional debug paths are enabled)<br />3) Much more memory is used within the application at runtime<br />4) Scripts and images downloaded from the WebResources.axd handler are not cached<br /><br />This last point is particularly important, since it means that all client-javascript libraries and static images that are deployed via <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnvs05/html/webresource.asp">WebResources.axd</a> will be continually downloaded by clients on each page view request and not cached locally within the browser. This can slow down the user experience quite a bit for things like Atlas, controls like TreeView/Menu/Validators, and any other third-party control or custom code that deploys client resources. Note that the reason why these resources are not cached when debug is set to true is so that developers don’t have to continually flush their browser cache and restart it every-time they make a change to a resource handler (our assumption is that when you have debug=true set you are in active development on your site).<br /><br />When <compilation debug="”false”/">is set, the WebResource.axd handler will automatically set a long cache policy on resources retrieved via it – so that the resource is only downloaded once to the client and cached there forever (it will also be cached on any intermediate proxy servers). If you have Atlas installed for your application, it will also automatically compress the content from the WebResources.axd handler for you when <compilation debug="”false”/">is set – reducing the size of any client-script javascript library or static resource for you (and not requiring you to write any custom code or configure anything within IIS to get it).<br /><br />What about binaries compiled with debug symbols?<br /><br />One scenario that several people find very useful is to compile/pre-compile an application or associated class libraries with debug symbols so that more detailed stack trace and line error messages can be retrieved from it when errors occur.<br /><br />The good news is that you can do this without having the have the <compilation debug="”true”/">switch enabled in production. Specifically, you can use either a web deployment project or a web application project to pre-compile the code for your site with debug symbols, and then change the <compilation debug="”true”/">switch to false right before you deploy the application on the server.<br /><br />The debug symbols and metadata in the compiled assemblies will increase the memory footprint of the application, but this can sometimes be an ok trade-off for more detailed error messages.<br /><br />The <deployment retail="”true”/">Switch in Machine.config<br /><br />If you are a server administrator and want to ensure that no one accidentally deploys an ASP.NET application in production with the <compilation debug="”true”/">switch enabled within the application’s web.config file, one trick you can use with ASP.NET V2.0 is to take advantage of the <deployment>section within your machine.config file.<br /><br />Specifically, by setting this within your machine.config file:<br /><br /><configuration><br /><system.web><br /><deployment retail="”true”/"><br /></SYSTEM.WEB><br /></configuration><br /><br />You will disable the <compilation debug="”true”/">switch, disable the ability to output trace output in a page, and turn off the ability to show detailed error messages remotely. Note that these last two items are security best practices you really want to follow (otherwise hackers can learn a lot more about the internals of your application than you should show them).<br /><br />Setting this switch to true is probably a best practice that any company with formal production servers should follow to ensure that an application always runs with the best possible performance and no security information leakages. There isn’t a ton of documentation on this switch – but you can learn a little more about it <a href="http://msdn2.microsoft.com/en-US/library/ms228298(VS.80).aspx">here</a>.<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2260953651718247730-6826220940939115878?l=talibkhan.blogspot.com'/></div>Talib Ali Khanhttp://www.blogger.com/profile/00895700116807701467Talib.Enigmatic@gmail.com0