[Mono-dev] [PATCH] System.Web.Compilation.TemplateControlCompiler: Data-Binding Syntax: fixed Bind functions

Tony Gu tonyxgu at yahoo.com
Thu Sep 28 13:36:05 EDT 2006


Igor,
  Thanks!
  My original aspx is a little complicated, so I wrote a simple test aspx (modified from mono test aspx file: web_repeater.aspx) which I attacked here. It runs fine in VS:
          Country  Abbreviation  Continent     [input]     [input]     [input]       [input]     [input]     [input]       [input]     [input]     [input]  
   
  But got the following error under mono:
  Bind expression not allowed in this context.  Description: Error processing request. 
  Error Message: HTTP 500. Bind expression not allowed in this context. 
   
  I also attacked my TemplateControlCompiler.cs here too. Please let me know if this test aspx file is Ok in your patcked mono.
   
  Tony

Igor Zalmanovich <igorz at mainsoft.com> wrote:
        v\:* {behavior:url(#default#VML);}  o\:* {behavior:url(#default#VML);}  w\:* {behavior:url(#default#VML);}  .shape {behavior:url(#default#VML);}        st1\:*{behavior:url(#default#ieooui) }                Hi, Tony,
   
  Please send the original aspx file.
   
  This will help me to analyze the source of the problem.
   
  Igor.
   
      
---------------------------------
  
  From: Tony Gu [mailto:tonyxgu at yahoo.com] 
Sent: Wednesday, September 27, 2006 9:18 PM
To: Igor Zalmanovich 
Subject: Re: [Mono-dev] [PATCH] System.Web.Compilation.TemplateControlCompiler: Data-Binding Syntax: fixed Bind functions

   
    Here is my code generated :

    Line 743:         public void __DataBind__bctrl_123(object sender, System.EventArgs e) {
Line 744:             System.Web.UI.WebControls.FormView Container;
Line 745:             System.Web.UI.DataBoundLiteralControl target;
Line 746:             target = ((System.Web.UI.DataBoundLiteralControl)(sender));
Line 747:             Container = ((System.Web.UI.WebControls.FormView)(target.BindingContainer));
Line 748:             target.SetDataBoundString(0, System.Convert.ToString( Bind("title") ));
Line 749:         }


Tony Gu <tonyxgu at yahoo.com> wrote:

      Igor,

     

    After put this patch in my mono-1.1.17 (only with few other patches), I still get the Compilation Error for "Bind" fuction call. The same code works under VS 2005.

    Did I miss something?

    Thanks!

     

    Tony

Igor Zalmanovich <igorz at mainsoft.com> wrote:

    This is the patch to fix Bind functions (Data-Binding Syntax).

At run time, the Bind method calls the Eval method, if there is DataItem
!= null to bind to.
If there is DataItem == null (like InsertItemTemplate in FormView) Bind
method don't raise exception and works properly to extract data from
bounded controls on postback.

See code generated by dotnet:

public void @__DataBinding__control22(object sender,
System.EventArgs e) {
System.Web.UI.WebControls.CheckBox
dataBindingExpressionBuilderTarget;
System.Web.UI.WebControls.FormView Container;
dataBindingExpressionBuilderTarget =
((System.Web.UI.WebControls.CheckBox)(sender));
Container =
((System.Web.UI.WebControls.FormView)(dataBindingExpressionBuilderTarget
.BindingContainer));
if ((this.Page.GetDataItem() != null)) {

#line 62 "C:\www\Menu\FormView.aspx"
dataBindingExpressionBuilderTarget.Checked =
((bool)(this.Eval("IsPublic")));

#line default
#line hidden
}
}


Please review.

Igor.

_______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
   
      
---------------------------------
  
  How low will we go? Check out Yahoo! Messenger’s low PC-to-Phone call rates._______________________________________________
Mono-devel-list mailing list
Mono-devel-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list



  

  ?
    
---------------------------------
  
  Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2?min or less.



 		
---------------------------------
Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060928/6e8f252e/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: web_repeater2.aspx
Type: application/xml
Size: 1622 bytes
Desc: 2839399022-web_repeater2.aspx
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060928/6e8f252e/attachment.rdf 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: TemplateControlCompiler.cs
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060928/6e8f252e/attachment.pl 


More information about the Mono-devel-list mailing list