Re: [Mono-dev] [PATCH] System.Web.Compilation.TemplateControlCompiler

2006-11-15 Thread Gonzalo Paniagua Javier
On Wed, 2006-11-15 at 00:53 -0800, Igor Zalmanovich wrote:
> Attached is patch for System.Web.Compilation.TemplateControlCompiler
> that resolves the problem is described below.
> 
> When <%# Bind(...) %>-expression is used more then once for same control

Please, commit.

Thanks.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


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

2006-10-03 Thread Igor Zalmanovich








Tony,

 

It is other problem, not depended on my
fix.

 

Please, open file in bugzila for this bug.

http://bugzilla.ximian.com/enter_bug.cgi?product=Mono%3A+Class%20Libraries

 

Meanwhile you can use "Eval" instead
"Bind" for Repeater.

 









From: Tony Gu
[mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 28, 2006
8:36 PM
To: Igor Zalmanovich 
Cc:
mono-devel-list@lists.ximian.com
Subject: RE: [Mono-dev] [PATCH]
System.Web.Compilation.TemplateControlCompiler: Data-Binding Syntax: fixed Bind
functions



 



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
  
 
 
  
  
   
  
  
  
   
  
  
  
   
  
 
 
  
  
   
  
  
  
   
  
  
  
   
  
 
 
  
  
   
  
  
  
   
  
  
  
   
  
 






 





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
<[EMAIL PROTECTED]> wrote:







Hi, Tony,





 





Please send the original aspx file.





 





This will help me to analyze the source of
the problem.





 





Igor.





 













From: Tony Gu
[mailto:[EMAIL PROTECTED] 
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
<[EMAIL PROTECTED]> 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
<[EMAIL PROTECTED]> 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@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@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.






___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


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

2006-09-27 Thread Igor Zalmanovich









Hi, Tony,

 

Please send the original aspx file.

 

This will help me to analyze the source of
the problem.

 

Igor.

 









From: Tony Gu
[mailto:[EMAIL PROTECTED] 
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
<[EMAIL PROTECTED]> 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
<[EMAIL PROTECTED]> 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@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@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.








___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


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

2006-09-27 Thread Tony Gu
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!     TonyIgor Zalmanovich <[EMAIL PROTECTED]> 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) Bindmethod don't raise exception and works properly to extract data frombounded controls on postback.See code generated by dotnet:public void @__DataBinding__control22(object sender,System.EventArgs e)
 {System.Web.UI.WebControls.CheckBoxdataBindingExpressionBuilderTarget;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 listMono-devel-list@lists.ximian.comhttp://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@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


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

2006-09-27 Thread Gonzalo Paniagua Javier
On Wed, 2006-09-27 at 07:10 -0700, Igor Zalmanovich wrote:
> This is the patch to fix Bind functions (Data-Binding Syntax).

Please, commit.
Thanks.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


RE: [Mono-dev] [PATCH] System.Web.Compilation.TemplateControlCompiler

2006-06-15 Thread Gonzalo Paniagua Javier
On Thu, 2006-06-15 at 09:34 -0700, Andrew Skiba wrote:
> Hi Gonzalo,
> 
> please review the fixed test and fix.
> 
> also please review FormView and UrlProperty patches I sent earlier.

This is ok to commit.
Thanks.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


RE: [Mono-dev] [PATCH] System.Web.Compilation.TemplateControlCompiler

2006-06-15 Thread Andrew Skiba
Hi Gonzalo,

please review the fixed test and fix.

also please review FormView and UrlProperty patches I sent earlier.

Thank you.
Andrew.


TemplateControlCompilerTest.patch
Description: TemplateControlCompilerTest.patch


TemplateControlCompiler.patch
Description: TemplateControlCompiler.patch
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] [PATCH] System.Web.Compilation.TemplateControlCompiler

2006-06-14 Thread Gonzalo Paniagua Javier
On Wed, 2006-06-14 at 06:37 -0700, Andrew Skiba wrote:
> Hello,
> 
> Please review test and patch for TemplateControlCompiler. The bug was
> that assignment statement was generated for a read-only property. If no
> one objects, I will commit.

I don't think this patch is ok. And I'm tired of seeing that 'if no one
objects, I'll commit'. You should wait patiently until the patch is
approved and resubmit if you get no answer, which is what everyone else
does.

AddCodeForPropertyOrField can be called with a FieldInfo, and this will
make:
+   if (isDataBound && ((PropertyInfo)
member).CanWrite) {

crash.

-Gonzalo


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list