Last post Sep 18, 2007 10:30 AM by xesteban
Sep 05, 2007 07:23 AM|xesteban|LINK
In WebForms I use in code behind:
What should I do to get the same result with a MobileControl of a MobileWebForm?
Thank you very much.
Sep 05, 2007 08:31 AM|xesteban|LINK
The property Attributes does not exist in a Mobile Control.
Sep 10, 2007 10:52 AM|Zhao Ji Ma - MSFT|LINK
Based on my understanding, you want to add custom attributes for ASP.NET Mobile Web Controls.
MobilePage class has a property called CustomAttributes. By setting the Allow CustomAttributes property of the MobilePage class to true will allow all of the ASP.NET Mobile Web controls on the page to have custom attributes. Please see this URL for more
Custom Attributes for Mobile Controls
And here are two examples can show you how to add custom attribute in ASP.NET Mobile Controls:
<mobile:TextBox id="Textbox1" runat="server" useRandomId="true"> </mobile:TextBox>
This is from
Sep 18, 2007 10:30 AM|xesteban|LINK
I understand what you say, but the attribute I need to include is "onClick" in a Command Control.
I have tried what you propose but it does not work.
Is not possible to add the onClick attribute in the way you say?
Otherwise, I have found another solution:
I put a Panel inside the Form, a Device Specific inside the Panel, and a
System.Web.UI.WebControls.Button inside the Device Specific.
Then, in the code behind I write:
WebButton.Attributes.Add("onClick", "return validarDatos();")
I found the solution here:
If it's possible to do the same with System.Web.Ui.MobileControls.Command, please tell me.