<style type="text/css"> body { font-family: Verdana, Arial, Helvetica, sans-serif; } .tab-box { border-bottom: 1px solid #DDD; padding-bottom: 5px; } .tab-box a { border: 1px solid #DDD; color: #666666; padding: 5px 15px; text-decoration: none; background-color: #eee; } .tab-box a.activeLink { background-color: #fff; border-bottom: 0; padding: 6px 15px; } .tabcontent { border: 1px solid #ddd; border-top: 0; padding: 5px; } .hide { display: none; } .small { color: #999; margin-top: 100px; border: 1px solid #EEE; padding: 5px; font-size: 9px; font-family: Verdana, Arial, Helvetica, sans-serif; } </style> <script type="text/javascript"> $(document).ready(function () { $(".tabLink").each(function () { $(this).click(function () { tabeId = $(this).attr('id'); $(".tabLink").removeClass("activeLink"); $(this).addClass("activeLink"); $(".tabcontent").addClass("hide"); $("#" + tabeId + "-1").removeClass("hide") alert(tabeId); eval("<%=raja %>"); return false; }); }); }); </script> <body> <form id="form1" runat="server"> <div> <asp:Button ID="btnNext" runat="server" Text="Next" /> <div class="tab-box"> <a href="java<!-- no -->script:;" class="tabLink activeLink" id="cont-1">Tab 1</a> <a href="java<!-- no -->script:;"> class="tabLink " id="cont-2">Tab 2</a> <a href="java<!-- no -->script:;" class="tabLink " id="cont-3"> Tab 3</a> </div> <div class="tabcontent" id="cont-1-1"> <asp:TextBox ID="TextBox1" runat="server"> <asp:Button ID="btn" Text="Save" runat="server" OnClick="btn_Click" /> This is content box one </div> <div class="tabcontent hide" id="cont-2-1"> <asp:TextBox ID="TextBox2" runat="server"> This is content box Two </div> <div class="tabcontent hide" id="cont-3-1"> This is content box Three </div> </div> <asp:HiddenField runat="server" ID="HFCurrTabIndex" /> </form> </body>
protected void Page_Load(object sender, EventArgs e) { //ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "a", "a()", false); raja = Page.ClientScript.GetPostBackClientHyperlink(btn,"",false); } protected void btn_Click(object sender, EventArgs e) { //ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "a", "a()", false); ImageButtonClickHandler(); } private void ImageButtonClickHandler() { TextBox2.Text = TextBox1.Text; //ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "a", "a()", false); //ClientScript.RegisterStartupScript(Page.GetType(), "transfer()", "$('#cont-2').click();", true); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)