Difference Between Literal and Label in ASP
The mail difference is the way how the tags are rendered
<asp:Label….Text=”Hello World” ..> ==> <span >Hello World</span>
<asp:Literal…Text=”Hello World” ..> ==> Hello World
The next difference is that the labels can be associated for a certain control in the web forms.
On the other hand literals can be used to add plain English text or Html to the Document.
Hope you got the difference 🙂
Use of BeginRequest Event in Asp.Net
It is fired on every Request to the Application .
The order of Execution is as follows
The application events are raised in the following order:
The event handler is executed.
This post Explains on how BeginReest can be used .
A page may be restricted based on some condition as folows.
To do this Implement a class that Inherits the IHttpModule and Implement the Init() and Dispose().
Handle the event BeginRequest As Folows
// In the Init()
context.BeginRequest += new EventHandler(context_BeginRequest);
void context_BeginRequest(object sender, EventArgs e)
// Called For every Request to the server
HttpRequest request = ((HttpApplication) sender).Request;
HttpContext context = ((HttpApplication)sender).Context;
string applicationPath = request.Path;
if(applicationPath == “/”)
applicationPath = “/Index.aspx”;
Debug.WriteLine(“Begin Requst Fired”);
Here Whenever “/” is the requests path , the responce is redirected to the “/Index.aspx”.
It can be used for other such scenarios.
Hope It helped you 🙂 .
The System.Net.Mail Had the mail address class which can be used to validate Email Ids
public static bool IsValidEmail(string emailaddress)
MailAddress m = new MailAddress(emailaddress);
The code above can be used to validate Email Ids . If the Email Id is in the wrong format , It throws the Format Exception which in turn can be used as an approach to handle the invalid Email Ids . However The use of regular Expressions is the best approach as It is highly Flexible.
Hope You Liked Reading .Happy Coding 🙂 .
If you have installed the Ultimate N versions of the windows 7 OS you are very likely to get this error and the solution to this is as follows
The error is due to the missing Media Foundation Platform which is a dll that does not come bundled with the Ultimate N versions . N versions of the OS are European versions that does not have the media player and related stuff bundled as a result of the European councils measure to do so .Microsoft has also paid around 50 M Euros as fine for the same says some sources.
So you can download and install these features from the link
If you are installing the Microsoft Kinect SDK or the Intel Perceptual SDK you will find this Error .This is just a simple scenario that i have quoted.
Hope you solved your issue and enjoyed reading.
I wanted to setup an account in my Gmail and I was not sure what my SMTP server on yyy.com was so How to find it out .
Step 1 : Setup the Telnet Client
To do that go to control panel click on programs and then click on add or remove windows features
Make sure the Telnet client is checked
Now Open command prompt and type “ nslookup “
Type in the following
which specifies mail server
Then type in the server you want to ping here i use “gmail.com.” .Use a “.” at the end.
Here it goes the mail Exchange servers Installed at gmail.com
You can see a value called preference which specifies which server is favourable. Lower the value more favourable it is .
I can use the port 25 and TLS settings on my Gmail to setup a secure Network .
Hope You enjoyed Reading.
Almost Every one knows we can set passwords for a word document but some of us don’t use it frequently and we might have forgot the feature .This is a post on how to use the the feature in the latest version of Office
Consider I have a file that i have stored all my passwords and I don’t want any one to see the file , This is what I can do
Click on the File Menu . Click on the Info Tab in the Left .
You can see a button that says protect document followed by selecting the option Password . Select the option Encrypt With password.Enter the old and new password.
All done when you open the file as you can see below It asks for password simple but Useful.
Hope you enjoyed reading.
This Post shows a design idea for designing layouts for Android using Android Studio .
This is a problem most of you may face while designing is when changing from landscape to portrait mode and vv
Here is one Example which was designed in relative layout and when the mode is changed the controls overlap and distorts the UI and when used in a smaller res device no component would show up.
1)Use table layouts to design the same .
– Table row
2)use Plain Text instead of Large text or small text components .
3)Use the weight,gravity to arrange the components in the in the table row.
This below given layout is a possible solution to the above said problem . As shown below the layout works well from a 10 inch device to 2.7 inch device and both orientations.
This is the used structure for the above shown design.
Hope you enjoyed reading.