Monday, March 26, 2012

Tab Control with ASP.net control

Hello there,

I am trying to put some server controls such as label, textbox and dropdownlist on AJAX Tab control but these controls not responding to any events like button onclick event. How can I write code to handle and work with these server controls while it is on the AJAX Tab control?

Please help...

Best regards,
Sam

can u post ur code.. here..


actually I have no code till now i am just placed the button control on the AJAX tab and I am trying to wire onclick event with this button but it is not working. and the other thing is the control propertis is not working like i set the max length propertis to 200 char but the textbox still accept more than 200 char.

Thank you

Sam


Hi Htaher,

Based on your description, what you want is when click on the server control no postback will be occurred. If I have misunderstood, please feel free to let me know.

For your situation, you may use HTML Controls instead of the server controls.If you insist on using server controls, please forbit the controls to postback.

For example: If it is a Button control, you can use this: <asp:Button ID="Button1" runat="server" Text="Calendar" OnClientClick="return false;"/>

If it is a DropDownList Control , you can set it's AutoPostBack to "false". Just like this:

<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="false">
</asp:DropDownList>

I hope this help.

Best regards,

Jonathan

No comments:

Post a Comment