Wednesday, 23 October 2013

System.Web.HttpException: 'HtmlSelect' cannot have children of type 'LiteralControl'.

System.Web.HttpException: 'HtmlSelect' cannot have children of type 'LiteralControl'.
System.Web.HttpException: 'HtmlSelect' cannot have children of type 'LiteralControl'.

if you are getting this type of error while executing on running your asp.net application

in c# or in vb.net you must know about real cause or from where this error is occurring.

lets.. reavel this now what i did i just took

<select>
<option>
some information
</option>

</select>

and added runat="server" at .aspx page .


<select size="1" name="region" id="region"  runat="server">

now if we  run its gives error System.Web.HttpException: 'HtmlSelect' cannot have children

of type 'LiteralControl'....
to remove this error and make your application work easily..just add form name in your

.aspx pahe and add then add this line of code to .cs page.

remove runat="server"
Request.Form["region"].ToString();
and try now hope its works..

Thursday, 4 April 2013

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory

It is an error to use a section registered as   allowDefinition='MachineToApplication' beyond application level.  This error can be caused   by a virtual directory

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS.
E:\project\myproject\web.config 68


solution :-
If you are getting error like this and after  running your application you are getting error
liker <authentication mode="Forms"/> so  i have Solution just check your project or website
which you have opened . may be there will another web.config file.
where you have pasted your application or website folder open only than folder don't open
sub folder .


Example you  want to open your primenumberprogram website ,means  primenumberprogram  is
your website folder and there is web.config file , you kept your primenumberprogram   folder
in mywebsite folder and you are opening mywebsite folder instead of primenumberprogram  
folder then you will get erro like It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level.  This error can be caused
by a virtual directory not being configured as an application in IIS.

E:\project\myproject\web.config.

so check acccurately where you have kept your website and from where you are opening that folder.
hope it will work