You are on page 1of 6

Asp.net 2.

0 Interview Questions and Answers

Explain .NET architecture and framework? What is the difference between Microsoft .Net Framework 1.1, 2.0 and 3.5 ?

No Accepted answer found .... View Answer


What is Microsoft Asp.Net? Explain please

No Accepted answer found .... View Answer


Explain the Event Life cycle of ASP.NET 2.0?

Answer :: The events occur in the following sequence. Its best to turn on tracing(&lt;% @Page Trace=&rdquo;true&rdquo;%&gt;) and track the flow of events : <u>PreInit</u> &ndash; This event represents the entry point of the page life cycle. If you need to change the Master page or theme programmatically, then this would be the event to do so. Dynamic controls are created in this event. <u>Init </u>&ndash; Each control in the control collection is initialized. <u>Init Complete*</u> - Page is initialized and the process is completed. <u>PreLoad*</u> - This event is called before the loading of the page is completed. .... Read More
What is use of the AutoEventWireup attribute in the Page directive ?

Answer :: It's a Boolean attribute which indicates whether the asp.net pages events are auto-wired. Bydefault its value is false We can specify the default value of the AutoEventWireup attribute in the following locations: - The Machine.config file. - The Web.config file. - Individual Web Forms (.aspx files). - Web User Controls (.ascx files) .... Read More
What is Cross Page Posting? How is it done?

Answer :: By default, ASP.NET submits a form to the same page. In cross-page posting, the form is submitted to a different page. This is done by setting the &lsquo;PostBackUrl&rsquo; property of the button(that causes postback) to the desired page. In the code-behind of the page to which the form has been posted, use the &lsquo;FindControl&rsquo; method of the &lsquo;PreviousPage&rsquo; property to reference the data of the control in the first page. .... Read More
Does ViewState affect performance? What is the ideal size of a ViewState? How can you compress a viewstate?

Answer :: Viewstate stores the state of controls in HTML hidden fields. At times, this information can grow in size. This does affect the overall responsiveness of the page, thereby affecting performance. The ideal size of a viewstate should be not more than 25-30% of the page size. Viewstate can be compressed to almost 50% of its size. .NET also provides the GZipStream or DeflateStream

to compress viewstate. .... Read More


Can I deploy the application without deploying the source code on the server?

Answer :: Yes. You can obfuscate your code by using a new precompilation process called &lsquo;precompilation for deployment&rsquo;. You can use the aspnet_compiler.exe to precompile a site. This process builds each page in your web application into a single application DLL and some placeholder files. These files can then be deployed to the server. You can also accomplish the same task using Visual Studio 2005 by using the Build-&gt;Publish menu. ....
Read More

What is XHTML? Are ASP.NET Pages compliant with XHTML?

Answer :: In simple words, XHTML is a stricter and cleaner version of HTML. XHTML stands for EXtensible Hypertext Markup Language and is a W3C Recommendation. Yes, ASP.NET 2.0 Pages are XHTML compliant. However the freedom has been given to the user to include the appropriate document type declaration. .... Read More
This is the error that pops up below when I visit their website. Hunter Valley Gardens is the subject that suppose to come up instead of this error message. Server Error in '/' Application. --------------------------------------... Value cannot be null. Parameter name: layer Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentNullException: Value cannot be null. Parameter name: layer Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace:

[ArgumentNullException: Value cannot be null. Parameter name: layer] DevExpress.Xpo.Session.SessionInitConnec... layer, IDisposable[] disposeOnDisconnect) +138

DevExpress.Xpo.Session..ctor(IDataLayer layer, IDisposable[] disposeOnDisconnect) +197 Pegboard.EngineCore.Data.DataController.... +117 Pegboard.EngineCore.Core.WebSiteRequestC... +1565 Pegboard.EngineCore.Core.WebSiteRequestC... +103 Pegboard.SiteEngine.Global_asax.Applicat... sender, EventArgs e) +474 System.Web.SyncEventExecutionStep.System... +92 System.Web.HttpApplication.ExecuteStep(I... step, Boolean completedSynchronously) +64

--------------------------------------... Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

Answer :: Problem is at their end. .... Read More


HELP HELP HELP! i must create an account so that i can see my grades and it says Server Error in '/' Application. Source Error:

[No relevant source lines]

Source File: c:\WINDOWS\Microsoft.NET\Framework64\v2.... ASP.NET Files\root\5c67f96f\9a53a53f\App_Web_reg... Line: 0 Stack Trace:

[HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (ctl00$mainCopy$CreateUserWizard1$Create... System.Web.HttpRequest.ValidateString(St... s, String valueName, String collectionName) +2703857 System.Web.HttpRequest.ValidateNameValue... nvc, String collectionName) +167 System.Web.HttpRequest.get_Form() +176 System.Web.HttpRequest.get_HasForm() +2697145 System.Web.UI.Page.GetCollectionBasedOnM... dontReturnNull) +54 System.Web.UI.Page.DeterminePostBackMode... +85 System.Web.UI.Page.ProcessRequestMain(Bo... includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4479040 System.Web.UI.Page.ProcessRequest(Boolea... includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4474336 System.Web.UI.Page.ProcessRequest() +91

System.Web.UI.Page.ProcessRequest(HttpCo... context) +319 ASP.register_aspx.ProcessRequest(HttpCon... context) in c:\WINDOWS\Microsoft.NET\Framework64\v2.... ASP.NET Files\root\5c67f96f\9a53a53f\App_Web_reg... System.Web.CallHandlerExecutionStep.Syst... +638 System.Web.HttpApplication.ExecuteStep(I... step, Boolean completedSynchronously) +177

--------------------------------------... Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

WHAT SHOULD I DO?

Answer :: This is not your fault. It is an error on the page. Try again later or if the problem still occurs contact technical support. .... Read More
Does anybody know of a good .net based web app vulnerability testing software/server? I am looking for something like OWASP's WebGoat, but for C#/ASP. NET 2.0 code, rather than Java. Any ethical web app hackers or INFOSEC Pros with knowledge in this area or some wisdom to be shared?

Answer :: <a href="http://rds.yahoo.com/_ylt=A0geu_FjOG5J12kBDIJXNyoA;_ylu=X3oDMTBybnZlZnRlBHNlYwNzcgRwb3M DMQRjb2xvA2FjMgR2dGlkAw-/SIG=11qi9d784/EXP=1232046563/**http%3a//secunia.com/software_inspector/">http://rds.yahoo.com/_ylt=A0 geu_FjOG5J12...</a> .... Read More


I'm making Login System in ASP .NET 2.0 with vb in Visual Web Developer 2005. I have created default, login and sign up page Successfully but I can't create admins page Successfully. I have problem for admins special page. I want to when admin logins in our site project, he can get special page where can admins new login so now you can understand my problem. I want only, Admins get his New Page [Not a Public Default.aspx page] but I don't know Which scrip I use in Default.aspx.vb via for connect Admin.aspx? Thank you...

Answer :: Download the CoverYourASP site (<a href="http://coveryourasp.com/DownloadCYA.asp" rel="nofollow">http://coveryourasp.com/DownloadCYA.asp</a> ) - it's just about all the code you'll need for an ASP site. .... Read More
How do I add pictures to a sql server 2005 database with asp.net 2.0, c#, and retrieve the image? Thank you.

Answer :: This method is a Button Click in you Page.cs only you most change the string connection and commandText for you query protected void ButtonUpload_Click(object sender, EventArgs e)

{ if (FileUpload1.HasFile) { HttpPostedFile _HPFimagen = FileUpload1.PostedFile; Byte[] _byteImagen = new Byte[_HPFimagen.ContentLength]; _HPFimagen.InputStream.Read(_byteImagen, 0, FileUpload1.PostedFile.ContentLength); string stringConnection = "The ConnectionString"; string commandText = "Insert into Table (value)" + "values (@Image)"; SqlConnection connection = null; try { connection = new SqlConnection(stringConnection); connection.Open(); SqlCommand command = new SqlCommand(commandText, connection); SqlParameter sqlParameter = new SqlParameter("@Imagen", System.Data.SqlDbType.Image); sqlParameter.Value = _byteImagen; command.Parameters.Add(sqlParameter); command.ExecuteNonQuery(); } catch (Exception ex) { throw new Exception(ex.Message); } finally { if (connection != null) connection.Close(); } } } and you Page.aspx have two controls &lt;asp:FileUpload ID="FileUpload1" runat="server" /&gt; &lt;asp:Button ID="ButtonUpload" runat="server" onclick="ButtonUpload_Click" /&gt; .... Read More
I made a web site in asp.net 2.0 and I have it online but I do not know how to make the default page my home page? Here is the web site: mayelectric.net

and here is what I want to make the home page: mayelectric.net/default.aspx Thanks

Answer :: Remove the index.html from your site. If the page still doesn't work. rename it to index.aspx. But, default.aspx should work. .... Read More
I am using asp.net 2.0. I am using grid view to display data from data base. In grid view for one column i don't want to show all data from database, i want to show only first 10 characters only. i also tried using width property, but it doesn't work.

Answer :: &lt;asp:GridView runat="server" ID="gv" AutoGenerateColumns="False"&gt; &lt;Columns&gt; &lt;asp:TemplateField&gt; &lt;ItemTemplate&gt; &lt;%# (Eval("Name").ToString().Length &gt;=10) ? Eval("Name").ToString().Substring(0, 10) : Eval("Name") %&gt; &lt;/ItemTemplate&gt; &lt;/asp:TemplateField&gt; &lt;/Columns&gt; &lt;/asp:GridView&gt;

Before you truncate the first 10 characters, you need to verify that the string you're truncating is actually more than 10 characters long or you'll get an "IndexOutOfRange Exception" In the above I assumed that the field you're truncating is called Name. &lt;%# Eval("Name") %&gt; will return the whole field. In the above, I test if the returned value's length is greater than 10. If yes, I truncated the string to display the first 10 characters. Otherwise, I display all of the field. For a better approach, you can try to handle the RowDataBound event of the GridView. Hope this helps. .... Read More

You might also like