Writing outside <form></form> ?

Is it possible to write characters outside the form tag? I know, you can't insert controls there, but is it just possible to insert ordinary ascii characters?
0
cantfindbettername
2/27/2006 2:31:25 PM
asp.net.web-forms 93655 articles. 6 followers. Follow

4 Replies
2939 Views

Similar Articles

[PageSpeed] 0
Get it on Google Play
Get it on Apple App Store

Yes you can.  Normal HTML tags can be outside of the <Form> tag.  What do you have in mind in relation to this question?
0
jcasp
2/27/2006 3:12:21 PM

Of course I meant how to do that programmaticaly, with asp.net.

0
cantfindbettername
2/27/2006 3:15:52 PM
I believe you can, but haven't tried it.  For example, using Page.Controls collection should be possible to achieve this since your Form resides in this collection.  Again, I haven't tried this so I'm not sure what problems, if any, you will face.  Just be sure to add HTML controls.
0
jcasp
2/27/2006 4:27:41 PM
cantfindbettername wrote:
Is it possible to write characters outside the form tag? I know, you can't insert controls there, but is it just possible to insert ordinary ascii characters?

That's not entierly correct. You can indeed insert controls outside the form tag, but only those that cannot cause postbacks. So, a container control like a PlaceHolder you can use outside the form tag, while for instance a button or a textbox must be placed inside a form tag.

If you place this outside the form tag:
<asp:PlaceHolder ID="myPlaceHolder" runat="server">
 
You could add controls to it from code behing like this:
myPlaceHolder.Controls.Add(new LiteralControl("<strong>My Literal Control</strong"));


--
Tarjei
0
tarjei
2/27/2006 6:42:06 PM
Reply:

Similar Artilces:

How to strip a string of <html>, ,</html>, <body>, </body>, <form ... >, </form> tags?
I have stream which is the HTML input of a page. Now I want to use only that part of this page, that is within <form .....> and </form> tags, and excluding these tags.How would I go about stripping <html>, ,</html>, <body>, </body>, <form ... >, </form>, <head> and </head> tags? I have to make sure that <head ...javascript..> and its corresponding </head> tags are not stripped in this process.sun21170    Wait... you said you wanted to strip the head tags, and you're also saying you need to NOT strip the ...

how to place a <form> in web form form
i placed a <form> in the web form, but i can't submit coz i neet to submit to another web site how can i do??? Mike Chan You cannot submit a <form> to another page if you have a RunAt="Server" in the form tag. Remove that RunAt="Server" and you can (though then you will need to use plain old HTML inside that form). What are you trying to do? Why do you need to post to another form?Starting with ASP.NET 2.0? Look at:Programming Microsoft Web Forms My Blog COZ I NEED TO POST SOME INFORMATION TO ANOTHER WEB SITE IS THERE ANY OTHER SOLUTION?M...

Viewstate <--> Methods; Session <--> Web Forms; Something?? <--> Email?
This is along shot but I'm cautiously optimistic someone has thought of it long before and possibly an simple answer does exist... If I want to move a thing between methods (I still call them subroutines) I can put the thing in a ViewState and then later take it out. If I want to move a thing between web forms, I can put the thing into a Session and then later take it out. Is there a somethingX that if I want to I can take the thing put it into a somethingX put the somethingX into a file and email the file take the somethingX out of the file read the somethi...

<form></form>'s Default Button??
I need some serious help here. I know that an asp page can only have one form tag and for all intensive purposes it seems that the first button in the form gets the enter focus. This is rather cumbersome and I was wondering how I could go about changing this? View this thread This is a sample for ASP.Net to show, how easy it is to 'force' a default button for a textbox. You can even try for some third party control http://www.metabuilders.com/Tools/DefaultButtons.aspx~ Firoz AnsariPune, Indiahttp://www.firozansari.comWhy product testing is important? I just found a much easy ...

I've placed <forms loginUrl="home.aspx"></forms> in web.config and now all users that log in go to default.aspx
I've placed <forms loginUrl="home.aspx"></forms> in web.config and now all users that log in go to default.aspx.        <authentication mode="Forms">        <forms loginUrl="home.aspx"></forms>      </authentication>What attribute I should add, to make the user stay on the same page. Btw when I remove  <forms loginUrl="home.aspx"></forms>, users stay on the same page after login.Thanks. try one of these.....

