z
 
:: Home     :: MS Dynamics CRM     :: .Net 1.1     :: .Net 2.0     :: Sharepoint Portal     :: Ajax

  login:        
  passwords:  
 

Resources

Finding Correct Content Managemet System
This list covers the full lifecycle of a content management system, from initially creating the content, through to delivering it to end users...

Workflow Managemet Systems
Workflow management is a crucial component in organizing a variety of business processes so that they benefit the business as a whole and increase profitability...

Using the Power of Content Management Systems
With page editors that resemble a word processor program, adding content with a CMS interface is simple and fun. Most CMS software also allows you to change the location of your content pages and links easily, while the back end processes takes care of updating the links throughout your site...

Content Management Systems (CMS): What They Are And Why We Love Them
In the past, individuals who took interest in having and operating their own websites were burdened with the task of learning HTML, DHTML, and other web-based technologies such as JavaScript and CSS. The only alternative to this was, unfortunately, to pocket the expenses and costs required to pay a web developer to build and maintain it for them...

Outsourcing
Post your project for outsourcing and get bids from qualified programmers, designers, interpreters, copywriters.


 

Code Walkthroughs

Datagrid Formatting the Data
We are able to format the content of the datagrid cell by one of two simple methods, dependant upon whether the column is a bound column or whether it is a template column. In our example we shall format the column to have to digits after the decimal point , followed by a...

Datagrid Highlight a Row With Click Through
It is relatively easy to add alternating colours to the rows in your datagrid. However, when we move the mouse over the rows we may want to highlight this row, and possibly to add the option of a click through based on the row selected...

Add a Delete Button to a Datagrid
To add a delete button to a datagrid follows a similar process to adding an edit button. In the datagrid header...

Add an Edit Button to a Datagrid
The datagrid has a predefined editColumn for handling the editing of a datagrid. Adding this simple column definition to a datagrid adds a powerful feature. When a row is not in edit mode the column item shows the word...

Making a Datagrid Row Editable
Two of the most popular methods of editing a datagrid in asp.net are to either select the row and take the user off to a different presentation of the data, or to change the formatting of the row presented in the database with appropriate edit text boxes, checkboxes and...

Adding Tooltips to Datagrid Rows
Adding tooltips to datagrid rows is easy, assuming that you have already created the code for adding row highlighting. In this article I shall assume that you have already read the article entitled Datagrid Highlight a Row With Click Through...

Binding a Datagrid to an Access Database
This list covers the full lifecycle of a content management system, from initially creating the content, through to delivering it to end users...

Adding Data to a DropDownList
The aim of this article is to answer the question 'How do I add items to a DropDownList?' Initially as part of the declaration for the DropDownList we can also define a number of items, much in the same way as in classic ASP...

Getting Current Date Time
In classic ASP we had now() which would return the current date and time. For asp.net this no longer exists. So what should we use...

Test if File Exists
Sometimes, in order to reduce our chance of error, when working with the filesystem in ASP.NET, we need to determine wether a file exists before performing an action on it. The following short piece of code will enable us to test whether a file exists...

Using Javascript with ASP.NET Form Elements
Adding simple pieces of Javascript to an Asp.net page can be acheived by adding to the attributes of the particular imagebutton or linkbutton. if its normal ASP.Net Button then you can...

Regular Expressions
In the table below we list the characters used in .Net regular expressions, together with their meaning, But first...

Authentication in Asp.net
Forms authentication in ASP.Net is far more easier and safe than Asp 3. It is possible to place a web.config file in any directory of a web site.Therefore, we are able to make most of a web site public, whilst providing authentication on, say, one directory...

Discussion Forums

General ASP.NET

.Net Programming

cSharp Home

Sql Server Home

Javascript / Client Side Development

IT Jobs

Ajax Programming

Ruby on Rails Development

Perl Programming

C Programming Language

C++ Programming

Python Programming Language

Laptop Suggestions?

TCL Scripting

Fortran Programming

Scheme Programming

2. Basic

FAQ Home
   2.1 What is ASP.NET?
   2.2 Why does my ASP.NET file have multiple <form> tag with runat=server?
   2.3 How to find out what version of ASP.NET I am using on my machine?
   2.4 Is it possible to pass a querystring from an .asp page to aspx page?
   2.5 How to comment out ASP.NET Tags?
   2.6 What is a ViewState?
   2.7 Where can I get the details on Migration of existing projects using various technologies to ASP.NET?
   2.8 What is the equivalent of date() and time() in ASP.NET?
   2.9 How to prevent a button from validating it's form?
   2.10 How to get the IP address of the host accessing my site?
   2.11 How to access the Parameters passed in via the URL?
   2.12 How to Set Focus to Web Form Controls By Using Client-Side Script?
   2.13 How to display a Wait page while a query is running?
   2.14 How to implement Form based Authentication in ASP.NET application?
   2.15 How to catch the 404 error in my web application and provide more useful information?
   2.16 Is there a method similar to Response.Redirect that will send variables to the destination page other than using a query string or the post method?
   2.17 What are the differences between HTML versus Server Control?
   2.18 How can I change the action of a form through code?
   2.19 Is there any control that allows user to select a time from a clock - in other words is there a clock control?
   2.20 How to Compare time?
   2.21 How To work with TimeSpan Class?
   2.22 Where can I get information on Cookies in ASP.NET?
   2.23 Does ASP.Net still recognize the global.asa file?
   2.24 How should I destroy my objects in ASP.Net?
   2.25 Are there resources online with tips on ASP to ASP.Net conversions?
   2.26 How do I publish my ASP.NET application to my ISP's web server?
   2.27 Why do i get error message "Could not load type" whenever I browse to my ASP.NET web site?
   2.28 Will the WebMatrix SqlDataSourceControl work with a MySQL connection?
   2.29 Can I combine classic ASP and ASP.NET pages?
   2.30 What is the difference between src and Code-Behind?
   2.31 How can I get the value of input box with type hidden in code-behind?
   2.32 I have created a .NET user control page (.ascx) but I cannot compile and run it.
   2.33 What is a .resx file?
   2.34 Is it possible to use a style sheet class directly on a control instead of using inline or page-level formatting ?
   2.35 Can I recieve both HTML markup for page and code in the ASP.NET web page's source code portion in the Web browser?
   2.36 Why can't I put <%@ Page Language="C " %> where at the top of an ASPX file and write my server-side scripts in C ?
   2.37 ASP pages that worked pefectly on Windows 2000 Server and IIS 5.0 do not work on Windows 2003 Server with IIS 6.0. ASP.NET pages work fine. Why?
   2.38 Why do I get error message "Error creating assembly manifest: Error reading key file 'key.snk' -- The system cannot find the file specified"?
   2.39 How to get URL without querystring?
   2.40 What is the best way to output only time and not Date?
   2.41 Do I have to compile code if I am changing the content of my aspx.cs file?
   2.42 How to grab the referring URL?
   2.43 My ASP code gives an error "Compiler Error Message: BC30289: Statement cannot appear within a method body. End of method assumed" when changed to .aspx?
   2.44 How can I save images ?
   2.45 How can I logout when using FormsAuthentication?
   2.46 Why do I get a blank page when I use Server.Transfer("page1.htm") to transfer to a different page?
   2.47 How to detect the User's culture?
   2.48 What is the difference between CurrentCulture property and the CurrentUICulture property?
   2.49 Can I read the hard disk serial # of the client computer using ASP.NET?
   2.50 What is xxx(src As Object, e As EventArgs)?
   2.51 What is the difference between Absolute vs Relative URLs?
   2.52 What is the difference between URL and URI?
   2.53 How to convert milliseconds into time?
   2.54 How to include multiple vb/cs files in the source?
   2.55 How to convert a string to Proper Case?
   2.56 How can I ensure that application-level variables are not updated by more than one user simultaneously?
   2.57 Why do I get the error message "System.InvalidOperationException: It is invalid to show a modal dialog or form when the application is not running in UserInteractive mode. Specify the ServiceNotification or DefaultDesktopOnly style to display a ...."?
   2.58 How to validate that a string is a valid date?
   2.59 Are namespaces and Class names Case Sensitive?
   2.60 How to convert string to a DateTime and compare it with another DateTime?
   2.61 How to get the url of page dynamically?
   2.62 How to convert user input in dMy format to Mdy?
   2.63 When the User is prompted a File Download dialogbox, if the user selects "Save" then the "Save as" dialog box is displayed. Is there any way for me to retrieve the filename and directory path specified by the user on the File Download dialog box?
   2.64 How to hide or show Controls in server side code?
   2.65 How to check if the user is using a secure or non secure connection?
   2.66 Is it possible to write code in many languages in one ASP.NET project?
   2.67 What is the difference between Response.Redirect() and Server.Transfer().
   2.68 How to get the hostname or IP address of the server?
   2.69 What is the meaning of validateRequest=true in .net framework1.1?
   2.70 What is the different between <%# %> and <%= %>?
   2.71 What permissions do ASP.NET applications posses by default?
   2.72 How can I specify the relative path for a file?
   2.73 How can I specify the "upload a file" input textbox in a form to be read only so that the user can click on the browse button and pick a file but they cannot type anything into the textbox next to the browse button.
   2.74 How to change the Page Title dynamically?
   2.75 Why do I get the error message "Object must implement IConvertible". How can I resolve it?
   2.76 Why is default.aspx page not opened if i specify http://localhost. I am able to view this page if i hardcode it as http://localhost/default.aspx?
   2.77 Can ASP.NET work on an NT server?
   2.78 Is it possible to migrate Visual InterDev Design-Time Controls to ASP.NET?
   2.79 How to automatically get the latest version of all the asp.net solution items from Source Safe when opening the solution?
   2.80 How to convert the datetime into a string for use in the SQL ' statement?
   2.81 How to make VS.Net use FlowLayout as the default layout rather than the GridLayout?
   2.82 Can I use a DataReader to update/insert/delete a record?
   2.83 What is the difference between Server.Transfer and Server.Execute?
   2.84 How to create a login screen in ASP.NET?
   2.85 How to format a Telphone number in the xxx-xxx-xxxx format?
   2.86 Can two different programming languages be mixed in a single ASPX file?
   2.87 Can I use custom .NET data types in a Web form?
   2.88 How can I have a particular Web page in an ASP.NET application which displays its own error page.



