nitesh garewal

nitesh garewal

  • NA
  • 50
  • 8.2k

how to go second tab inside div tab using c# coding.

Feb 23 2016 2:58 AM
 Hey Friends,
    Now I am facing such a problem  . In ASP.NET using c# developing a web form in 4 steps ,first one is Employee details , second tab file upload and last one is final submit.
     My problem is that when uploading a file using fileupload control the tab automatically reset into first tab control.
 
 
Asp.net form code-----
<div style=" margin: 0 auto; padding-bottom: 20px; padding-left: 0px; width: 1000px;">
<ul class="tabs">
<li><a id="one" runat="server" href="#view1">Employee details <asp:Image ID="Image1" runat="server" ImageUrl="~/pics/Man.png" /></a></li>
<li style="width:100px"><a id="two" runat="server" href="#view2">file upload <asp:Image ID="Image28" runat="server" ImageUrl="~/pics/woman.png"/></a></li>
<li><a id="three" runat="server" href="#view3">Final Submit<asp:Image ID="Image2" runat="server" ImageUrl="~/pics/receipts.png" Height="20px" Width="18px"/></a></li>
</ul>
<div class="tabcontents1">
<div id="view3" style="width:980px" class="tabcontents1">
<div style="text-align:left"><h4>File Upload-</h4>
</div>
<%-- 1st File Upload --%>
<div class="form-group has-success" style="margin-top: 30px; margin-bottom: 30px">
<label for="Photo" class="col-md-7">Age Certificate <span class="req">*</span>
</label>
<div class="col-md-3">
<asp:FileUpload ID="Upload1" runat="server" TabIndex="55" />
<asp:HyperLink ID="Link1" runat="server" Font-Bold="False" Font-Names="Times New Roman" Font-Size="Small" Visible="False"></asp:HyperLink>
<asp:Image ID="Img1" runat="server" Visible="False" />
</div>
<div class="col-md-2">
<asp:Button ID="btnUpload1" runat="server" Text="Upload Here" class="btn btn-primary btn-sm" TabIndex="56" CausesValidation="False" OnClick="btnUpload1_Click" />
</div>
</div>
<%-- End of 1st File Upload --%>
</div> 
 
 
Using C# Code ---
/* Add dynamically css attribute to anchor tag */
ContentPlaceHolder M1 = Page.Master.FindControl("ContentPlaceHolder1") as ContentPlaceHolder;
var a1 = M1.FindControl("Tab3") as HtmlAnchor;
a1.Attributes["class"] = "selected";
/* End */
 
please help me how to control tab index after postback.. 
 
 

Answers (1)