CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > microsoft_downloads.css_friendly_control_adapters Tags:
Item Type: NewsGroup Date Entered: 2/6/2008 10:39:59 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 22 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
willb75
Asp.Net User
Control must be in server form2/6/2008 10:39:59 AM

0/0

I was just playing about with the treeview control adapter, having used the default template project provided from the site. I just stuck a treeview on the default.aspx page, which doesn't have a server form (which I realised was the problem), and then bound it to a sitemap. The control seemed to render, but I got javascript errors when I tried clicking on any of the buttons to expand and collapse the nodes. I couldn't figure out what I'd done wrong, but then I removed the mapping to the adapter in the browsers file and got the following error:

Control 'TreeView1' of type 'TreeView' must be placed inside a form tag with runat=server.

The problem was obvious from this message, but the adapted rendering had failed to throw this error. Fortunately I've got a copy of .NET Reflector, so I could see inside the RenderContents method of the System.Web.UI.WebControls.TreeView class, and I noticed the following call:

protected internal override void RenderContents(HtmlTextWriter writer)
{
    base.RenderContents(writer);
    if (this.Page != null)
    {
        this.Page.VerifyRenderingInServerForm(this);
    }
...

So I thought I'd try my luck at putting that code into the RenderContents method of the adapter, as follows:

protected override void RenderContents(HtmlTextWriter writer)
{
    TreeView treeView = Control as TreeView;
   
if
(this.Page != null)
    {
        this.Page.VerifyRenderingInServerForm(treeView);
    }
.....

And guess what, it works! I had a similar problem with another control, and I was scratching my head trying to figure out what was wrong, when I found that there are subtle differences like this which could cause a lot of development time to be lost. After all, the only difference between the tailor-made and adapted rendering should be the mark-up itself...

Could anybody have a look at putting this code into the next release?

cheers

vik20000in
Asp.Net User
Re: Control must be in server form2/6/2008 12:18:30 PM

0/0

that looks like a pretty good finding. I will look at this myself later. :-)


vikram
www.vikramlakhotia.com
justlikethat.vikramlakhotia

Please mark the answer if it helped you
bdemarzo
Asp.Net User
Re: Control must be in server form2/6/2008 6:57:35 PM

0/0

Can you confirm whether other CSS adapted controls have the same potential issue?

 


- brian
- blog: www.sidesofmarch.com
willb75
Asp.Net User
Re: Control must be in server form2/7/2008 1:18:13 PM

0/0

I'm currently working on a project which will probably require other controls. I haven't used the others to be able to encounter the issue, but the easiest way to test each one is to instantiate and populate a web control outside a server form, and then try commenting out the adapter mapping in the browsers file. If you get the error with the default asp.net rendering, but not the css adapter rendering, then the css adapter rendering is wrong. You'll need to add the following, or equivalent code, to the RenderContents method:

if (this.Page != null)
{
    this.Page.VerifyRenderingInServerForm(control);
}

I think there was another related but different issue I came across with the CSS adapters, where the ASP.NET form validation was failing, because there it was missing a call to a routine in the framework - I'll post that too when I get a moment.

4 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Oracle Application Server 10g Web Development: Build and Deploy Web-Based Applications in the Oracle Environment Authors: Chris Ostrowski, Bradley D. Brown, Pages: 747, Published: 2004
Form-oriented Analysis: A New Methodology to Model Form-based Applications Authors: Dirk Draheim, Gerald Weber, Pages: 372, Published: 2005
ASP.NET in a Nutshell: In a Nutshell Authors: G. Andrew Duthie, Matthew MacDonald, Pages: 979, Published: 2003
Professional ASP.NET 2.0 Authors: Bill Evjen, Scott Hanselman, Farhan Muhammad, Srinivasa Sivakumar, Devin Rader, Pages: 1253, Published: 2005
QuarkXPress 5 for Macintosh and Windows: Visual QuickStart Guide Authors: Elaine Weinmann, Peter Lourekas, Pages: 498, Published: 2002
The California Landlord's Law Book: Evictions Authors: David Wayne Brown, David Brown, Janet Portman, Pages: 363, Published: 2007
Computer Networks and Internets: With Internet Applications Authors: Douglas E. Comer, Pages: 600, Published: 2008
ASP.NET 2.0 Cookbook Authors: Michael A. Kittel, Geoffrey T. LeBlond, Pages: 989, Published: 2005
Professional ASP.NET 3.5: In C# and VB Authors: Bill Evjen, Scott Hanselman, Devin Rader, Pages: 1673, Published: 2008
Developing Microsoft ASP.NET Server Controls and Components Authors: Nikhil Kothari, Vandana Datye, Pages: 689, Published: 2002

Web:
Control must be in server form - ASP.NET Forums Control must be in server form. Last post 02-07-2008 8:18 AM by willb75. 3 replies. Sort Posts:. Oldest to newest, Newest to oldest ...
control must be placed inside a form tag with runat = server - ASP ... control must be placed inside a form tag with runat = server. Last post 09-05- 2008 9:48 AM by Bo Chen – MSFT. 2 replies. Sort Posts: ...
Control must be placed inside a form tag Control 'StaffCode' of type 'TextBox' must be placed inside a form tag with runat=server What changes do I need to make to my web form? ...
Run-time error: must be placed inside a form tag ... Control 'CheckBox1' of type 'CheckBox' must be placed inside a form tag with runat=server. Description: An unhandled exception occurred ...
Microsoft ASP.NET QuickStarts Tutorial Server Control Form Validation. Introduction to Validation .... For client-side custom validation, the name of the custom function must be identified in the ...
Control must be placed inside a form tag with runat=server ... [Exception: The control must be placed inside a form tag with runat=server.] Telerik.RadGridUtils.RadAJAXControl.GetForm() +123 Telerik. ...
Control Must be placed inside a form tag. - Xtreme Visual Basic Talk Control Must be placed inside a form tag. Web Programming. ... In those cases they probably don't need to be server forms because they don't ...
How to: Add Repeater Web Server Controls to a Web Forms Page You must complete several steps to add a Repeater Web server control to a Web forms page. The following procedure describes the minimum that you must do to ...
Siderite Zackwehdex's Blog: Control must be placed inside a form ... Control must be placed inside a form tag with runat=server in NET 2.0 ... I search a long time solution to render user control with server elements that ...
Page Templates: Server Forms: ASP Alliance NET Page Templates do not actually include the server Form. ... control to, so each example must first create (or load) a parent control in the Constructor. ...

Videos:
Control Arduino Remotely through HTML forms This is a demonstration of my Arduino/python package (available here: http://blog.datasingularity.com/?p=50 ). It is open for free use by anyone and ...
HTML forms Next Generation Google Tech Talks March 5, 2007 ABSTRACT Web-based replacements for spreadsheets and simple forms By Dave Raggett, W3C Fellow and Principal Resear...
Seriously Owned! Compilation - Must See! (Stereo!) To listen in STEREO and watch in HIGH QUALITY click here: http://www.youtube.com/watch?v=MnZYARNXaYk&fmt=18 Pwn (/poʊn/, /puːn/, /pəʔˈoʊn/, /pɔːn/, ...
Praccy's Care Control One day Racer decided to play on Praccy's Priest whilst he was away, he discovered a wonderful abuse known to some as 'Mind Control'. What followed w...
ASP.NET - 04 - Form Control For more ASP.NET programming tutorials visit: http://www.programmingvideotutorials.com
Mind Control & Dark Portal This is my Priest : Lytnn Remember? form the Uber-WoW Movie (also made by me) Here i am playing with mind control Privaté Server: Uber-WoW Set Real...
File Uploads :: CoffeeCup Web Form Builder In this tutorial, you'll learn how to control file uploads in CoffeeCup Web Form Builder. You can specify which file extensions you want users to be ...
Alt-N Technologies' MDaemon on World Business Review Alt-N Technologies features its MDaemon email server software technology on World Business Review with General Alexander Haig. MDaemon is a full-feat...
Cisco ACE 4710 Application Control Engine Video Data Sheet The Cisco ACE 4710 appliance represents the next generation of application switches for maximizing availability, acceleration and security of data ce...
SignPlus Architecture for Signature Administration SignPlus is a complete and versatile product suite around the needs of signature verification. Its modularized architecture is designed to serve indi...




Search This Site:










where has the dll gone in vs2005?

traditional authentication without database

what is ssl

looping through treeview using javascript

information in web.config file is accesible at file level.

using user data across pages and sessions

parser error - line 1: <?xml version="1.0" encoding="utf-8" ?>

inamingcontainer and client side script question

ttt/dnn core forum emoticons smiley and gallery integration. help

new menu control and highlighting which area of the site you are in.

want to load .aspx page within tabs from an .ascx module on one of my tabs

logout

australian dnn hosts

registration page.

3.1 web.config - <trust level="full"> required, help...

login page works in .net app server, not real server

user login module

changepassword control

where is dnn2.0.3?

blogging module? or event by date..

using masterpage and subfolders

mystery of the disappearing dll's

expand treenode .. pls help!

dnn 3.08, error adding new page

ajax control toolkit problem

how to: combine sitemap with dynamic flash menu

createuserwizard control

different set of masterpages for different themes

c# treeview issues

buttons in createuserwizard

 
All Times Are GMT