November 4, 2018

Srikaanth

Huawei Most Frequently Asked Latest ASP.NET Interview Questions Answers

How To Work With Timespan Class?

VB.NET
Dim adate As DateTime = DateTime.Parse("06/24/2003")
Dim bdate As DateTime = DateTime.Parse("06/28/2003")
Dim ts As New TimeSpan(bdate.Ticks - adate.Ticks)
Response.Write(ts.TotalDays & "")
Response.Write(ts.TotalHours & ":" & ts.TotalMinutes & ":" & ts.Total Seconds & ":" & ts.TotalMilliseconds)

C#
DateTime adate = DateTime.Parse("06/24/2003");
DateTime bdate = DateTime.Parse("06/28/2003");
TimeSpan ts = new TimeSpan (bdate.Ticks - adate.Ticks);
Response.Write(ts.TotalDays.ToString () + "");
Response.Write(ts.TotalHours.ToString() + ":" + ts.Total Minutes. ToString() + ":" + ts.Total Seconds.ToString() + ":" + ts.Total Milli seconds.ToString() );

Where Can I Get Information On Cookies In Asp.net?

Refer Mike Pope's article Basics of Cookies in ASP.NET.

Does Asp.net Still Recognize The Global.asa File?

ASP.Net does not recognize the standard ASP global.asa file. Instead it uses a file named global.asax with the same - plus additional - functionality.

How Should I Destroy My Objects In Asp.net?

ASP.Net actually has very solid internal garbage collection. So this is not an issue as it was in previous versions of Active Server Pages.

Are There Resources Online With Tips On Asp To Asp.net Conversions?

Microsoft has deisnged The ASP to ASP.NET Migration Assistant help us convert ASP 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. The following Code Migration Assistants are discussed in the link below.

ASP to ASP.NET Migration Assistant
PHP to ASP.NET Migration Assistant
JSP to ASP.NET Migration Assistant

How Do I Publish My Asp.net Application To My Isp's Web Server?

Your ISP must first create an IIS application and apply the Front Page Server Extensions to it. Then in Visual Studio.NET, select the "Project | Copy Project" menu. Then enter the URL and select the FrontPage web access method. The "Copy Project" feature copies all of the necessary files to your ISP's machine for your ASP.NET application to run.

You can also FTP your files to your ISP web server. But you must know which files to upload.
Huawei Most Frequently Asked Latest ASP.NET Interview Questions Answers
Huawei Most Frequently Asked Latest ASP.NET Interview Questions Answers

Why Do I Get Error Message "could Not Load Type" Whenever I Browse To My Asp.net Web Site?

Your code-behind files for either your .aspx or the global.aspx page have not been complied. Use Visual Studio .NET's "Build | Build Solution" menu, or run the command line compiler.

Will The Webmatrix Sqldatasourcecontrol Work With A Mysql Connection?

SqlDataSourceControl lets you connect and work with MS SQL DB, while AccessDataSourceControl do the same thing but for MS Access DB. Therefore SqlDataSourceControl can't help you in your MySql connectivity .
For Connectivity with MySql refer Accessing MySQL Database with ASP.NET.

Can I Combine Classic Asp And Asp.net Pages?

No.

ASP pages can run in the same site as ASP.NET pages, but you can't mix in a page. Also ASP and ASP.NET won't share their session.

What Is The Difference Between Src And Code-behind?

Src attribute means you deploy the source code files and everything is compiled JIT (just-in-time) as needed. Many people prefer this since they don't have to manually worry about compiling and messing with dlls -- it just works. Of course, the source is now on the server, for anyone with access to the server -- but not just anyone on the web.

CodeBehind attribute doesn't really "do" anything, its just a helper for VS.NET to associate the code file with the aspx file. This is necessary since VS.NET automates the pre-compiling that is harder by hand, and therefore the Src attribute is also gone. Now there is only a dll to deploy, no source, so it is certainly better protected, although its always decompilable even then.

How Can I Get The Value Of Input Box With Type Hidden In Code-behind?

You can set the runat= server for the hidden control and you can use ControlName.Value to get its value in CodeBehind file.

How To Include Multiple Vb/cs Files In The Source?

You can do this using assembly directives.
<%@ assembly src="test1.vb" %>
<%@ assembly src="test2.vb" %>
or
<%@ assembly src="test1.cs" %>
<%@ assembly src="test2.cs" %>

However, note that each source file will be compiled individually into its own assembly, so they cannot have dependencies on each other.

How To Convert A String To Proper Case?

Use the namespace System.Globalization.VB.NET
Dim myString As String = "syncFusion deVeloPer sUppOrt" 'Creates a TextInfo based on the "en-US" culture.
Dim TI As TextInfo = New CultureInfo("en-US", False).TextInfo
Response.Write(TI.ToTitleCase(myString))

C#
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 ));

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.

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 ...."?

You can't use MsgBox or MessageBox.Show in ASP.NET WebForm. You maybe use
VB.NET
Response.Write("<script>alert('Hello');</script>")

C#
Response.Write("<script>alert('Hello');</script>");

How To Validate That A String Is A Valid Date?

VB.NET
Dim blnValid As Boolean = False
Try
DateTime.Parse(MyString)
blnValid = True
Catch
blnValid = False
End Try

C#
bool blnValid=false;
try
{
DateTime.Parse(MyString);
blnValid=true;
}
catch
{
blnValid=false;
}

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).

Can Asp.net Work On An Nt Server?

No.

For more details refer ASP 1.1 version.

Is It Possible To Migrate Visual Interdev Design-time Controls To Asp.net?

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.

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.

Subscribe to get more Posts :