Monday, October 22, 2007

Bind data directly from database to gridview:::::: <_%_#_eval_(_"productname"_)_%_>

Major differences bw gridview and data grid:::::::::::

http://msdn.microsoft.com/msdnmag/issues/04/08/GridView/

Another key difference between the DataGrid and GridView controls lies in the adaptive user
interface. Unlike the version 1.x DataGrid, the GridView can render on mobile devices, too. In other words, to build reports on mobile devices, you can use the same grid control you would use for desktop pages. The DataGrid in version 2.0 can also render adaptively, but its UI capabilities are not quite as rich as those of the GridView
To deploy a com component and use it in .net::::::::::::

can use type library importer to convert a com dll to .net dll
or
blindly give a reference of com component in the com tab section in add references and start using it as if a normal .net dll.
RCW -- Runtime callable wrapper class acts here and performs as if its a .net dll

Wannna share a dll across applications?? :::::::::::
goto .net cmd
sn.exe -k
include the file name in assembly info assemblykeyfile("whole filename path") build the project.
copy the dll and put it in gac
Online C# to VB.NET code converter:::::::::::::
http://www.eggheadcafe.com/articles/cstovbweb/converter.aspx

There an expression repository at this link:::::::::::
http://www.regexlib.com/

.net faqs: ::::::::::
http://www.andymcm.com/dotnetfaq.htm#1.1

Awesome site on .net faqs::::::::::::::
http://www.dotnetinterviewfaqs.com/
http://www.techinterviews.com/?p=316#more-316
Choosing a Page Model::::::::::::::::::

The single-file and code-behind page models are functionally the same. At run time, the models execute the same way, and there is no performance difference between them. Choosing a page model therefore depends on other factors, such as how you want to organize the code in your application, whether it is important to separate page design from coding, and so on.

Advantages of Single-File Pages
As a rule, the single-file model is suitable for pages in which the code consists primarily of event handlers for the controls on the page.

Advantages of the single-file page model include the following:
In pages where there is not very much code, the convenience of keeping the code and markup in the same file can outweigh other advantages of the code-behind model. For example, it can be easier to study a single-file page because you can see the code and the markup in one place.


Pages written using the single-file model are slightly easier to deploy or to send to another programmer because there is only one file.

Because there is no dependency between files, a single-file page is easier to rename.

Managing files in a source code control system is slightly easier, because the page is self-contained in a single file.

Advantages of Code-Behind PagesCode-behind pages offer advantages that make them suitable for Web applications with significant code or in which multiple developers are creating a Web site.

Advantages of the code-behind model include the following:

Code-behind pages offer a clean separation of the markup (user interface) and code. It is practical to have a designer working on the markup while a programmer writes code.

Code is not exposed to page designers or others who are working only with the page markup.

Code can be reused for multiple pages.

Compilation and Deployment
Compilation and deployment of both single-file and code-behind pages is similar. At its simplest, you copy the page to the target server. If you are working with code-behind pages, you copy both the .aspx page and the code file. When the page is first requested, ASP.NET compiles the page and runs it. Note that in both scenarios you deploy source code with the markup.

Alternatively, you can precompile your Web site. In that case, ASP.NET produces object code for your pages that you can copy to the target server. Precompilation works for both single-file and code-behind models, and the output is the same for both models.
Managing ASP.NET Navigation:::::::::::::::::: http://www.ondotnet.com/pub/a/dotnet/2003/04/07/aspnetnav.html
Differences between Server.Transfer and Response.Redirect::::::::::::::::::::::

Redirect and Transfer both cause a new page to be processed. But the interaction between the client (web browser) and server (ASP.NET) is different in each situation.

Redirect: A redirect is just a suggestion – it’s like saying to the client “Hey, you might want to look at this”. All you tell the client is the new URL to look at, and if they comply, they do a second request for the new URL.
If you want to pass state from the source page to the new page, you have to pass it either on the URL (such as a database key, or message string), or you can store it in the Session object (caveat: there may be more than one browser window, and they’ll all use the same session object).
Transfer: A transfer happens without the client knowing – it’s the equivalent of a client requesting one page, but being given another. As far as the client knows, they are still visiting the original URL.


Sharing state between pages is much easier using Server.Transfer – you can put values into the Context.Items dictionary, which is similar to Session and Application, except that it lasts only for the current request. (search for HttpContext in MSDN). The page receiving postback can process data, store values in the Context, and then Transfer to a page that uses the values.

Awesome Difference::::::::
Response.Redirect sends message to browser saying that the browser should request some other page so basically it means that:
1. Browser is on page default1.aspx on which there is a Response.Redirect("") command which means that the server sends response (message) to browser that browser should request some other page default2.aspx

2. Browser sends request to server in order to get this page default2.aspx
3. Server sends page default2.aspx to browser

Server.Transfer doesn't tell the browser to request page default2.aspx. It just sends page default2.aspx, so e.g., browser address bar still shows the original page's URL.

Roundtrip is the combination of a request being sent to the server and response being sent back to browser.

Request is the message that the browser sends to the server and Response is the message the server sends back to the browser.

refernece: http://weblogs.asp.net/rosherove/archive/2003/08/11/23550.aspx