KuruviDotNet






   

<< July 2017 >>
Sun Mon Tue Wed Thu Fri Sat
 01
02 03 04 05 06 07 08
09 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31


This page is for documenting my experiences with DotNet. Practical problems that I faced and solutions I found. -Pradeep Kumar


Contact Me

If you want to be updated on this weblog Enter your email here:


rss feed

Sunday, May 30, 2004
MCP-Developing web applications with VS.NET-C#" 70-315 tricks

Hi all,
I just cleared the above MCP exam, the exam is my first certification from Microsoft and will be the start of my target to achieving MCAD.NET.

The exam was very useful in certain aspects for me,

  • very useful for my job.
  • Has good career potential
  • Makes u thorough on how things should be done in web development world.

basically the exam deals with all about ASP.NET, the architecture, state management features of ASP.NET, ADO .NET, Caching and optimizing, testing and deployment of Web applications. I used the MS Press Book recommended for this certification and found it quite useful for giving a proper index and clarity of the subject. But I found it lacking in depth. The MSDN is best source for complete information, but it may take quite some time going through it, having some work exp. really helps
the following link points the sections of MSDN you have to go through

http://www.codeclinic.com/70-315skills.htm
 - an extremely good reference site.

It took me nearly 45 days for getting ready for the exam. I used some sample test papers for checking my progress.

The samples and demos did have a very less no. of questions, but if u really want to go in depth and want to do a complete test go for the one in www.transcender.com , it is good.

And those who are planning to just start a career in .NET with a certification, and who are worried about which language to choose, my advice u can choose C#, even if ur good in VB only it doesn't make much of a difference for this exam.

That's all folks!

All the Best


Posted at 05:07 pm by tpkx
Make a comment

Monday, April 12, 2004
Word-wrap in HTML tables and DATAGRIDS ASP.NET

Today I learnt a very frustrating thing with HTML tables

HTML tables TD cells don't obey wrap attributes or FIXED width settings for content with continuous text without spaces.
The text within cells only wraps if there are spaces

Here is a table with center colum of fixed width of 50 px.

     
     
     

Same table with some text in the fixed width cell that is within it.

    abcdef  
     
     

Now the text with some spaces and see it wrap.
    abc def ghi jkl mno pqr  
     
     


Now the text without spaces and see it exceed it's fixed width limit.

    abcdefghijklmnopqr  
     
     

The problem is because the word does not wrap as it is one big one.

The solution for this is to add the CSS style attribute break-word to the TD cell which has fixed width. like style="word-wrap:break-word"
After that it wraps nicely.

    abcdefghijklmnopqr  
     
     


All of these are also needed if you use Datagrids in ASP.NET.

To make a datgrid column word-wrap use the style attributes in the column template or if you are auto generating the columns use,

Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DataGrid1.ItemDataBound

e.Item.Cells([INDEX]).Style.Add("word-wrap", "break-word")
e.Item.Cells([INDEX]).Attributes.Add("width", "250px")
End sub

where index is  the column index for which you want to set the wrap property.

Posted at 07:02 pm by tpkx
Comments (1)

Monday, April 05, 2004
Command Object:

A difficult to track bug can occur when use the ADO.NET command object with parameters,
the scenario is like this you have a update statement like this
dim cmdsave as new OleDBCOmmand("update tbl1 set title=@titl where tid=100") cmdsave.parameters.add("@title","Test")
cmdsave.executeNonQuery()

The above query is perfectly correct but it will never update the title of the record of tid=100 with "Test" The problem is misspelling that is underlined in the code. This will neither cause a compile time error nor a runtime error. So be careful.

Posted at 01:41 pm by tpkx
Make a comment

setting selecteddate property of ASP.NET Calendar Control

While programmatically setting the selected date property of ASP.NET calendar control the date is visibly updated only if it is visible in the current month being displayed in the calendar, or the particular date is displayed as other month date in the current month view of the calendar.

In order to select a date in another month and refresh the view appropriately we have to set the visibledate property also.

Like

Calendar1.selectedDate="2004/05/10"
Calendar1.visibleDate="2004/05/10"

Posted at 01:29 pm by tpkx
Make a comment

Friday, March 26, 2004
Front Controller Pattern

The Page Controller pattern becomes inefficient when you need to coordinate processing across multiple Web pages because of its implementation of a single object per logical page. The Front Controller is more efficient in such cases because it funnels all requests through a single controller and then directs requests through a single handler and a hierarchy of command classes. The handler retrieves parameters from the HTTP request, chooses the correct command, and transfers processing to it. After each command object performs the specified action, it can choose which view is required to render the page properly. Implementing the Front Controller results in more centralized application control because all page requests come through a single controller instead of being handled by different Page Controllers. But this can also be a liability if the handler does expensive processing, such as database lookups that could cause the entire application to operate slowly. The handler should be as efficient as possible and use external resources only when absolutely necessary. You should also consider caching any external resources to increase the handlerfs performance.

You implement the FrontController class by creating a Handler and a CommandFactory, which determines the necessary command to execute in response to a request. ASP.NET provides the IHttpHandler interface to allow developers to create custom interfaces required to service incoming HTTP requests. You implement the Handler by inheriting from System.Web.IHttpHandler and adding the logic to instantiate and call the appropriate command from the CommandFactory. The CommandFactory defines a collection of commands and the logic that determines which of the commands should be executed. Calling the CommandFactory returns the appropriate Command object for which the Handler can call an Execute method. Using this pattern, you can create more robust navigation scenarios and implement them centrally by extending the CommandFactory logic and creating additional commands to handle the required scenarios.

Posted at 07:27 pm by tpkx
Make a comment

Next Page