This is a discussion on .Net Interview Questions within the Interview Questions forums, part of the Interviews and Job Listings category; Hello, Three questions i want to clarify 1.How we can use an old component(or third party component in ...
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
.Net Interview Questions
Hello,
Three questions i want to clarify 1.How we can use an old component(or third party component in our .net application) 2.What are all the files created with asp.net application 3.Difference between server.transfer and response.redirect Please help me Pramod.M |
|
|||
|
Re:.Net Interview Questions
Pramodm,
1.How we can use an old component(or third party component in our .net application) .NET COM Interoperability Here is the code sample you can take a look. http://www.c-sharpcorner.com/Code/20...nteropP1AJ.asp http://www.c-sharpcorner.com/Downloa...nterOpCode.zip 2.What are all the files created with asp.net application Depending on tha language you use, it create aspx and cs or vb extenstion pages. you can take a look at the complete structure, just by creating a dummy project from Visual studio .net. it create config files too, like web.config,global.asax,global.asax.vb. 3.Difference between server.transfer and response.redirect Response.Redirect simply sends a message down to the browser, telling it to move to another page. So, you may run code like Response.Redirect(\"WebForm1aspx\" orResponse.Redirect(\"http://www.exforsys.com/\") to send the user to another page. Server.Transfer is similar in that it sends the user to another page with a statement such as Server.Transfer(\"WebForm1.aspx\" . However, this has few advantages and disadvantages.Firstly, transferring to another page using Server.Transfer conserves server resources. Instead of telling the browser to redirect. transfer\" process can work on only those sites running on the server, you can\'t use Server.Transfer to send the user to an external site. Only Response.Redirect can do that. Response.Redirect simply tells the browser to visit another page. Server.Transfer helps reduce server requests, keeps the URL the same and, with a little bug-bashing, allows you to transfer the query string and form variables. Here is very good article on this. http://www.csharpfriends.com/Article...x?articleID=15 Hope this answers your questions. Let me know if you need any. thanks, sanereddy |
|
|||
|
Re:.Net Interview Questions
Thank you very much.It is very helpful to me.
One more doubt is there. How reflection is useful.I know few things about it as we can dynamically call the methods using it and we can know the type of arguments.But exactly where this dynamic calling of function comes.Please explain in detail Regards Pramod |
|
|||
|
Re:.Net Interview Questions
Reflection is one of the new features of .NET and it\'s way cool. In a nutshell, Reflection allows you to interrogate an object, your\'s or someone elses, and find out all about it at runtime. Let me show you a really simple illustration. Let\'s say that I have an object called Broadcaster (I made a Broadcaster object for another article, so I was just being object-oriented (or lazy depending who you ask) ) and you want to see all of its members...this just a few lines of code will get you there:
In VB.NET Type: Dim t As Type = c.GetType Dim ObjectMembers As MemberInfo() = t.GetMembers Dim Iterator As MemberInfo For Each Iterator In ObjectMembers Debug.WriteLine(Iterator.Name) Debug.WriteLine(Iterator.ReflectedType.ToString) Next In C# BroadCaster bc = new BroadCaster(); Type t = typeof(c); MemberInfo[] ObjectMembers = t.GetMembers(); foreach(MemberInfo m in ObjectMembers) { Debug.WriteLine(m.Name); Debug.WriteLine(m.ReflectedType.ToString()); You can do quite a bit more with Reflection, this is about as elementary as it gets, but it should give you a decent feel for the types of things that can be done with it. Some portions of the .NET Framework uses Reflection internally to determine, at runtime, the names of your data types and/or their members, then subsequently use the name to access some \"related-by-name\" information. For example, resources are conventionally named after the type that uses the resource. A resource used by the WiseOwl.Demeanor.Form class would typically reside in the managed resource stream called iseOwl.Demeanor.Form.resources. When locating a resource for a particular type, some portions of the Framework use Reflection to obtain the name of the type and then appends \".resources\" to that name and tries to open that resource stream.. In a different context, XML Serialization, by default, serializes an object and uses the names of the members, as determined at runtime, as the XML element names. As an obfuscator typically changes type and member names, the names determined at runtime don\'t match those used at compile-time and sometimes this can break your code. Hope this ansers your questions. thanks, sanereddy |
|
|||
|
Re:.Net Interview Questions
Pramodm,
Delegates are roughly similar to function pointers in C++, but they are type-safe and secure. A delegate declaration defines a reference type that can be used to encapsulate a method with a specific signature. A delegate instance encapsulates a static or an instance method. Delegates are roughly similar to function pointers in C++; however, delegates are type-safe and secure. pointers are used to store the address of a thing. By changing the address contained in a pointer, the same pointer can reference multiple things during the course of execution of a program. What is a delegate in .NET?http://searchvb.techtarget.com/vsnet...293034,00.html It\'s a very good article on Delegates and functional pointers http://www.devhood.com/tutorials/tut...&printer=t Hope this answers your questions. Let me know if you need any. Thanks, sanereddy |
|
|||
|
Re:.Net Interview Questions
Thank you sir.
One more doubt class DelegateTest { [STAThread] static void Main(string[] args) } Here what is [STAThread] means.No where it is given that why we are using this piece of code.Will you please explain this? Thank You, Pramod.M |
|
|||
|
Re:.Net Interview Questions
The STAThread section of the C# code basically tells the compiler that the application is using the \"Single Threaded Apartment\" approach, the STA bit stands for that, as opposed to using a multi thread apartment approach which is [MTAThread], anyway it\'s a very long explanation as to why we use these.
Indicates that the default threading model for an application is single-threaded apartment (STA). Thread Safety: Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe. Threading models only pertain to applications that use COM interop. Applying this attribute to an application that does not use COM interop has no effect. The startup threading model can be set to single-threaded apartment or multithreaded apartment. If it is not set, then the thread is not initialized. Here is a good one on this topic http://www.developer.com/net/cplus/print.php/2202491 Hope this ansers your questions. Thanks, sanereddy |
![]() |
| Thread Tools | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Robert Bosch Interview Pattren and sample questions | admin | Interview Process and Patterns | 0 | 05-26-2005 08:18 AM |
| Live DataStage Interview Questions | admin | Interview Questions | 0 | 05-24-2005 07:18 PM |
| comp.archives.msdos.{announce,d} FAQ (Frequently Asked Questions) | Timo Salmi | Tech FAQ | 0 | 10-04-2004 07:06 AM |
| comp.lang.c Answers to Frequently Asked Questions (FAQ List) | Steve Summit | Tech FAQ | 0 | 07-03-2004 08:27 PM |
| .NET Interview Questions Doc | kashifkhan | Interview Questions | 2 | 07-01-2004 01:52 AM |