Need Help With <form runat=server></form> Tags
Hello everyone I have a real newbie question for anyone that wants to help me out...... I am creating a e-commerce website right now (yes a massive project for me) and I am having this problem. I have set up my site with a master page and then the content pages. On my master page I have a login view and inside that login view I have a login name <asp:LoginName ID="LoginName1" runat="server"> I just draged and dropped it so when my users are signed in they can see a welcome message... this login name requires a <form runat=server> Tag in which I've placed in it....(this works ...

Calling server function outside the form element messes up the hierarchy (like <title> <% myTitle %> <title> )
I'm pretty new to internet development, haven't done any prior to .net, so I might be missing something to obvious.. From what I understand Page.Controls is a collection of 3 elements - literal control, form & anoether litteral control I have a code like this "HtmlForm htmlForm =(HtmlForm) Page.Controls[1];" in my base page, which is inherrited by multiple pages. However, if I have a server side function call outside the <Form></Form> element (like this "<title> <% myTitle %> <title> ") I no longer have a collection of 3 elements...

Firefox issue with dynamic height inside <form></form> tags
Maybe someone else has experienced this and has a work around.I have a site with a master page that has an iFrame the I load a dynamic URL into, all code works fine. In IE I have no problems but in firefox if the iFrame with the height as a % does NOT resize to the right height if the iframe is inside the <form></form> tags.I've copied the rendered html and put it in a plain html page and when I remove the form tags I have no problems. Has anyone encountered this?Below is my posted .aspx code I've put the style inline in the iFrame for ease of viewing, before it was in a ...

Comparison Web Form <-> Mobile Web Form
Hi all,Is there any overview of the (dis-)advantages using Mobile Web Forms compared with normal Web Form? I know I need to use Mobile Web Form if it should be accessible with handhelds, but does it make sense using Mobile web Form when the webpage should not be available for handhelds?Thanks!      The benefit on using the mobile web form is the ability to use the mobile controls that had adaptive rendering for different handsets. The built in features of controls like the objectlist and selectionlist are great and and form paging is also a neat thing.If you are not dev...

What if I remove <form id="form1" runat="server"></form>
If I am creating an aspx page, which does not need to be a form, i.e. no input is taken from the user, do I need to encapsulate the whole page with in  <form1 runat="server">   What are the implications of removing the form? I realize there will be no viewstate, and again, I won't be able to accept user input, but will everything else work as expected? It seems to be so far, I've just not seen ANY examples where the form tag has been removed. Thanks, Darragh You need the server-side form tag if you are going to have server-side controls on the form.RyanRyan Olshan...

can I delete <form id="form1" runat="server"> and </form>
Hi: Our website is written by using simple html code, one of the page has some virtual shopping cart code with <form> ....</form>, (for example here: http://www.centercoin.com/coin_supplies/coin_collecting_starter_set.htm ), if I have 10 products, I will have 10 of <from> ...</form> in this page, that is ok. Now, I am trying to redesign the website using asp.net2.0, I notice all the asp page will automatically create a <form id="form1" runat="server"> ...</form>, such as: <html xmlns="http://www.w3.org/19...

Can't use "defaultbutton" in <form></form> tag in login control page.
I have a login control and I tried to set the default button as the submit button within my form tag in the login page.But, I am getting the following error.Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. I already generated the machine key.Any clue! hi robin, Please try this fix if.. add the below given code into your web.config or the file that you are executing and see if your issue gets...

this in vb.net: <% using Html.Form<ProductController>(p=>p.Update(ViewData.Product.ProductID))%>
How do I do this in VB.net:<% using Html.Form<ProductController>(p=>p.Update(ViewData.Produc t.ProductID))%>This is using a lambda for the form tag in c#, I searched everywhere for the correct vb.net syntax? I tried this with no luck:<% Using Html.Form(Of ProductController)(Function(p) p = ViewData.Product.ProductID)%>   VB.NET doesn't support Lambda expressions.   View My Blog Download My URL Rewriter and Reverse ProxyOnly $9.95/month, ASP.NET, 2GB & SQL 2005 alivemedia:Function(p) p = ViewData.Product.ProductID I think the proper syn...

Header and Footer user control contains <html>, <body>, and <form> elements
Hi, I have read that we can not/should not use html, body and form tag in the user control. But here these tags are used in the Header control. I would like to know that although we can use those tags in User Control, should we use or should we follow other alternative for this. Thanks in advance, ---------------------------- http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcreatingpageletcontrol.asp ...

Web resources about - Writing outside <form></form> ? - asp.net.web-forms

Resources last updated: 12/23/2015 5:22:22 AM