| TechTasks.net |
The Blog is Moved to www.TechTasks.net
1 . What is the difference between URL and URI?
A URL is the address of some resource on the Web, which means that normally you type the address into a browser and you get something back. There are other type of resources than Web pages, but that's the easiest conceptually. The browser goes out somewhere on the Internet and accesses something.
A URI is just a unique string that uniquely identifies something, commonly a namespace. Sometimes they look like a URL that you could type into the address bar of your Web browser, but it doesn't have to point to any physical resource on the Web. It is just a unique set of characters, that, in fact, don't even have to be unique.
URI is the more generic term, and a URL is a particular type of URI in that a URL has to uniquely identify some resource on the Web.
2 . How to convert milliseconds into time?
TimeSpan ts = TimeSpan.FromMilliseconds(10000);
Response.Write (ts.ToString () );
3 . How to include multiple vb/cs files in the source?
You can do this using assembly directives.
or
However, note that each source file will be compiled individually into its own assembly, so they cannot have dependencies on each other.
4 . How to convert a string to Proper Case?
Use the namespace System.Globalization
string myString = "syncFusion deVeloPer sUppOrt";
// Creates a TextInfo based on the "en-US" culture.
TextInfo TI = new CultureInfo("en-US",false).TextInfo;
Response.Write (TI.ToTitleCase( myString ));
For more details refer TextInfo.ToTitleCase()
5 . How can I ensure that application-level variables are not updated by more than one user simultaneously?
Use the HttpApplicationState's Lock and UnLock methods.
For more details refer : MSDN: Application State
7 . How to validate that a string is a valid date?
bool blnValid=false;
try
{
DateTime.Parse(MyString);
blnValid=true;
}
catch
{
blnValid=false;
}
8 . Are namespaces and Class names Case Sensitive?
Namespaces and Class names are case Sensitive. Namespaces imported using the @ Import Directive will cause an error if the correct case is not used.
9 . How to convert string to a DateTime and compare it with another DateTime?
bool blntimeIsOk = (DateTime.Parse("15:00") <>
19 . What is the different between and ?
The is used for databinding where as is used to output the result of an expression. The expression inside will be executed only when you call the page's or control's DataBind method. The expression inside will be executed and displayed as and when it appears in the page.
20 . What permissions do ASP.NET applications posses by default?
By default ASP.NET Web applications run as ASP.NET user. This user has limited permissions equivalent to the User Group.
21 . How can I specify the relative path for a file?
Suppose you have following file hierarchy:
default.aspx
Admin/login.aspx
Misc/testpage.aspx
And you are on the login.aspx and want your user to navigate to the default.aspx (or testpage.aspx) file. Then you can use
* Response.Redirect ("../default.aspx")
* Response.Redirect ("../Misc/testpage.aspx")
22 . 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.
23 . How to change the Page Title dynamically?
//Declare
protected System.Web.UI.HtmlControls.HtmlGenericControl Title1 ;
//In Page_Load
Title1.InnerText ="Page 1" ;
24 . Why do I get the error message "Object must implement IConvertible". How can I resolve it?
The common cause for this error is specifying a control as a SqlParameter's Value instead of the control's text value.
For example, if you write code as below you'll get the above error:
SqlParameter nameParameter = command.Parameters.Add("@name", SqlDbType.NVarChar, 50);
nameParameter.Value = txtName ;
To resolve it, specify the control's Text property instead of the control itself.
nameParameter.Value =txtName.Text;
25 . 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?
If some other default page comes higher in the list, adjust the default.aspx to be the number one entry inside the IIS configuration. If you have multiple websites inside IIS, make sure the configuration is applied on the right website (or on all websites by applying the configuration on the server-level using the properties dialog, configure WWW service).
26 . Can ASP.NET work on an NT server?
No. For more details refer ASP 1.1 version
27 . Is it possible to migrate Visual InterDev Design-Time Controls to ASP.NET?
Refer INFO: Migrating Visual InterDev Design-Time Controls to ASP.NET
28 . How to automatically get the latest version of all the asp.net solution items from Source Safe when opening the solution?
In VS.NET you can go to Tools > Options > Source Control > General and check the checkbox for Get everything when a solution opens.
This retrieves the latest version of all solution items when you open the solution.
29 . How to make VS.Net use FlowLayout as the default layout rather than the GridLayout?
For C#, go to path C:\Program Files\Microsoft Visual Studio .NET 2003\VC#\VC#Wizards\CSharpWebAppWiz\Templates\1033
Change the following line in the existing WebForm1.aspx
to
Note:Before changing any templates it's a good idea to make backup copies of them
Or rather than above approach you can change the behavior for new files on a per project basis in Visual Studio by:
1. Right clicking on the project name (Ex: "WebApplication1)" in Solution Explorer, and select "Properties".
2. From project properties window, under Common Properties>Designer Defaults>Page Layout change "Grid" to "Flow".
30 . Can I use a DataReader to update/insert/delete a record?
No. DataReader provides a means of reading a forward-only stream of rows from a database.
31 . How to format a Telphone number in the xxx-xxx-xxxx format?
double Telno= double.Parse(ds.Tables[0].Rows[0]["TelNo"].ToString());
Response.Write(Telno.ToString("###-###-####"));
32 . Can two different programming languages be mixed in a single ASPX file?
No. ASP.NET uses parsers to strip the code from ASPX files and copy it to temporary files containing derived Page classes, and a given parser understands only one language
33 . Can I use custom .NET data types in a Web form?
Yes. Place the DLL containing the type in the application root's bin directory and ASP.NET will automatically load the DLL when the type is referenced. This is also what happens when you add a custom control from the toolbox to your web form.
Blog Archive
-
▼
2008
(33)
-
►
December
(14)
- Non Editable Rows in GridView
- Validate DropDownList inside GRIDVIEW
- .Net Keyboard Shortcuts
- Grid View Operataions
- FAQ'S & INTERVIEW TIPS
- C#.NET
- ASP.NET
- DOTNET FRAMEWORK
- Projects With Source Code
- Enter Text In Into Two TextBoxes At the Same Time
- Saving Uploaded file into Disk and displaying the ...
- Writing Connection string in web.config file
- Change GridView Row Color When MouseOver
- Working With Command Builder in ASP.NET
-
▼
November
(14)
- JavaScript Validatoin For Basic Controles in ASP.N...
- Dot Net - C#.Net(FAQ'S)
- Dot Net - Asp.Net - Basic II(FAQ'S)
- Dot Net - Asp.Net - Basic I(FAQ'S)
- Famous Books For .NET
- Connecting MySql With Asp.net Using ODBC Drivers
- Simple Calculator In Windows Application Using C#
- Mail Sending Using Net.Mail
- Select All And Delete Using CheckBox In GridView
- GridView DeleteAll,SelectAll,ClearAll(Server Side)...
- GridView Paging & Sorting
- GridView Update,Delete,Adding (Insert) Record...
- Alphabetical Paging in Gridview
- Connecting MySql With C# ASP.NET
-
►
December
(14)


1 comments:
logically