2.1 What is ASP.NET?


ASP.NET is a programming framework built on the common language runtime that can be used on a server to build powerful Web applications.

For more details refer

 


2.2 Why does my ASP.NET file have multiple <form> tag with runat=server?


This means that ASP.Net is not properly registered with IIS.
.Net framework provides an Administration utility that manages the installation and uninstallation of multiple versions of ASP.NET on a single machine. You can find the file in C:\WINNT\Microsoft.NET\Framework\v**\aspnet_regiis.exe


use the command: aspnet_regiis.exe -u ---> to uninstall current asp.net version.
use the command: aspnet_regiis.exe -i ---> to install current asp.net version.


For Windows Server 2003, you must use aspnet_regiis -i -enable
This is because of the "Web Service Extensions" feature in IIS 6

(if you install VS.NET or the framework without IIS installed, and then go back in and install IIS afterwards, you have to re-register so that ASP.NET 'hooks' into IIS properly."


2.3 How to find out what version of ASP.NET I am using on my machine?


VB.NET


Response.Write(System.Environment.Version.ToString() )


C#


Response.Write(System.Environment.Version.ToString() );



2.4 Is it possible to pass a querystring from an .asp page to aspx page?


Yes you can pass querystring from .asp to ASP.NET page .asp


<%response.redirect "webform1.aspx?id=11"%>


.aspx
VB.NET


Response.Write (Request("id").ToString ())


C#


Response.Write (Request["id"].ToString ());



2.5 How to comment out ASP.NET Tags?



<%--<asp:Label id="Label1" style="Z-INDEX: 101; LEFT: 8px; POSITION: absolute; TOP: 48px" runat="server">Label</asp:Label>--%>



2.6 What is a ViewState?


In classic ASP, when a form is submitted the form values are cleared. In some cases the form is submitted with huge information. In such cases if the server comes back with error, one has to re-enter correct information in the form. But submitting clears up all form values. This happens as the site does not maintain any state (ViewState).

In ASP .NET, when the form is submitted the form reappears in the browser with all form values. This is because ASP .NET maintains your ViewState. ViewState is a state management technique built in ASP.NET. Its purpose is to keep the state of controls during subsequent postbacks by the same user. The ViewState indicates the status of the page when submitted to the server. The status is defined through a hidden field placed on each page with a <form runat="server"> control.


<input type="hidden" name= "__VIEWSTATE"value="dDwyNTA3OTU0NDM7Oz7t5TntzkOUeB0QVV6FT2hvQwtpPw==" />


If you want to NOT maintain the ViewState, include the directive <%@ Page EnableViewState="false"%> at the top of an .aspx page If you do not want to maintain Viewstate for any control add the attribute EnableViewState="false" to any control. For more details refer The ASP.NET View State


2.7 Where can I get the details on Migration of existing projects using various technologies to ASP.NET?


Microsoft has designed Migration Assistants to help us convert existing pages and applications to ASP.NET. It does not make the conversion process completely automatic, but it will speed up project by automating some of the steps required for migration.
Below are the Code Migration Assistants

  • ASP to ASP.NET Migration Assistant
  • PHP to ASP.NET Migration Assistant
  • JSP to ASP.NET Migration Assistant
Refer Migrating to ASP.Net

 


2.8 What is the equivalent of date() and time() in ASP.NET?


VB.NET


System.DateTime.Now.ToShortDateString()
System.DateTime.Now.ToShortTimeString()


C#


System.DateTime.Now.ToShortDateString();
System.DateTime.Now.ToShortTimeString();



2.9 How to prevent a button from validating it's form?


Set the CauseValidation property of the button control to False


2.10 How to get the IP address of the host accessing my site?


VB.NET


Response.Write (Request.UserHostAddress.ToString ())


C#


Response.Write (Request.UserHostAddress.ToString ());



2.11 How to access the Parameters passed in via the URL?


Call the Request.QueryStringmethod passing in the key. The method will return the parameter value associated with that key. VB.NET


Request.QueryString("id")


C#


Request.QueryString["id"];



2.12 How to Set Focus to Web Form Controls By Using Client-Side Script?



<script language="javascript">
function SetFocus()
{
     // W3C approved DOM code that will work in all modern browsers     
     if (document.getElementById)
          document.getElementById('txt2').focus();
     else
     // To support older versions of IE:
     if (document.all)
          document.all("txt2").focus();
     return false;
}
</script>



<body MS_POSITIONING="GridLayout" onload="SetFocus()">
<form id="Form1" method="post" runat="server">
     Enter 1:
     <asp:TextBox ID="txt1" Runat="server" Width="50" />
     <br>
     Enter 2:
     <asp:TextBox ID="txt2" Runat="server" Width="50" />
     <br>
     <asp:Button id="Button1" runat="server" Text="Button1"></asp:Button>
</form>
</body>


Refer Sample IE Code


2.13 How to display a Wait page while a query is running?


Refer Asynchronous Wait State Pattern in ASP.NET


2.14 How to implement Form based Authentication in ASP.NET application?


For

 


2.15 How to catch the 404 error in my web application and provide more usefu