.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Significance of

Posted By:      Posted Date: October 05, 2010    Points: 0   Category :ASP.Net

I am a bit confused about the significance of the <form runat="server"> on a page, and its effect on Page and Control life cycles.

For long, I have eliminated any Postbacks or Viewstate from my web forms. I just use web forms to render (often very very complex) UI to the client (composed of server-side controls as well as ExtJs or jQuery widgets etc).

After the UI renders, all interaction with server is asynchronous through web-services or http handlers. So, lately I have started omitting the <form runat="server"> tage also from my web forms.

And to my surprise, the code has NOT broken. The life-cycle events are generated normally on all controls, they have access to normal ASP.NET processing pipeline, and they render perfect;y. As there are no Postbacks, I do not need ViewState or control events like click etc.

So, can somebody tell me if there's any material difference that <form runat="server"> would make in my scenario, or to ASP.NET page/control life-cycle??

View Complete Post

More Related Resource Links


If I use the onsubmit does not display any data?

Example: TextBox1 = "yes" - does not appear.

If I use the onclick, I have to click on TextBox1 before the show data.

What's the problem?


why runat="server" attribute is required for ajaxcontroltoolkit controls?

the doubts i have may looks silly,i started my carrier in dotnet recently,1)we are calling them as client side controls,then what is the need for runat server attribute?2)<asp:Button ID="Button1" runat="server" Text="Button" /> <asp:ConfirmButtonExtender ID="Button1_ConfirmButtonExtender" runat="server"              ConfirmText="Really?" Enabled="True" TargetControlID="Button1">  </asp:ConfirmButtonExtender>when i execute the above code,i observed that in status bar message as "connecting to localhost",if they are client side controls what  is the need of going to local server,why it is happening?Thanks in advance.


Hi, I just started using AjaxControlToolKit. For starter, I added the CalendarExtender to an existing page. Things were fine until I tried to open the page and I got the following error:"This page is missing a HtmlHead control which is required for the CSS stylesheet link that is being added. Please add <head runat="server" />" Is it obsolutely required the header tag to have runat="server" attribute? Any workaround? We are using a base page class which is derived from System.Web.UI.Page, so if I modified said class (which renders the header from the code behind), it will affect all of our existing pages. The thing is I am not sure if there will be any side-effect and if the others will approve of this approach.

Visual Studio automatically adds the ID attribute to controls that are runat="server"


When I copy/paste a control, Visual Studio automatically adds the ID attribute to controls that are runat="server".

Is there a way to disable this?

Add Runat server to all element in html string



I have one html string in DB like below

<div style="padding-left: 200px; padding-top: 20px">
        <div style="text-align: left;padding-top:10px">
            <input id="Text1" type="text" /></div>
        <div style="text-align: left;padding-top:10px">
            <input id="Text2" type="text" /></div>
        <div style="text-align: left; padding-top: 10px">
            <input id="Button1" type="button" value="Submit" /></div>


i wan to render this in aspx page. but before this i want to all runat server to all html control in above string


<div style="padding-left: 200px; padding-top: 20px">
        <div style="text-align: left;padding-top:10px">
            <input id="Text1" runat="server&

How to create a SSIS package to import records form SQl Server 2008 tables to text files

I am a newbie to SSIS and would like to create a package to accomplish the task referenced in the above title. Will appreciate any links and pointers in the right direction.   Thanksakoranteng

Cannot publish InfoPath 2010 form template to SharePoint Server 2010 RC

Hi all, I am MSFT in Vietnam. I created a SharePoint list using InfoPath 2010 RTM 64bit. After publishing it to SharePoint 2010 RC, I see an error message:  Click on button "Show Details" the message is The list schema does not match the schema of this form. Refresh the data source and publish the form again. When I create new item based on published SharePoint list, I can see plain form not browser enabled InfoPath form. I checked InfoPath Form Services, everything seems to be good. What should I do to publish SharePoint list from InfoPath 2010 to SharePoint 2010 as browser enabled form?

Posting using Server Side and not Client side form?

Hey, i want to post to a page by using server side and not client side form and submit button.Now im using this code:Response.Redirect(Request.Url + "&t="+Title+"&d="+Description+"&a="+Author+"&p="+Published+"&i="+Thumbnail);so it redirecting to the same URL with parameters.. (it works)But it makes alot of bugs and the address bar is long as hell..How can i post to the same page using Server side code (C#) and send the same parameters?Thanks.

The URL is not valid error while publishing InfoPath form to MOSS 2007 server

Hi All,   When I try to publish the form onto a SharePoint Team site it throws the error: The following URL is not valid : http://tcs037288:6543/sites/projectmanagement   I have checked the comaptibility, trust and everything looks fine. Also, I tried to upload this template from Central Admin but there it is failing with browser-compatibility errors.       Regards,

Descompress BLOB data form SQL server into a file

Hello guys..... I have a question for developers in SQL Server. I need to migrate data from one table to another, i will use SSIS to do the job, i have no problem with this, but during the migration i need to read a column that contains BLOB data (documents .docx .xlsx .pdf etc) and generate and sownload the file in a folder directory. I need to implement this functionality into SQL entorn (SSIS package), do you know if exist any function in SQL that could do the job, or any extend functionality form .net that could be included or called from SQL SSIS in order to be executed? I will appreciate your support, thanks. PS        

The path is not of a legal form - SSCE 3.5 and VS 2008 Server Explorer

Hi, I am facing one issue continuously whenever I try to open LocalDatabaseCache(.sdf files) in VS 2008. It says,"The path is not of a legal form". Even if test connection is succeeded. When I restart VS 2008 and DatabaseEngine service then only it opens the Database. Also sometimes I face problem of memory corrupt. May I know what could be the reason for this issue?  How can I permanently resolve it? Regards, Nandkishore    

how to change the web application Database connection form Windows authentication to SQL Server acco

Hi, I have a web application created and Database connection authentication was given as Windows authentication. how can i change it to a SQL server account in MOSS 2007. Thanks in advance.

Restoring Databases form SQL Server 2000 and SQL Server 2005 to SQL Server 2008 -Side by Side --he

Hi all I Installed SQL Server 2008 R2 in Server and I took backup of all the User databases backup from 2000 and 2005(two instance are running) Now I am doing restore the Databases,while I am restoring I am information icon in bottom of the restore window that is "The Full-Text Upgrade Option server property controls whether full-text indexes are improved,rebuild or reset" that means I have to upgrade full-text indexes or this just inforamtion.If I want find out whither Database using full-text how to check ? once I done this I have to move the users as well.Please dome body share the script you have.   Thanks in AdvanceSNIVAS

"Could not verify the form template on the specified server" problem

I have an InfoPath 2010 form that I'm trying to publish as a browser-based form to a SharePoint 2010 Form Library.   It passes the compatibility checker if the "Verify on server" box is not marked, but will not validate on the server, giving only the message: Could not verify the form template on the specified server: http://portal.mydomainname.com/_vti_bin/FormsServices.asmx Make sure you are connected to the network and have access to the server. Browsing to the above URL brings up the FormsServicesWebService page just fine. The "portal.mydomainname.com" is in the Default zone.  Authentication provider for the Default zone is Windows NTLM with Client Integration enabled.  The server is registered with an enterprise key.  Forms Services is configured to allow browser-enabled forms. Any other ideas? Thanks -BobBob

auto-populate infopath form with sql server data connection



is it possible to auto-populate an infopath form with a sql data connection?

i have a form that only populate the username of the logged in user. but i want to use a secondary data source to auto-populate the user his email, id and department all comming from a sql server database.

and after that auto-populate the user's manager name using sql server db

is this possible in infopath 2007 and how can i do this?

Server Side Validation for SharePoint 2007 Form Fields


Hi Guys,

Need to validate NewForm.aspx and EditForm.aspx of SharePoint custom list. My current implementation is by using JavaScript. It's working fine.

Someone suggested JavaScript is not a good approach.I am unable to fetch ids dynamically by JavaScript only for few fields (people picker, calendar control) and in that case i have hard coded the ids. hardcoding is always a bad approache.

Is there any way to validate those mentioned form at server side? Is it really good way to think that my validation can put inside Event Handler?

thanksArup MCTS - SharePoint

Play Sudoku

Adding a SQL Server Table to Windows Form Application (c#)



I have created forms in the past that have connected to a SQL Server database and done a variety of manipulations.

This time I have a static table in SQL server that I want to add to the project and load into an array without having to connect to SQL Server i.e. the windows form application will have this datatable embedded within it so any user can use it. How do I add the table to the project in this way?

I know how to load the data into the array.




ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend